linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: Vladimir Zapolskiy <vz@mleia.com>
Cc: <davem@davemloft.net>, <slemieux.tyco@gmail.com>,
	<keescook@chromium.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
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	[thread overview]
Message-ID: <5B77B5C3.8060908@huawei.com> (raw)
In-Reply-To: <edc2f14f-8694-3160-47b1-ccb5be8a3484@mleia.com>

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 <vz@mleia.com>
 Thanks, Will do in v2
>>  		ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
>>  		if (ret)
>>  			goto err_out_free_irq;
>>
>
> .
>



  reply	other threads:[~2018-08-18  5:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17 13:18 [PATCH 0/2] ethernet: Use NULL to compare with pointer-typed value rather than 0 zhong jiang
2018-08-17 13:18 ` [PATCH 1/2] ethernet: declance: " zhong jiang
2018-08-17 13:18 ` [PATCH 2/2] ethernet: lpc_eth: " zhong jiang
2018-08-17 15:29   ` Vladimir Zapolskiy
2018-08-18  5:59     ` zhong jiang [this message]
2018-08-18  6:29 [PATCH 0/2] ethernet: " zhong jiang
2018-08-18  6:29 ` [PATCH 2/2] ethernet: lpc_eth: " zhong jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5B77B5C3.8060908@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=davem@davemloft.net \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=slemieux.tyco@gmail.com \
    --cc=vz@mleia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).