]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: lpc-enet: fix badzero.cocci warnings
authorkbuild test robot <lkp@intel.com>
Fri, 9 Aug 2019 14:40:34 +0000 (16:40 +0200)
committerArnd Bergmann <arnd@arndb.de>
Thu, 15 Aug 2019 19:33:54 +0000 (21:33 +0200)
drivers/net/ethernet/nxp/lpc_eth.c:1316:31-32: WARNING comparing pointer to 0

 Compare pointer-typed values to NULL rather than 0

Semantic patch information:
 This makes an effort to choose between !x and x == NULL.  !x is used
 if it has previously been used with the function used to initialize x.
 This relies on type information.  More type information can be obtained
 using the option -all_includes and the option -I to specify an
 include path.

Generated by: scripts/coccinelle/null/badzero.cocci

Link: https://lore.kernel.org/r/20190809144043.476786-9-arnd@arndb.de
Fixes: e42016eb3844 ("net: lpc-enet: allow compile testing")
Signed-off-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/net/ethernet/nxp/lpc_eth.c

index 0893b77c385db7a7a7d7db07e807fc7b4a87dc84..797bdbbcef762001de1bba1fdfc1483a892b0f20 100644 (file)
@@ -1312,7 +1312,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
                }
        }
 
-       if (pldat->dma_buff_base_v == 0) {
+       if (pldat->dma_buff_base_v == NULL) {
                ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
                if (ret)
                        goto err_out_free_irq;