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 <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2018-05-07 09:50:02 +03:00 committed by Johan Hedberg
commit ca10b6bc94

View file

@ -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;