public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] kexec: Remove redundant assignments
@ 2022-03-26 18:09 Michal Orzel
  2022-03-31 11:22 ` Baoquan He
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Orzel @ 2022-03-26 18:09 UTC (permalink / raw)
  To: Eric Biederman, Nathan Chancellor, Nick Desaulniers
  Cc: Michal Orzel, kexec, linux-kernel, llvm

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]

Signed-off-by: Michal Orzel <michalorzel.eng@gmail.com>
---
 kernel/kexec_core.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 68480f731192..d08904a27362 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -768,7 +768,6 @@ static struct page *kimage_alloc_page(struct kimage *image,
 				kimage_free_pages(old_page);
 				continue;
 			}
-			addr = old_addr;
 			page = old_page;
 			break;
 		}
@@ -788,7 +787,6 @@ static int kimage_load_normal_segment(struct kimage *image,
 	unsigned char __user *buf = NULL;
 	unsigned char *kbuf = NULL;
 
-	result = 0;
 	if (image->file_mode)
 		kbuf = segment->kbuf;
 	else
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-31 11:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-26 18:09 [PATCH] kexec: Remove redundant assignments Michal Orzel
2022-03-31 11:22 ` Baoquan He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox