From mboxrd@z Thu Jan 1 00:00:00 1970 From: zhong jiang Subject: Re: [PATCH 2/2] ethernet: lpc_eth: Use NULL to compare with pointer-typed value rather than 0 Date: Sat, 18 Aug 2018 13:59:31 +0800 Message-ID: <5B77B5C3.8060908@huawei.com> References: <1534511933-39236-1-git-send-email-zhongjiang@huawei.com> <1534511933-39236-3-git-send-email-zhongjiang@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: , , , , To: Vladimir Zapolskiy Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 2018/8/17 23:29, Vladimir Zapolskiy wrote: > Hi zhong jiang, > > On 08/17/2018 04:18 PM, zhong jiang wrote: >> We should use NULL to compare with pointer-typed value rather than 0. >> The issue is detected with the help of Coccinelle. >> --- >> drivers/net/ethernet/nxp/lpc_eth.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c >> index 08381ef..04d9e62 100644 >> --- a/drivers/net/ethernet/nxp/lpc_eth.c >> +++ b/drivers/net/ethernet/nxp/lpc_eth.c >> @@ -1350,7 +1350,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) >> "IRAM not big enough for net buffers, using SDRAM instead.\n"); >> } >> >> - if (pldat->dma_buff_base_v == 0) { >> + if (pldat->dma_buff_base_v == NULL) { > That's a valid finding, but please use a common 0 and NULL comparison in form of > > if (!pldat->dma_buff_base_v) > > To the change above please feel free to add my > > Acked-by: Vladimir Zapolskiy Thanks, Will do in v2 >> ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); >> if (ret) >> goto err_out_free_irq; >> > > . >