Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] net: dsa: drop explicit NULL comparisons
@ 2026-08-12  6:06 Kai Kuang
  2026-08-12 16:24 ` Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kai Kuang @ 2026-08-12  6:06 UTC (permalink / raw)
  To: netdev; +Cc: andrew, olteanv, f.fainelli, linux-kernel, kk47yx, Kai Kuang

Replace explicit NULL comparisons with the boolean form to follow
the kernel coding style:

  dev->class != NULL  -> dev->class
  user_dev == NULL    -> !user_dev

No functional changes intended.

Signed-off-by: Kai Kuang <kuangkai@kylinos.cn>
---
 net/dsa/dsa.c  | 2 +-
 net/dsa/user.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 9cb732f6b1e3..d72d7a49e113 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -1382,7 +1382,7 @@ static int dsa_switch_parse_of(struct dsa_switch *ds, struct device_node *dn)
 
 static int dev_is_class(struct device *dev, const void *class)
 {
-	if (dev->class != NULL && !strcmp(dev->class->name, class))
+	if (dev->class && !strcmp(dev->class->name, class))
 		return 1;
 
 	return 0;
diff --git a/net/dsa/user.c b/net/dsa/user.c
index 072fa76972cc..7d65bb307c91 100644
--- a/net/dsa/user.c
+++ b/net/dsa/user.c
@@ -2779,7 +2779,7 @@ int dsa_user_create(struct dsa_port *port)
 	user_dev = alloc_netdev_mqs(sizeof(struct dsa_user_priv), name,
 				    assign_type, ether_setup,
 				    ds->num_tx_queues, 1);
-	if (user_dev == NULL)
+	if (!user_dev)
 		return -ENOMEM;
 
 	user_dev->rtnl_link_ops = &dsa_link_ops;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: dsa: drop explicit NULL comparisons
  2026-08-12  6:06 [PATCH net-next] net: dsa: drop explicit NULL comparisons Kai Kuang
@ 2026-08-12 16:24 ` Andrew Lunn
  2026-08-12 18:40 ` Joe Damato
  2026-08-14 21:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2026-08-12 16:24 UTC (permalink / raw)
  To: Kai Kuang; +Cc: netdev, olteanv, f.fainelli, linux-kernel, kk47yx

On Wed, Aug 12, 2026 at 02:06:44PM +0800, Kai Kuang wrote:
> Replace explicit NULL comparisons with the boolean form to follow
> the kernel coding style:
> 
>   dev->class != NULL  -> dev->class
>   user_dev == NULL    -> !user_dev
> 
> No functional changes intended.
> 
> Signed-off-by: Kai Kuang <kuangkai@kylinos.cn>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: dsa: drop explicit NULL comparisons
  2026-08-12  6:06 [PATCH net-next] net: dsa: drop explicit NULL comparisons Kai Kuang
  2026-08-12 16:24 ` Andrew Lunn
@ 2026-08-12 18:40 ` Joe Damato
  2026-08-14 21:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Joe Damato @ 2026-08-12 18:40 UTC (permalink / raw)
  To: Kai Kuang; +Cc: netdev, andrew, olteanv, f.fainelli, linux-kernel, kk47yx

On Wed, Aug 12, 2026 at 02:06:44PM +0800, Kai Kuang wrote:
> Replace explicit NULL comparisons with the boolean form to follow
> the kernel coding style:
> 
>   dev->class != NULL  -> dev->class
>   user_dev == NULL    -> !user_dev
> 
> No functional changes intended.
> 
> Signed-off-by: Kai Kuang <kuangkai@kylinos.cn>
> ---
>  net/dsa/dsa.c  | 2 +-
>  net/dsa/user.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Joe Damato <joe@dama.to>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: dsa: drop explicit NULL comparisons
  2026-08-12  6:06 [PATCH net-next] net: dsa: drop explicit NULL comparisons Kai Kuang
  2026-08-12 16:24 ` Andrew Lunn
  2026-08-12 18:40 ` Joe Damato
@ 2026-08-14 21:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-14 21:20 UTC (permalink / raw)
  To: Kai Kuang; +Cc: netdev, andrew, olteanv, f.fainelli, linux-kernel, kk47yx

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 12 Aug 2026 14:06:44 +0800 you wrote:
> Replace explicit NULL comparisons with the boolean form to follow
> the kernel coding style:
> 
>   dev->class != NULL  -> dev->class
>   user_dev == NULL    -> !user_dev
> 
> No functional changes intended.
> 
> [...]

Here is the summary with links:
  - [net-next] net: dsa: drop explicit NULL comparisons
    https://git.kernel.org/netdev/net-next/c/e6a5d573d24c

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] 4+ messages in thread

end of thread, other threads:[~2026-08-14 21:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-12  6:06 [PATCH net-next] net: dsa: drop explicit NULL comparisons Kai Kuang
2026-08-12 16:24 ` Andrew Lunn
2026-08-12 18:40 ` Joe Damato
2026-08-14 21:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox