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: <72bc86af11bddf9226ed13978ef8d03fec51250c.camel@perches.com>
Date:   Fri, 19 Nov 2021 01:59:21 -0800
From:   Joe Perches <joe@...ches.com>
To:     Bernard Zhao <bernard@...o.com>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        Ilias Apalodimas <ilias.apalodimas@...aro.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net/core: remove useless type conversion to bool

On Thu, 2021-11-18 at 17:54 -0800, Bernard Zhao wrote:
> (ret == 0) is bool value, the type conversion to true/false value
> is not needed.
[]
> diff --git a/net/core/page_pool.c b/net/core/page_pool.c
[]
> @@ -398,7 +398,7 @@ static bool page_pool_recycle_in_ring(struct page_pool *pool, struct page *page)
>  	else
>  		ret = ptr_ring_produce_bh(&pool->ring, page);
>  
> -	return (ret == 0) ? true : false;
> +	return (ret == 0);

This doesn't need the parentheses either.

Maybe:
	return !ret;
or
	return ret == 0;
?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ