diff options
author | Guofeng Yue <yueguofeng@hisilicon.com> | 2022-09-07 08:28:10 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-09-16 11:27:47 +0200 |
commit | b0b815a356aa4f3352563b3350a7b2354c0f2c5c (patch) | |
tree | ad8aca9339484b68bfdd66c280d04de293a488e5 /drivers/net/ethernet/amd/ariadne.c | |
parent | vsock/vmci: fix repeated words in comments (diff) | |
download | linux-b0b815a356aa4f3352563b3350a7b2354c0f2c5c.tar.xz linux-b0b815a356aa4f3352563b3350a7b2354c0f2c5c.zip |
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/ariadne.c')
-rw-r--r-- | drivers/net/ethernet/amd/ariadne.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/amd/ariadne.c b/drivers/net/ethernet/amd/ariadne.c index 4ea7b9f3c424..38153e633231 100644 --- a/drivers/net/ethernet/amd/ariadne.c +++ b/drivers/net/ethernet/amd/ariadne.c @@ -193,7 +193,7 @@ static int ariadne_rx(struct net_device *dev) struct sk_buff *skb; skb = netdev_alloc_skb(dev, pkt_len + 2); - if (skb == NULL) { + if (!skb) { for (i = 0; i < RX_RING_SIZE; i++) if (lowb(priv->rx_ring[(entry + i) % RX_RING_SIZE]->RMD1) & RF_OWN) break; @@ -731,7 +731,7 @@ static int ariadne_init_one(struct zorro_dev *z, } dev = alloc_etherdev(sizeof(struct ariadne_private)); - if (dev == NULL) { + if (!dev) { release_mem_region(base_addr, sizeof(struct Am79C960)); release_mem_region(mem_start, ARIADNE_RAM_SIZE); return -ENOMEM; |