From 135dd1b42edd7e9cf4d9a4f994889a01868b0539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kopy=C5=9Bci=C5=84ski?= Date: Wed, 6 Oct 2021 08:33:16 +0200 Subject: [PATCH] Resolve dead code in store_seg If CONFIG_BT_MESH_SEQ_STORE_RATE is 1, the check in store_seq can be reduced to a simple if (false), and the modulo code does not need to be included in the build. This is port of aef354c6bc3264de9f2a38b8c56ff5253b35912a --- nimble/host/mesh/src/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimble/host/mesh/src/net.c b/nimble/host/mesh/src/net.c index 692989dd2..b3e22aad3 100644 --- a/nimble/host/mesh/src/net.c +++ b/nimble/host/mesh/src/net.c @@ -149,7 +149,7 @@ static void store_iv(bool only_duration) static void store_seq(void) { - if (CONFIG_BT_MESH_SEQ_STORE_RATE && + if (CONFIG_BT_MESH_SEQ_STORE_RATE > 1 && (bt_mesh.seq % CONFIG_BT_MESH_SEQ_STORE_RATE)) { return; }