mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 02/16] Staging: speakup: devsynth.c: Remove explicit NULL comparison
@ 2015-09-11  6:02 Shraddha Barke
  2015-09-11  6:02 ` [PATCH v2 03/16] Staging: speakup: serialio.c: " Shraddha Barke
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shraddha Barke @ 2015-09-11  6:02 UTC (permalink / raw)
  To: Samuel Thibault, Greg Kroah-Hartman, Julia Lawall
  Cc: speakup, linux-kernel, Shraddha Barke

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>
---
Change in v2-
 No change

 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-11  6:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-11  6:02 [PATCH v2 02/16] Staging: speakup: devsynth.c: Remove explicit NULL comparison Shraddha Barke
2015-09-11  6:02 ` [PATCH v2 03/16] Staging: speakup: serialio.c: " Shraddha Barke
2015-09-11  6:02 ` [PATCH v2 04/16] Staging: speakup: kobjects.c: " Shraddha Barke
2015-09-11  6:02 ` [PATCH v2 01/16] Staging: speakup: varhandlers.c: " Shraddha Barke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®