From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
Fabio Estevam <festevam@gmail.com>,
Frans Klaver <fransklaver@gmail.com>,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH v2] staging: most: NULL comparison style
Date: Mon, 24 Aug 2015 19:19:32 +0530 [thread overview]
Message-ID: <1440424172-28629-1-git-send-email-sudipm.mukherjee@gmail.com> (raw)
In-Reply-To: <1439911108-20765-1-git-send-email-sudipm.mukherjee@gmail.com>
checkpatch complains when a variable comparison to NULL is 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
prev parent reply other threads:[~2015-08-24 13:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-18 15:18 [PATCH 1/9] staging: most: NULL comparison style Sudip Mukherjee
2015-08-18 15:18 ` [PATCH 2/9] staging: most: bool " Sudip Mukherjee
2015-08-18 15:18 ` [PATCH 3/9] staging: most: remove multiple blank line Sudip Mukherjee
2015-08-18 15:18 ` [PATCH 4/9] staging: most: out of memory error Sudip Mukherjee
2015-08-18 15:18 ` [PATCH 5/9] staging: most: remove unused functions Sudip Mukherjee
2015-08-18 15:18 ` [PATCH 6/9] staging: most: make functions static Sudip Mukherjee
2015-08-18 15:18 ` [PATCH 7/9] staging: most: use NULL pointer Sudip Mukherjee
2015-08-18 15:18 ` [PATCH 8/9] staging: most: remove unused variable Sudip Mukherjee
2015-08-18 15:18 ` [PATCH 9/9] staging: most: fix Makefile Sudip Mukherjee
2015-08-18 16:31 ` [PATCH 1/9] staging: most: NULL comparison style Fabio Estevam
2015-08-19 10:00 ` Sudip Mukherjee
2015-08-19 14:51 ` Frans Klaver
2015-08-24 13:49 ` Sudip Mukherjee [this message]
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=1440424172-28629-1-git-send-email-sudipm.mukherjee@gmail.com \
--to=sudipm.mukherjee@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=festevam@gmail.com \
--cc=fransklaver@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/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