linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: <davem@davemloft.net>
Cc: <vz@mleia.com>, <slemieux.tyco@gmail.com>,
	<keescook@chromium.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] ethernet: declance:  Use NULL to compare with pointer-typed value rather than 0
Date: Fri, 17 Aug 2018 21:18:52 +0800	[thread overview]
Message-ID: <1534511933-39236-2-git-send-email-zhongjiang@huawei.com> (raw)
In-Reply-To: <1534511933-39236-1-git-send-email-zhongjiang@huawei.com>

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/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 116997a..6e035df 100644
--- a/drivers/net/ethernet/amd/declance.c
+++ b/drivers/net/ethernet/amd/declance.c
@@ -607,7 +607,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 == NULL) {
 				dev->stats.rx_dropped++;
 				*rds_ptr(rd, mblength, lp->type) = 0;
 				*rds_ptr(rd, rmd1, lp->type) =
-- 
1.7.12.4


  reply	other threads:[~2018-08-17 13:30 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 ` zhong jiang [this message]
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
2018-08-18  6:29 [PATCH 0/2] ethernet: " zhong jiang
2018-08-18  6:29 ` [PATCH 1/2] ethernet: declance: " 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=1534511933-39236-2-git-send-email-zhongjiang@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).