Skip to contentSkip to conversation

staging: speakup: Fix NULL comparison warning

PATCH In review Daniela Mormocea 2 participants 2 messages Mar 6, 2019 – Mar 7, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: speakup: Fix NULL comparison warning

Replace NULL comparison with '!' operator as indicated by checkpatch

---
 drivers/staging/speakup/spk_ttyio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/speakup/spk_ttyio.c +1 -1
index 0057eb9..5a9eff0 100644
@@ -47,7 +47,7 @@ static int spk_ttyio_ldisc_open(struct tty_struct *tty)
 {
 	struct spk_ldisc_data *ldisc_data;
 
-	if (tty->ops->write == NULL)
+	if (!tty->ops->write)
 		return -EOPNOTSUPP;
 	speakup_tty = tty;
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 13 lines · Daniela Mormocea

Replace NULL comparison with '!' operator as indicated by checkpatch

---
 drivers/staging/speakup/spk_ttyio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/speakup/spk_ttyio.c +0 -0
index 0057eb9..5a9eff0 100644

drivers/staging/speakup/spk_ttyio.c static int spk_ttyio_ldisc_open(struct tty_struct *tty) · line 53

Quoted 8 lines
drivers/staging/speakup/spk_ttyio.c +1 -1
@@ -47,7 +47,7 @@ static int spk_ttyio_ldisc_open(struct tty_struct *tty)
 {
 	struct spk_ldisc_data *ldisc_data;
 
-	if (tty->ops->write == NULL)
+	if (!tty->ops->write)
 		return -EOPNOTSUPP;
 	speakup_tty = tty;
 

Someone already sent this same fix to the same file just before you did, sorry.

greg k-h