[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1623828221-48349-5-git-send-email-huangguangbin2@huawei.com>
Date: Wed, 16 Jun 2021 15:23:30 +0800
From: Guangbin Huang <huangguangbin2@...wei.com>
To: <davem@...emloft.net>, <kuba@...nel.org>, <xie.he.0141@...il.com>,
<ms@....tdt.de>, <willemb@...gle.com>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<lipeng321@...wei.com>, <huangguangbin2@...wei.com>
Subject: [PATCH net-next 04/15] net: cosa: replace comparison to NULL with "!chan->rx_skb"
From: Peng Li <lipeng321@...wei.com>
According to the chackpatch.pl, comparison to NULL could
be written "!chan->rx_skb".
Signed-off-by: Peng Li <lipeng321@...wei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@...wei.com>
---
drivers/net/wan/cosa.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index c051c61..7b57233 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -719,7 +719,7 @@ static char *cosa_net_setup_rx(struct channel_data *chan, int size)
*/
kfree_skb(chan->rx_skb);
chan->rx_skb = dev_alloc_skb(size);
- if (chan->rx_skb == NULL) {
+ if (!chan->rx_skb) {
pr_notice("%s: Memory squeeze, dropping packet\n", chan->name);
chan->netdev->stats.rx_dropped++;
return NULL;
@@ -783,7 +783,7 @@ static ssize_t cosa_read(struct file *file,
return -ERESTARTSYS;
chan->rxdata = kmalloc(COSA_MTU, GFP_DMA|GFP_KERNEL);
- if (chan->rxdata == NULL) {
+ if (!chan->rxdata) {
mutex_unlock(&chan->rlock);
return -ENOMEM;
}
@@ -861,7 +861,7 @@ static ssize_t cosa_write(struct file *file,
/* Allocate the buffer */
kbuf = kmalloc(count, GFP_KERNEL|GFP_DMA);
- if (kbuf == NULL) {
+ if (!kbuf) {
up(&chan->wsem);
return -ENOMEM;
}
--
2.8.1
Powered by blists - more mailing lists