Skip to contentSkip to conversation

Fix multiple CHECK

PATCH In review Anchal Jain 2 participants 5 messages Mar 15, 2016 – Mar 21, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Fix multiple CHECK

This patchset updates the nvec driver in order to fix several checkpatch issues detected in the source code.

Anchal Jain (2):
staging: nvec: CHECK: No space is necessary after a cast
staging: nvec: Fixed NULL comparison style

 drivers/staging/nvec/nvec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 staging: nvec: CHECK: No space is necessary after a cast

Remove a CHECK produced by checkpatch.pl

CHECK: No space is necessary after a cast

---
 drivers/staging/nvec/nvec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/nvec/nvec.c +2 -2
index c335ae2..7b7de5a 100644
@@ -663,8 +663,8 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 		} else {
 			dev_err(nvec->dev, "tx buffer underflow on %p (%u > %u)\n",
 				nvec->tx,
-				(uint) (nvec->tx ? nvec->tx->pos : 0),
-				(uint) (nvec->tx ? nvec->tx->size : 0));
+				(uint)(nvec->tx ? nvec->tx->pos : 0),
+				(uint)(nvec->tx ? nvec->tx->size : 0));
 			nvec->state = 0;
 		}
 		break;
Signature · 1 line
1.9.1
#3 lore raw

PATCH 2/2 staging: nvec: Fixed NULL comparison style

In reply to Anchal Jain

Remove a CHECK produced by checkpatch.pl

CHECK: Comparison to NULL could be written "!msg"
CHECK: Comparison to NULL could be written "!nvec->rx"

---
 drivers/staging/nvec/nvec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/nvec/nvec.c +2 -2
index 7b7de5a..76cbc57 100644
@@ -264,7 +264,7 @@ int nvec_write_async(struct nvec_chip *nvec, const unsigned char *data,
 
 	msg = nvec_msg_alloc(nvec, NVEC_MSG_TX);
 
-	if (msg == NULL)
+	if (!msg)
 		return -ENOMEM;
 
 	msg->data[0] = size;
@@ -620,7 +620,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 		} else {
 			nvec->rx = nvec_msg_alloc(nvec, NVEC_MSG_RX);
 			/* Should not happen in a normal world */
-			if (unlikely(nvec->rx == NULL)) {
+			if (unlikely(!nvec->rx)) {
 				nvec->state = 0;
 				break;
 			}
Signature · 1 line
1.9.1
maintainer
#2 lore raw

Re: [Outreachy kernel] [PATCH 1/2] staging: nvec: CHECK: No space is necessary after a cast

In reply to Anchal Jain
Quoted 6 lines · Anchal Jain

Remove a CHECK produced by checkpatch.pl

CHECK: No space is necessary after a cast

Someone sent this before you did :(

maintainer
#4 lore raw

Re: [Outreachy kernel] [PATCH 2/2] staging: nvec: Fixed NULL comparison style

In reply to Anchal Jain
Quoted 6 lines · Anchal Jain

Remove a CHECK produced by checkpatch.pl

CHECK: Comparison to NULL could be written "!msg"
CHECK: Comparison to NULL could be written "!nvec->rx"

Someone sent this before you did :(