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] [thread-next>] [day] [month] [year] [list]
Date: Wed, 28 Feb 2024 08:28:51 -0600
From: Alex Elder <elder@...e.org>
To: Geert Uytterhoeven <geert+renesas@...der.be>,
 Chris Down <chris@...isdown.name>, Petr Mladek <pmladek@...e.com>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
 Jessica Yu <jeyu@...nel.org>, Steven Rostedt <rostedt@...dmis.org>,
 John Ogness <john.ogness@...utronix.de>,
 Sergey Senozhatsky <senozhatsky@...omium.org>,
 Jason Baron <jbaron@...mai.com>, Jim Cromie <jim.cromie@...il.com>,
 Ilya Dryomov <idryomov@...il.com>, Xiubo Li <xiubli@...hat.com>,
 Jeff Layton <jlayton@...nel.org>
Cc: linux-kernel@...r.kernel.org, ceph-devel@...r.kernel.org
Subject: Re: [PATCH net-next] Simplify net_dbg_ratelimited() dummy

On 2/28/24 8:05 AM, Geert Uytterhoeven wrote:
> There is no need to wrap calls to the no_printk() helper inside an
> always-false check, as no_printk() already does that internally.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>

This looks fine.  The only difference I see is that no_printk()
returns a value (always 0), while the old way does not.  You
could cast the result to void to avoid that.

Otherwise:

Reviewed-by: Alex Elder <elder@...aro.org>



> ---
>   include/linux/net.h | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/include/linux/net.h b/include/linux/net.h
> index c9b4a63791a45948..15df6d5f27a7badc 100644
> --- a/include/linux/net.h
> +++ b/include/linux/net.h
> @@ -299,10 +299,7 @@ do {									\
>   	net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
>   #else
>   #define net_dbg_ratelimited(fmt, ...)				\
> -	do {							\
> -		if (0)						\
> -			no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
> -	} while (0)
> +	no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
>   #endif
>   
>   #define net_get_random_once(buf, nbytes)			\


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ