From: Masami Hiramatsu <mhiramat@kernel.org>
To: zuoqilin1@163.com, Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, zuoqilin <zuoqilin@yulong.com>
Subject: Re: [PATCH] tools/bootconfig: Simplify expression
Date: Sat, 17 Apr 2021 01:09:14 +0900 [thread overview]
Message-ID: <20210417010914.e44504e46680d09eda141f18@kernel.org> (raw)
In-Reply-To: <20210414134647.1870-1-zuoqilin1@163.com>
On Wed, 14 Apr 2021 21:46:47 +0800
zuoqilin1@163.com wrote:
> From: zuoqilin <zuoqilin@yulong.com>
>
> It is not necessary to define the variable ret to receive
> the return value of the xbc_node_compose_key() method.
>
> Signed-off-by: zuoqilin <zuoqilin@yulong.com>
Indeed.
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Thank you!
> ---
> tools/bootconfig/main.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
> index 7362bef..5fb309b 100644
> --- a/tools/bootconfig/main.c
> +++ b/tools/bootconfig/main.c
> @@ -84,11 +84,9 @@ static void xbc_show_list(void)
> char key[XBC_KEYLEN_MAX];
> struct xbc_node *leaf;
> const char *val;
> - int ret = 0;
>
> xbc_for_each_key_value(leaf, val) {
> - ret = xbc_node_compose_key(leaf, key, XBC_KEYLEN_MAX);
> - if (ret < 0)
> + if (xbc_node_compose_key(leaf, key, XBC_KEYLEN_MAX) < 0)
> break;
> printf("%s = ", key);
> if (!val || val[0] == '\0') {
> --
> 1.9.1
>
>
--
Masami Hiramatsu <mhiramat@kernel.org>
prev parent reply other threads:[~2021-04-16 16:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-14 13:46 [PATCH] tools/bootconfig: Simplify expression zuoqilin1
2021-04-16 16:09 ` Masami Hiramatsu [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=20210417010914.e44504e46680d09eda141f18@kernel.org \
--to=mhiramat@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=zuoqilin1@163.com \
--cc=zuoqilin@yulong.com \
/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;
as well as URLs for NNTP newsgroup(s).