mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Elder <elder@ieee.org>
To: Geert Uytterhoeven <geert+renesas@glider.be>,
	Chris Down <chris@chrisdown.name>, Petr Mladek <pmladek@suse.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jessica Yu <jeyu@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	John Ogness <john.ogness@linutronix.de>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Jason Baron <jbaron@akamai.com>,
	Jim Cromie <jim.cromie@gmail.com>,
	Ilya Dryomov <idryomov@gmail.com>, Xiubo Li <xiubli@redhat.com>,
	Jeff Layton <jlayton@kernel.org>
Cc: linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org
Subject: Re: [PATCH net-next] Simplify net_dbg_ratelimited() dummy
Date: Wed, 28 Feb 2024 08:28:51 -0600	[thread overview]
Message-ID: <9a8657f9-e6c8-49b2-9597-21b2192491d3@ieee.org> (raw)
In-Reply-To: <5d75ce122b5cbfe62b018a7719960e34cfcbb1f2.1709128975.git.geert+renesas@glider.be>

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@glider.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@linaro.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)			\


  parent reply	other threads:[~2024-02-28 14:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28 14:05 Geert Uytterhoeven
2024-02-28 14:05 ` Geert Uytterhoeven
2024-02-28 14:28 ` Alex Elder [this message]
2024-02-28 15:43 ` Jiri Pirko
2024-02-28 17:42 ` Andy Shevchenko
2024-03-01  0:40 ` Chris Down
2024-03-01  8:50 ` patchwork-bot+netdevbpf

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=9a8657f9-e6c8-49b2-9597-21b2192491d3@ieee.org \
    --to=elder@ieee.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=chris@chrisdown.name \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=idryomov@gmail.com \
    --cc=jbaron@akamai.com \
    --cc=jeyu@kernel.org \
    --cc=jim.cromie@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=xiubli@redhat.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

all inboxes | Powered by JetHome®