Skip to contentSkip to conversation

staging: nvec: Use x instead of x != NULL to improve readability.

PATCH In review Tom Mounet 2 participants 2 messages Jun 29, 2024 – Jul 1, 2024

Subsystems (3)
lore
Share & tools
lore

Tom Mounet

author
#0 lore raw

PATCH v3 1/1 staging: nvec: Use x instead of x != NULL to improve readability.

Use x instead of x != NULL to improve readability. Issue identified by checkpatch.

---
v3: Add change history and proper description
v2: Make commit title clearer

 drivers/staging/nvec/nvec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/nvec/nvec.c +2 -2
index e5ca78e57..814eb121c 100644
@@ -300,7 +300,7 @@ int nvec_write_sync(struct nvec_chip *nvec,
 {
 	mutex_lock(&nvec->sync_write_mutex);
 
-	if (msg != NULL)
+	if (msg)
 		*msg = NULL;
 
 	nvec->sync_write_pending = (data[1] << 8) + data[0];
@@ -322,7 +322,7 @@ int nvec_write_sync(struct nvec_chip *nvec,
 
 	dev_dbg(nvec->dev, "nvec_sync_write: pong!\n");
 
-	if (msg != NULL)
+	if (msg)
 		*msg = nvec->last_sync_msg;
 	else
 		nvec_msg_free(nvec, nvec->last_sync_msg);
Signature · 1 line
2.39.2
Reviewed-by on v3 1/1
#1 lore raw
Quoted 25 lines · Tom Mounet

Use x instead of x != NULL to improve readability. Issue identified by checkpatch.

---
v3: Add change history and proper description
v2: Make commit title clearer

  drivers/staging/nvec/nvec.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/nvec/nvec.c +1 -1
index e5ca78e57..814eb121c 100644
@@ -300,7 +300,7 @@ int nvec_write_sync(struct nvec_chip *nvec,
  {
  	mutex_lock(&nvec->sync_write_mutex);
 
-	if (msg != NULL)
+	if (msg)
  		*msg = NULL;
 
  	nvec->sync_write_pending = (data[1] << 8) + data[0];

drivers/staging/nvec/nvec.c int nvec_write_sync(struct nvec_chip *nvec, · line 328

Quoted 8 lines
drivers/staging/nvec/nvec.c +1 -1
@@ -322,7 +322,7 @@ int nvec_write_sync(struct nvec_chip *nvec,
 
  	dev_dbg(nvec->dev, "nvec_sync_write: pong!\n");
 
-	if (msg != NULL)
+	if (msg)
  		*msg = nvec->last_sync_msg;
  	else
  		nvec_msg_free(nvec, nvec->last_sync_msg);