* [PATCH net-next] Simplify net_dbg_ratelimited() dummy
2024-02-28 14:05 [PATCH net-next] Simplify net_dbg_ratelimited() dummy Geert Uytterhoeven
@ 2024-02-28 14:05 ` Geert Uytterhoeven
2024-02-28 14:28 ` Alex Elder
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2024-02-28 14:05 UTC (permalink / raw)
To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Geert Uytterhoeven
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>
---
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) \
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH net-next] Simplify net_dbg_ratelimited() dummy
2024-02-28 14:05 [PATCH net-next] Simplify net_dbg_ratelimited() dummy Geert Uytterhoeven
2024-02-28 14:05 ` Geert Uytterhoeven
@ 2024-02-28 14:28 ` Alex Elder
2024-02-28 15:43 ` Jiri Pirko
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Alex Elder @ 2024-02-28 14:28 UTC (permalink / raw)
To: Geert Uytterhoeven, Chris Down, Petr Mladek, Greg Kroah-Hartman,
Andy Shevchenko, Jessica Yu, Steven Rostedt, John Ogness,
Sergey Senozhatsky, Jason Baron, Jim Cromie, Ilya Dryomov,
Xiubo Li, Jeff Layton
Cc: linux-kernel, ceph-devel
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) \
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net-next] Simplify net_dbg_ratelimited() dummy
2024-02-28 14:05 [PATCH net-next] Simplify net_dbg_ratelimited() dummy Geert Uytterhoeven
2024-02-28 14:05 ` Geert Uytterhoeven
2024-02-28 14:28 ` Alex Elder
@ 2024-02-28 15:43 ` Jiri Pirko
2024-02-28 17:42 ` Andy Shevchenko
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Jiri Pirko @ 2024-02-28 15:43 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev, linux-kernel
Wed, Feb 28, 2024 at 03:05:29PM CET, geert+renesas@glider.be 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>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net-next] Simplify net_dbg_ratelimited() dummy
2024-02-28 14:05 [PATCH net-next] Simplify net_dbg_ratelimited() dummy Geert Uytterhoeven
` (2 preceding siblings ...)
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
5 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2024-02-28 17:42 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Chris Down, Petr Mladek, Greg Kroah-Hartman, Jessica Yu,
Steven Rostedt, John Ogness, Sergey Senozhatsky, Jason Baron,
Jim Cromie, Ilya Dryomov, Xiubo Li, Jeff Layton, linux-kernel,
ceph-devel
On Wed, Feb 28, 2024 at 03:05:02PM +0100, 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.
This also makes sense.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net-next] Simplify net_dbg_ratelimited() dummy
2024-02-28 14:05 [PATCH net-next] Simplify net_dbg_ratelimited() dummy Geert Uytterhoeven
` (3 preceding siblings ...)
2024-02-28 17:42 ` Andy Shevchenko
@ 2024-03-01 0:40 ` Chris Down
2024-03-01 8:50 ` patchwork-bot+netdevbpf
5 siblings, 0 replies; 7+ messages in thread
From: Chris Down @ 2024-03-01 0:40 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Petr Mladek, Greg Kroah-Hartman, Andy Shevchenko, Jessica Yu,
Steven Rostedt, John Ogness, Sergey Senozhatsky, Jason Baron,
Jim Cromie, Ilya Dryomov, Xiubo Li, Jeff Layton, linux-kernel,
ceph-devel
Geert Uytterhoeven writes:
>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>
In the context of the larger printk index changes:
Acked-by: Chris Down <chris@chrisdown.name>
>---
> 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) \
>--
>2.34.1
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net-next] Simplify net_dbg_ratelimited() dummy
2024-02-28 14:05 [PATCH net-next] Simplify net_dbg_ratelimited() dummy Geert Uytterhoeven
` (4 preceding siblings ...)
2024-03-01 0:40 ` Chris Down
@ 2024-03-01 8:50 ` patchwork-bot+netdevbpf
5 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-03-01 8:50 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: davem, edumazet, kuba, pabeni, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:
On Wed, 28 Feb 2024 15:05:29 +0100 you 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>
> ---
> include/linux/net.h | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
Here is the summary with links:
- [net-next] Simplify net_dbg_ratelimited() dummy
https://git.kernel.org/netdev/net-next/c/f29f9199c2d2
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread