From ca10b6bc94253c921da1d1c0a3dff8c82608beb3 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 7 May 2018 09:50:02 +0300 Subject: [PATCH] Bluetooth: Mesh: Remove redundant initialization This for loop runs inside an "if (!sub)" branch, so explicitly setting sub to NULL in the loop is redundant. Signed-off-by: Johan Hedberg --- subsys/bluetooth/host/mesh/cfg_srv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/mesh/cfg_srv.c b/subsys/bluetooth/host/mesh/cfg_srv.c index 02b5dade61c..d3222a82b82 100644 --- a/subsys/bluetooth/host/mesh/cfg_srv.c +++ b/subsys/bluetooth/host/mesh/cfg_srv.c @@ -1965,7 +1965,7 @@ static void net_key_add(struct bt_mesh_model *model, if (!sub) { int i; - for (sub = NULL, i = 0; i < ARRAY_SIZE(bt_mesh.sub); i++) { + for (i = 0; i < ARRAY_SIZE(bt_mesh.sub); i++) { if (bt_mesh.sub[i].net_idx == BT_MESH_KEY_UNUSED) { sub = &bt_mesh.sub[i]; break;