OSDN Git Service

kexec: remove the unneeded result variable
authorye xingchen <ye.xingchen@zte.com.cn>
Thu, 29 Sep 2022 04:29:34 +0000 (12:29 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 18 Nov 2022 21:55:07 +0000 (13:55 -0800)
Return the value kimage_add_entry() directly instead of storing it in
another redundant variable.

Link: https://lkml.kernel.org/r/20220929042936.22012-3-bhe@redhat.com
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: Baoquan He <bhe@redhat.com>
Reported-by: Zeal Robot <zealci@zte.com.cn>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Chen Lifu <chenlifu@huawei.com>
Cc: "Eric W . Biederman" <ebiederm@xmission.com>
Cc: Jianglei Nie <niejianglei2021@163.com>
Cc: Li Chen <lchen@ambarella.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/kexec_core.c

index ca2743f..969e8f5 100644 (file)
@@ -561,23 +561,17 @@ static int kimage_add_entry(struct kimage *image, kimage_entry_t entry)
 static int kimage_set_destination(struct kimage *image,
                                   unsigned long destination)
 {
-       int result;
-
        destination &= PAGE_MASK;
-       result = kimage_add_entry(image, destination | IND_DESTINATION);
 
-       return result;
+       return kimage_add_entry(image, destination | IND_DESTINATION);
 }
 
 
 static int kimage_add_page(struct kimage *image, unsigned long page)
 {
-       int result;
-
        page &= PAGE_MASK;
-       result = kimage_add_entry(image, page | IND_SOURCE);
 
-       return result;
+       return kimage_add_entry(image, page | IND_SOURCE);
 }