The patch titled Subject: sysctl: remove redundant assignment to first has been added to the -mm tree. Its filename is sysctl-remove-redundant-assignment-to-first.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/sysctl-remove-redundant-assignment-to-first.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/sysctl-remove-redundant-assignment-to-first.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jiapeng Chong <jiapeng.chong@xxxxxxxxxxxxxxxxx> Subject: sysctl: remove redundant assignment to first Variable first is set to '0', but this value is never read as it is not used later on, hence it is a redundant assignment and can be removed. Clean up the following clang-analyzer warning: kernel/sysctl.c:1562:4: warning: Value stored to 'first' is never read [clang-analyzer-deadcode.DeadStores]. Link: https://lkml.kernel.org/r/1620469990-22182-1-git-send-email-jiapeng.chong@xxxxxxxxxxxxxxxxx Signed-off-by: Jiapeng Chong <jiapeng.chong@xxxxxxxxxxxxxxxxx> Reported-by: Abaci Robot <abaci@xxxxxxxxxxxxxxxxx> Acked-by: Luis Chamberlain <mcgrof@xxxxxxxxxx> Cc: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Iurii Zaikin <yzaikin@xxxxxxxxxx> Cc: Alexei Starovoitov <ast@xxxxxxxxxx> Cc: Daniel Borkmann <daniel@xxxxxxxxxxxxx> Cc: Andrii Nakryiko <andrii@xxxxxxxxxx> Cc: Martin KaFai Lau <kafai@xxxxxx> Cc: Song Liu <songliubraving@xxxxxx> Cc: Yonghong Song <yhs@xxxxxx> Cc: John Fastabend <john.fastabend@xxxxxxxxx> Cc: KP Singh <kpsingh@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/sysctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/kernel/sysctl.c~sysctl-remove-redundant-assignment-to-first +++ a/kernel/sysctl.c @@ -1474,7 +1474,6 @@ int proc_do_large_bitmap(struct ctl_tabl void *buffer, size_t *lenp, loff_t *ppos) { int err = 0; - bool first = 1; size_t left = *lenp; unsigned long bitmap_len = table->maxlen; unsigned long *bitmap = *(unsigned long **) table->data; @@ -1559,12 +1558,12 @@ int proc_do_large_bitmap(struct ctl_tabl } bitmap_set(tmp_bitmap, val_a, val_b - val_a + 1); - first = 0; proc_skip_char(&p, &left, '\n'); } left += skipped; } else { unsigned long bit_a, bit_b = 0; + bool first = 1; while (left) { bit_a = find_next_bit(bitmap, bitmap_len, bit_b); _ Patches currently in -mm which might be from jiapeng.chong@xxxxxxxxxxxxxxxxx are sysctl-remove-redundant-assignment-to-first.patch