Skip to contentSkip to conversation

staging: wilc1000: Remove unnecessary braces {} around single statement block

PATCH Superseded Eyal Ilsar 2 participants 4 messages Apr 10, 2018 – Apr 12, 2018 Staging

lore
Share & tools
lore

Eyal Ilsar

author
#0 lore raw

PATCH 1/1 staging: wilc1000: Remove unnecessary braces {} around single statement block

Remove unnecessary braces {} around an 'if' statement block with a single statement. Issue found by checkpatch.

---
This is part of my take on the Eudyptula challenge

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -2
index 205304c..325afe1 100644
@@ -284,9 +284,8 @@ static void remove_network_from_shadow(struct timer_list *unused)
 		}
 	}
 
-	if (last_scanned_cnt != 0) {
+	if (last_scanned_cnt != 0)
 		mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME));
-	}
 }
 
 static void clear_duringIP(struct timer_list *unused)
Signature · 6 lines
2.7.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#1 lore raw
Quoted 2 lines · Eyal Ilsar

Remove unnecessary braces {} around an 'if' statement block with a single statement. Issue found by checkpatch.

You should add an empty line before "Signed-off" line as stated in [1]. I would also add a space b/w your name and your email in Signed-off line as is exemplified in [2].

[1]
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#the-canonical-patch-format
[2] https://www.kernel.org/doc/html/latest/process/sub
mitting-patches.html#developer-s-certificate-of-origin-1-1

Quoted 13 lines

---
This is part of my take on the Eudyptula challenge

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +0 -0
index 205304c..325afe1 100644

drivers/staging/wilc1000/wilc_wfi_cfgoperations.c static void remove_network_from_shadow(struct timer_list *unused) · line 291

Quoted 10 lines
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -2
@@ -284,9 +284,8 @@ static void remove_network_from_shadow(struct timer_list *unused)
 		}
 	}
 
-	if (last_scanned_cnt != 0) {
+	if (last_scanned_cnt != 0)
 		mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME));
-	}
 }
 
 static void clear_duringIP(struct timer_list *unused)

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

author
#2 lore raw

PATCH v2 1/1 staging: wilc1000: Remove unnecessary braces {} around single statement block

In reply to Eyal Ilsar

Remove unnecessary braces {} around an 'if' statement block with a single statement. Issue found by checkpatch.

---
Added an empty line before the 'Signed-off-by' line and a space between the name and e-mail address within that line.

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -2
index 205304c..325afe1 100644
@@ -284,9 +284,8 @@ static void remove_network_from_shadow(struct timer_list *unused)
 		}
 	}
 
-	if (last_scanned_cnt != 0) {
+	if (last_scanned_cnt != 0)
 		mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME));
-	}
 }
 
 static void clear_duringIP(struct timer_list *unused)
Signature · 6 lines
2.7.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Reviewed-by on v2 1/1
#3 lore raw
Quoted 4 lines · Eyal Ilsar

Remove unnecessary braces {} around an 'if' statement block with a single statement. Issue found by checkpatch.

Quoted 23 lines

---
Added an empty line before the 'Signed-off-by' line and a space between the name and e-mail address within that line.

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -2
index 205304c..325afe1 100644
@@ -284,9 +284,8 @@ static void remove_network_from_shadow(struct timer_list *unused)
 		}
 	}
 
-	if (last_scanned_cnt != 0) {
+	if (last_scanned_cnt != 0)
 		mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME));
-	}
 }
 
 static void clear_duringIP(struct timer_list *unused)