mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 23:59:33 -04:00
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>
This commit is contained in:
committed by
Jakub Kicinski
parent
9958e69b98
commit
e6a5d573d2
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user