lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20210417010914.e44504e46680d09eda141f18@kernel.org>
Date:   Sat, 17 Apr 2021 01:09:14 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     zuoqilin1@....com, Steven Rostedt <rostedt@...dmis.org>
Cc:     linux-kernel@...r.kernel.org, zuoqilin <zuoqilin@...ong.com>
Subject: Re: [PATCH] tools/bootconfig: Simplify expression

On Wed, 14 Apr 2021 21:46:47 +0800
zuoqilin1@....com wrote:

> From: zuoqilin <zuoqilin@...ong.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@...ong.com>

Indeed.

Acked-by: Masami Hiramatsu <mhiramat@...nel.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@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ