* [PATCH -next v2] drivers: net: declance: fix comparing pointer to 0
@ 2020-01-21 9:24 Chen Zhou
2020-01-21 11:10 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Chen Zhou @ 2020-01-21 9:24 UTC (permalink / raw)
To: davem, mhabets, kuba, sergei.shtylyov; +Cc: netdev, linux-kernel, chenzhou10
Fixes coccicheck warning:
./drivers/net/ethernet/amd/declance.c:611:14-15:
WARNING comparing pointer to 0
Replace "skb == 0" with "!skb".
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) =
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next v2] drivers: net: declance: fix comparing pointer to 0
2020-01-21 9:24 [PATCH -next v2] drivers: net: declance: fix comparing pointer to 0 Chen Zhou
@ 2020-01-21 11:10 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-01-21 11:10 UTC (permalink / raw)
To: chenzhou10; +Cc: mhabets, kuba, sergei.shtylyov, netdev, linux-kernel
From: Chen Zhou <chenzhou10@huawei.com>
Date: Tue, 21 Jan 2020 17:24:55 +0800
> Fixes coccicheck warning:
>
> ./drivers/net/ethernet/amd/declance.c:611:14-15:
> WARNING comparing pointer to 0
>
> Replace "skb == 0" with "!skb".
>
> Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-21 11:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21 9:24 [PATCH -next v2] drivers: net: declance: fix comparing pointer to 0 Chen Zhou
2020-01-21 11:10 ` David Miller
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).