Skip to contentSkip to conversation

bsr: do not use assignment in if condition

PATCH In review [email protected] 2 participants 2 messages May 15, 2019 – May 16, 2019 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 bsr: do not use assignment in if condition

From: Naveen Kumar Parna <[email protected]>

checkpatch.pl does not like assignment in if condition

---
Changes in v3:
The first patch has an extra space in if statement, so fixed it in v2 but forgot add what changed from the previous version. In v3 added the complete change history.

 drivers/char/bsr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/char/bsr.c +2 -1
index a6cef548e01e..70de334554a8 100644
@@ -322,7 +322,8 @@ static int __init bsr_init(void)
 		goto out_err_2;
 	}
 
-	if ((ret = bsr_create_devs(np)) < 0) {
+	ret = bsr_create_devs(np);
+	if (ret < 0) {
 		np = NULL;
 		goto out_err_3;
 	}
Signature · 1 line
2.17.1
Reviewed-by on v3 1/1
#1 lore raw
Quoted 5 lines · On 5/15/2019 9:47 PM, [email protected] wrote:

From: Naveen Kumar Parna <[email protected]>

checkpatch.pl does not like assignment in if condition

Cheers,
-Mukesh

Quoted 23 lines

---
Changes in v3:
The first patch has an extra space in if statement, so fixed it in v2 but forgot add what changed from the previous version. In v3 added the complete change history.

  drivers/char/bsr.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/char/bsr.c +2 -1
index a6cef548e01e..70de334554a8 100644
@@ -322,7 +322,8 @@ static int __init bsr_init(void)
  		goto out_err_2;
  	}
 
-	if ((ret = bsr_create_devs(np)) < 0) {
+	ret = bsr_create_devs(np);
+	if (ret < 0) {
  		np = NULL;
  		goto out_err_3;
  	}