diff options
| author | Kai Kuang <kuangkai@kylinos.cn> | 2026-08-12 14:06:44 +0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-08-14 13:57:27 -0700 |
| commit | e6a5d573d24cd375e09d24f136523cb3cc85c9d3 (patch) | |
| tree | 0a45c214c1ba842741f45d57d9c71a3b17b62888 /net/dsa | |
| parent | 9958e69b98930834a576e156f6458166d1db1c02 (diff) | |
net: dsa: drop explicit NULL comparisons
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>
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260812060644.210997-1-kuangkai@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/dsa')
| -rw-r--r-- | net/dsa/dsa.c | 2 | ||||
| -rw-r--r-- | 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 da53a666d4b8..2771c34e8400 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -1383,7 +1383,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 4065c6ee6fc6..041f9060c8ef 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; |
