diff options
author | Meghana Madhyastha <meghana.madhyastha@gmail.com> | 2017-09-15 11:13:15 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-09-18 11:52:36 +0200 |
commit | 6561e82d93e12744f1fa2048b6a17e5739682749 (patch) | |
tree | 25052e4081ad997de91b76c824d297485988290a | |
parent | staging: irda: Remove typedef struct (diff) | |
download | linux-6561e82d93e12744f1fa2048b6a17e5739682749.tar.xz linux-6561e82d93e12744f1fa2048b6a17e5739682749.zip |
Staging: irda: drivers: Replace (skb == NULL) with (!skb)
Some functions return NULL as an indication of failure.
The style (!skb) is more common than (skb == NULL) for these
functions.
Found by the following Coccinelle script.
@@
identifier i;
statement S;
@@
i = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|usb_alloc_urb\|
alloc_netdev\|dev_alloc_skb\)(...));
(
-if (i == NULL)
+if (!i)
S
|
-if (NULL == i)
+if (!i)
S
)
Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/irda/drivers/ali-ircc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/irda/drivers/ali-ircc.c b/drivers/staging/irda/drivers/ali-ircc.c index 35f198d83701..756ae53dc1ec 100644 --- a/drivers/staging/irda/drivers/ali-ircc.c +++ b/drivers/staging/irda/drivers/ali-ircc.c @@ -1876,7 +1876,7 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) self->stamp = ktime_get(); skb = dev_alloc_skb(len+1); - if (skb == NULL) + if (!skb) { self->netdev->stats.rx_dropped++; |