kexec.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] kexec: Remove the unneeded result variable
@ 2022-09-08  1:03 cgel.zte
  2022-09-28  6:48 ` Baoquan He
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-09-08  1:03 UTC (permalink / raw)
  To: ebiederm; +Cc: kexec, linux-kernel, ye xingchen, Zeal Robot

From: ye xingchen <ye.xingchen@zte.com.cn>

Return the value kimage_add_entry() directly instead of storing it in
another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 kernel/kexec_core.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index ca2743f9c634..969e8f52f7da 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -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);
 }
 
 
-- 
2.25.1

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH linux-next] kexec: Remove the unneeded result variable
  2022-09-08  1:03 [PATCH linux-next] kexec: Remove the unneeded result variable cgel.zte
@ 2022-09-28  6:48 ` Baoquan He
  0 siblings, 0 replies; 2+ messages in thread
From: Baoquan He @ 2022-09-28  6:48 UTC (permalink / raw)
  To: cgel.zte; +Cc: ebiederm, kexec, linux-kernel, ye xingchen, Zeal Robot

On 09/08/22 at 01:03am, cgel.zte@gmail.com wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Return the value kimage_add_entry() directly instead of storing it in
> another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>

LGTM,

Acked-by: Baoquan He <bhe@redhat.com>

> ---
>  kernel/kexec_core.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
> index ca2743f9c634..969e8f52f7da 100644
> --- a/kernel/kexec_core.c
> +++ b/kernel/kexec_core.c
> @@ -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);
>  }
>  
>  
> -- 
> 2.25.1
> 


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

end of thread, other threads:[~2022-09-28  6:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-08  1:03 [PATCH linux-next] kexec: Remove the unneeded result variable cgel.zte
2022-09-28  6:48 ` Baoquan He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).