Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: mgmt: remove redundant assignment to variable cur_len

Variable cur_len is being ininitialized with a value in the start of
a for-loop but this is never read, it is being re-assigned a new value
on the first statement in the for-loop. The initialization is redundant
and can be removed.

Cleans up clang scan build warning:
net/bluetooth/mgmt.c:7958:14: warning: Although the value stored to 'cur_len'
is used in the enclosing expression, the value is never actually read
from 'cur_len' [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Colin Ian King and committed by
Marcel Holtmann
0ca8794a e89600eb

+1 -1
+1 -1
net/bluetooth/mgmt.c
··· 7955 7955 return false; 7956 7956 7957 7957 /* Make sure that the data is correctly formatted. */ 7958 - for (i = 0, cur_len = 0; i < len; i += (cur_len + 1)) { 7958 + for (i = 0; i < len; i += (cur_len + 1)) { 7959 7959 cur_len = data[i]; 7960 7960 7961 7961 if (!cur_len)