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/lance.c | |
parent | 454e7b138436a31a17753de58f2178c3e955886c (diff) | |
download | lwn-b0b815a356aa4f3352563b3350a7b2354c0f2c5c.tar.gz lwn-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/lance.c')
-rw-r--r-- | drivers/net/ethernet/amd/lance.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/amd/lance.c b/drivers/net/ethernet/amd/lance.c index 462016666752..fb8686214a32 100644 --- a/drivers/net/ethernet/amd/lance.c +++ b/drivers/net/ethernet/amd/lance.c @@ -880,7 +880,7 @@ lance_init_ring(struct net_device *dev, gfp_t gfp) rx_buff = skb->data; else rx_buff = kmalloc(PKT_BUF_SZ, GFP_DMA | gfp); - if (rx_buff == NULL) + if (!rx_buff) lp->rx_ring[i].base = 0; else lp->rx_ring[i].base = (u32)isa_virt_to_bus(rx_buff) | 0x80000000; @@ -1186,7 +1186,7 @@ lance_rx(struct net_device *dev) else { skb = dev_alloc_skb(pkt_len+2); - if (skb == NULL) + if (!skb) { printk("%s: Memory squeeze, deferring packet.\n", dev->name); for (i=0; i < RX_RING_SIZE; i++) |