Skip to contentSkip to conversation

staging: dgnc: Remove explicit NULL comparison

PATCH In review Muhammad Falak R Wani 2 participants 2 messages Oct 19, 2015 – Oct 25, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: dgnc: Remove explicit NULL comparison

Rewrite explicit NULL comparison in its simpler form. <smpl>
@NULL_REPLACE@
expression e;
@@

-e == NULL
+ !e
</smpl>

---
 drivers/staging/dgnc/dgnc_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/dgnc/dgnc_tty.c +1 -1
index ce4187f..973263e 100644
@@ -1521,7 +1521,7 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty)
 	uint chars = 0;
 	unsigned long flags;
 
-	if (tty == NULL)
+	if (!tty)
 		return 0;
 
 	un = tty->driver_data;
Signature · 1 line
1.9.1
#1 lore raw
Quoted 6 lines · Muhammad Falak R Wani

Rewrite explicit NULL comparison in its simpler form. <smpl>
@NULL_REPLACE@
expression e;
@@

Quoted 8 lines

-e == NULL
+ !e
</smpl>

---
 drivers/staging/dgnc/dgnc_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Someone else already did this before you :(