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

kexec: remove redundant assignments

Get rid of redundant assignments which end up in values not being read
either because they are overwritten or the function ends.

Reported by clang-tidy [deadcode.DeadStores]

Link: https://lkml.kernel.org/r/20220326180948.192154-1-michalorzel.eng@gmail.com
Signed-off-by: Michal Orzel <michalorzel.eng@gmail.com>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Michal Orzel <michalorzel.eng@gmail.com>

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Michal Orzel and committed by
akpm
16b0b7ad f224cabe

-2
-2
kernel/kexec_core.c
··· 768 768 kimage_free_pages(old_page); 769 769 continue; 770 770 } 771 - addr = old_addr; 772 771 page = old_page; 773 772 break; 774 773 } ··· 787 788 unsigned char __user *buf = NULL; 788 789 unsigned char *kbuf = NULL; 789 790 790 - result = 0; 791 791 if (image->file_mode) 792 792 kbuf = segment->kbuf; 793 793 else