From: Baoquan He <bhe@redhat.com>
To: cgel.zte@gmail.com
Cc: ebiederm@xmission.com, kexec@lists.infradead.org,
Minghao Chi <chi.minghao@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH kernel-next] kernel: remove redundant result variable
Date: Mon, 27 Dec 2021 15:19:07 +0800 [thread overview]
Message-ID: <20211227071907.GB2731@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20211215055913.441464-1-chi.minghao@zte.com.cn>
On 12/15/21 at 05:59am, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
>
> Return value from kimage_add_entry() directly instead
> of taking this in another redundant variable.
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Nice clean up, looks good to me. Thx.
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 5a5d192a89ac..574391de1f83 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
prev parent reply other threads:[~2021-12-27 7:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-15 5:59 [PATCH kernel-next] kernel: remove redundant result variable cgel.zte
2021-12-27 7:19 ` Baoquan He [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211227071907.GB2731@MiWiFi-R3L-srv \
--to=bhe@redhat.com \
--cc=cgel.zte@gmail.com \
--cc=chi.minghao@zte.com.cn \
--cc=ebiederm@xmission.com \
--cc=kexec@lists.infradead.org \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox