From b0b815a356aa4f3352563b3350a7b2354c0f2c5c Mon Sep 17 00:00:00 2001 From: Guofeng Yue Date: Wed, 7 Sep 2022 14:28:10 +0800 Subject: net: amd: Unified the comparison between pointers and NULL to the same writing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Haoyue Xu Signed-off-by: David S. Miller --- drivers/net/ethernet/amd/lance.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/net/ethernet/amd/lance.c') 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++) -- cgit v1.2.3