diff options
| author | Guofeng Yue <yueguofeng@hisilicon.com> | 2022-09-07 14:28:10 +0800 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2022-09-16 10:27:47 +0100 |
| commit | b0b815a356aa4f3352563b3350a7b2354c0f2c5c (patch) | |
| tree | ad8aca9339484b68bfdd66c280d04de293a488e5 /drivers/net/ethernet/amd/au1000_eth.c | |
| parent | 454e7b138436a31a17753de58f2178c3e955886c (diff) | |
net: amd: Unified the comparison between pointers and NULL to the same writing
Using the unified way to compare pointers and NULL, which cleans the static
warning.
eg:
if (skb == NULL) --> if (!skb)
if (skb != NULL) --> if (skb)
Signed-off-by: Guofeng Yue <yueguofeng@hisilicon.com>
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amd/au1000_eth.c')
| -rw-r--r-- | drivers/net/ethernet/amd/au1000_eth.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c index 81d5af00d30d..c5cec4e79489 100644 --- a/drivers/net/ethernet/amd/au1000_eth.c +++ b/drivers/net/ethernet/amd/au1000_eth.c @@ -786,7 +786,7 @@ static int au1000_rx(struct net_device *dev) frmlen = (status & RX_FRAME_LEN_MASK); frmlen -= 4; /* Remove FCS */ skb = netdev_alloc_skb(dev, frmlen + 2); - if (skb == NULL) { + if (!skb) { dev->stats.rx_dropped++; continue; } @@ -1199,7 +1199,7 @@ static int au1000_probe(struct platform_device *pdev) } aup->mii_bus = mdiobus_alloc(); - if (aup->mii_bus == NULL) { + if (!aup->mii_bus) { dev_err(&pdev->dev, "failed to allocate mdiobus structure\n"); err = -ENOMEM; goto err_mdiobus_alloc; @@ -1284,7 +1284,7 @@ static int au1000_probe(struct platform_device *pdev) return 0; err_out: - if (aup->mii_bus != NULL) + if (aup->mii_bus) mdiobus_unregister(aup->mii_bus); /* here we should have a valid dev plus aup-> register addresses |
