Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1209296
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/9] staging: most: NULL comparison style |
| Date | 2015-08-18 17:20 +0200 |
| Message-ID | <pYQQa-1B4-3@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
According to the kernel coding style the NULL check should not be
written as [variable] == NULL or [variable] != NULL.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/most/aim-cdev/cdev.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c
index 0a13d8d..7b637f3 100644
--- a/drivers/staging/most/aim-cdev/cdev.c
+++ b/drivers/staging/most/aim-cdev/cdev.c
@@ -174,7 +174,7 @@ static ssize_t aim_write(struct file *filp, const char __user *buf,
channel->wq,
(mbo = most_get_mbo(channel->iface,
channel->channel_id)) ||
- (channel->dev == NULL)))
+ (!channel->dev)))
return -ERESTARTSYS;
}
@@ -230,12 +230,12 @@ aim_read(struct file *filp, char __user *buf, size_t count, loff_t *offset)
goto start_copy;
}
while ((0 == kfifo_out(&channel->fifo, &mbo, 1))
- && (channel->dev != NULL)) {
+ && (channel->dev)) {
if (filp->f_flags & O_NONBLOCK)
return -EAGAIN;
if (wait_event_interruptible(channel->wq,
(!kfifo_is_empty(&channel->fifo) ||
- (channel->dev == NULL))))
+ (!channel->dev))))
return -ERESTARTSYS;
}
@@ -300,7 +300,7 @@ static int aim_disconnect_channel(struct most_interface *iface, int channel_id)
}
channel = get_channel(iface, channel_id);
- if (channel == NULL)
+ if (!channel)
return -ENXIO;
mutex_lock(&channel->io_mutex);
@@ -337,7 +337,7 @@ static int aim_rx_completion(struct mbo *mbo)
return -EINVAL;
channel = get_channel(mbo->ifp, mbo->hdm_channel_id);
- if (channel == NULL)
+ if (!channel)
return -ENXIO;
kfifo_in(&channel->fifo, &mbo, 1);
@@ -370,7 +370,7 @@ static int aim_tx_completion(struct most_interface *iface, int channel_id)
}
channel = get_channel(iface, channel_id);
- if (channel == NULL)
+ if (!channel)
return -ENXIO;
wake_up_interruptible(&channel->wq);
return 0;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 1/9] staging: most: NULL comparison style Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-18 17:20 +0200
[PATCH 4/9] staging: most: out of memory error Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-18 17:20 +0200
[PATCH 8/9] staging: most: remove unused variable Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-18 17:20 +0200
[PATCH 9/9] staging: most: fix Makefile Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-18 17:20 +0200
[PATCH 6/9] staging: most: make functions static Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-18 17:20 +0200
[PATCH 5/9] staging: most: remove unused functions Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-18 17:20 +0200
[PATCH 7/9] staging: most: use NULL pointer Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-18 17:20 +0200
[PATCH 3/9] staging: most: remove multiple blank line Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-18 17:20 +0200
[PATCH 2/9] staging: most: bool comparison style Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-18 17:30 +0200
Re: [PATCH 1/9] staging: most: NULL comparison style Fabio Estevam <festevam@gmail.com> - 2015-08-18 18:40 +0200
Re: [PATCH 1/9] staging: most: NULL comparison style Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-19 12:10 +0200
Re: [PATCH 1/9] staging: most: NULL comparison style Frans Klaver <fransklaver@gmail.com> - 2015-08-19 17:00 +0200
csiph-web