From: Shraddha Barke <shraddha.6596@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Samuel Thibault <samuel.thibault@ens-lyon.org>,
Julia Lawall <julia.lawall@lip6.fr>
Cc: William Hubbs <w.d.hubbs@gmail.com>,
speakup@linux-speakup.org, linux-kernel@vger.kernel.org,
Shraddha Barke <shraddha.6596@gmail.com>
Subject: [PATCH 02/16] Staging: speakup: devsynth.c: Remove explicit NULL comparison
Date: Fri, 11 Sep 2015 07:25:00 +0530 [thread overview]
Message-ID: <1441936502-2396-2-git-send-email-shraddha.6596@gmail.com> (raw)
In-Reply-To: <1441936502-2396-1-git-send-email-shraddha.6596@gmail.com>
Remove explicit NULL comparison and write it in its simpler form.
Replacement done with coccinelle:
@replace_rule@
expression e;
@@
-e == NULL
+ !e
Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
drivers/staging/speakup/devsynth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/speakup/devsynth.c b/drivers/staging/speakup/devsynth.c
index 71c728a..d1ffdf4 100644
--- a/drivers/staging/speakup/devsynth.c
+++ b/drivers/staging/speakup/devsynth.c
@@ -22,7 +22,7 @@ static ssize_t speakup_file_write(struct file *fp, const char __user *buffer,
unsigned long flags;
u_char buf[256];
- if (synth == NULL)
+ if (!synth)
return -ENODEV;
while (count > 0) {
bytes = min(count, sizeof(buf));
@@ -45,7 +45,7 @@ static ssize_t speakup_file_read(struct file *fp, char __user *buf,
static int speakup_file_open(struct inode *ip, struct file *fp)
{
- if (synth == NULL)
+ if (!synth)
return -ENODEV;
if (xchg(&dev_opened, 1))
return -EBUSY;
--
2.1.4
next prev parent reply other threads:[~2015-09-11 1:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 1:54 [PATCH 01/16] Staging: speakup: varhandlers.c: Remove explicit NULL comparison Shraddha Barke
2015-09-11 1:55 ` Shraddha Barke [this message]
2015-09-11 1:55 ` [PATCH 03/16] Staging: speakup: serialio.c: " Shraddha Barke
2015-09-11 1:55 ` [PATCH 04/16] Staging: speakup: kobjects.c: " Shraddha Barke
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=1441936502-2396-2-git-send-email-shraddha.6596@gmail.com \
--to=shraddha.6596@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=samuel.thibault@ens-lyon.org \
--cc=speakup@linux-speakup.org \
--cc=w.d.hubbs@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).