From mboxrd@z Thu Jan 1 00:00:00 1970 From: zhong jiang Subject: [PATCHv2] ide: Use NULL to compare with pointer-typed value rather than 0 Date: Sat, 18 Aug 2018 14:16:01 +0800 Message-ID: <1534572961-16423-1-git-send-email-zhongjiang@huawei.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Sender: linux-kernel-owner@vger.kernel.org To: davem@davemloft.net Cc: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-ide@vger.kernel.org We should use NULL to compare with pointer-typed value rather than 0. The issue is detected with the help of Coccinelle. Signed-off-by: zhong jiang --- drivers/ide/pmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c index c5b902b..ca36a97 100644 --- a/drivers/ide/pmac.c +++ b/drivers/ide/pmac.c @@ -1682,7 +1682,7 @@ static int pmac_ide_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d) /* We won't need pci_dev if we switch to generic consistent * DMA routines ... */ - if (dev == NULL || pmif->dma_regs == 0) + if (!dev || !pmif->dma_regs) return -ENODEV; /* * Allocate space for the DBDMA commands. -- 1.7.12.4