kexec: Remove the unneeded result variable
Subsystems (3)
PATCH 1/1 kexec: Remove the unneeded result variable
From: ye xingchen <[email protected]>
Return the value kimage_add_entry() directly instead of storing it in another redundant variable.
Reported-by Zeal Robot <[email protected]>
Signed-off-by ye xingchen <[email protected]>
--- kernel/kexec_core.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
kernel/kexec_core.c +2 -8
@@ -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 ); }
Signature · 1 line
2.25.1
Quoted 7 lines · On 09/08/22 at 01:03am, [email protected] wrote:
From: ye xingchen <[email protected]>
Return the value
kimage_add_entry()directly instead of storing it in another redundant variable.Reported-by Zeal Robot <[email protected]>Signed-off-by ye xingchen <[email protected]>
LGTM,
Acked-by Baoquan He <[email protected]>
Quoted 37 lines
--- kernel/kexec_core.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)kernel/kexec_core.c +2
-8@@ -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 ); }Signature · 1 line
2.25.1
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec