mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chen Zhou <chenzhou10@huawei.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	<davem@davemloft.net>, <mhabets@solarflare.com>,
	<kuba@kernel.org>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] drivers: net: declance: fix comparing pointer to 0
Date: Tue, 21 Jan 2020 16:54:15 +0800	[thread overview]
Message-ID: <86f4d4a0-627d-84aa-c785-4dac426b7cc6@huawei.com> (raw)
In-Reply-To: <40eb3815-f677-c2fd-3e67-4b39bb332f48@cogentembedded.com>

Hi Sergei,

On 2020/1/21 16:39, Sergei Shtylyov wrote:
> Hello!
> 
> On 21.01.2020 4:35, Chen Zhou wrote:
> 
>> Fixes coccicheck warning:
>>
>> ./drivers/net/ethernet/amd/declance.c:611:14-15:
>>     WARNING comparing pointer to 0
>>
>> Compare pointer-typed values to NULL rather than 0.
> 
>    I don't see NULL in the patch -- you used ! instead.

Yeah, i used ! here.

Thanks,
Chen Zhou

> 
>> Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
>> ---
>>   drivers/net/ethernet/amd/declance.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/amd/declance.c b/drivers/net/ethernet/amd/declance.c
>> index 6592a2d..7282ce5 100644
>> --- a/drivers/net/ethernet/amd/declance.c
>> +++ b/drivers/net/ethernet/amd/declance.c
>> @@ -608,7 +608,7 @@ static int lance_rx(struct net_device *dev)
>>               len = (*rds_ptr(rd, mblength, lp->type) & 0xfff) - 4;
>>               skb = netdev_alloc_skb(dev, len + 2);
>>   -            if (skb == 0) {
>> +            if (!skb) {
>>                   dev->stats.rx_dropped++;
>>                   *rds_ptr(rd, mblength, lp->type) = 0;
>>                   *rds_ptr(rd, rmd1, lp->type) =
> 
> MBR, Sergei
> 
> 


  reply	other threads:[~2020-01-21  8:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21  1:35 Chen Zhou
2020-01-21  8:39 ` Sergei Shtylyov
2020-01-21  8:54   ` Chen Zhou [this message]
2020-01-21  9:01     ` Sergei Shtylyov
2020-01-21  9:18       ` Chen Zhou

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=86f4d4a0-627d-84aa-c785-4dac426b7cc6@huawei.com \
    --to=chenzhou10@huawei.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhabets@solarflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.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

all inboxes | Powered by JetHome®