Skip to contentSkip to conversation

Staging: i4l: Remove NULL comparison.

PATCH Superseded Sandhya Bankar 2 participants 2 messages Sep 17, 2016 Staging

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: i4l: Remove NULL comparison.

This patch removes the explicit NULL comparison.This issue was found by checkpatch.

---
Changes in v2:
* Correcting commit message.

 drivers/staging/i4l/act2000/act2000_isa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/i4l/act2000/act2000_isa.c +2 -2
index c800da8..808bb3b 100755
@@ -166,7 +166,7 @@ act2000_isa_config_port(act2000_card *card, unsigned short portbase)
 		release_region(card->port, ISA_REGION);
 		card->flags &= ~ACT2000_FLAGS_PVALID;
 	}
-	if (request_region(portbase, ACT2000_PORTLEN, card->regname) == NULL)
+	if (!request_region(portbase, ACT2000_PORTLEN, card->regname))
 		return -EBUSY;
 	else {
 		card->port = portbase;
@@ -244,7 +244,7 @@ act2000_isa_receive(act2000_card *card)
 				if (valid) {
 					card->idat.isa.rcvlen = ((actcapi_msghdr *)&card->idat.isa.rcvhdr)->len;
 					card->idat.isa.rcvskb = dev_alloc_skb(card->idat.isa.rcvlen);
-					if (card->idat.isa.rcvskb == NULL) {
+					if (!card->idat.isa.rcvskb) {
 						card->idat.isa.rcvignore = 1;
 						printk(KERN_WARNING
 						       "act2000_isa_receive: no memory\n");
Signature · 1 line
1.7.1
#1 lore raw
Quoted 2 lines · Sandhya Bankar

This patch removes the explicit NULL comparison.This issue was found by checkpatch.

The commit message looks better, but you still need a space after the end of the first sentence.

julia

Quoted 40 lines

---
Changes in v2:
* Correcting commit message.

 drivers/staging/i4l/act2000/act2000_isa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/i4l/act2000/act2000_isa.c +2 -3
index c800da8..808bb3b 100755
@@ -166,7 +166,7 @@ act2000_isa_config_port(act2000_card *card, unsigned short portbase)
 		release_region(card->port, ISA_REGION);
 		card->flags &= ~ACT2000_FLAGS_PVALID;
 	}
-	if (request_region(portbase, ACT2000_PORTLEN, card->regname) == NULL)
+	if (!request_region(portbase, ACT2000_PORTLEN, card->regname))
 		return -EBUSY;
 	else {
 		card->port = portbase;
@@ -244,7 +244,7 @@ act2000_isa_receive(act2000_card *card)
 				if (valid) {
 					card->idat.isa.rcvlen = ((actcapi_msghdr *)&card->idat.isa.rcvhdr)->len;
 					card->idat.isa.rcvskb = dev_alloc_skb(card->idat.isa.rcvlen);
-					if (card->idat.isa.rcvskb == NULL) {
+					if (!card->idat.isa.rcvskb) {
 						card->idat.isa.rcvignore = 1;
 						printk(KERN_WARNING
 						       "act2000_isa_receive: no memory\n");
--

1.7.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160917015330.GA14957%40sandhya.
For more options, visit https://groups.google.com/d/optout.