Skip to content

Commit

Permalink
Bluetooth: Mesh: Resolve dead code in store_seg
Browse files Browse the repository at this point in the history
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.

Fixes zephyrproject-rtos#33036.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
  • Loading branch information
trond-snekvik committed Mar 8, 2021
1 parent 3ef6036 commit fed0876
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/bluetooth/mesh/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,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;
}
Expand Down

0 comments on commit fed0876

Please sign in to comment.