Skip to contentSkip to conversation

staging: silicom: Remove unused pointer in bypass_init_module()

PATCH Superseded Christian Engelmayer 2 participants 2 messages Apr 28, 2014 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: silicom: Remove unused pointer in bypass_init_module()

Pointer 'pbpctl_dev_c' in function bypass_init_module() is unused. Thus remove it. With the last variable declaration gone, there is no more need for an own block. Remove it and adapt the indenting accordingly.

---
v2: Added changes requested by Dan Carpenter:

Dan pointed out that with the declaration gone, the indent block shall be removed. This was intentionally left out in v1 in order to keep the changeset more readable. However, according to the input, also with the additional indenting change this still qualifies for one logical change.

Compile tested and applies against v3.15-rc2 as well as branch staging-next of tree git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git

---
 drivers/staging/silicom/bpctl_mod.c | 41 +++++++++++++++----------------------
 1 file changed, 17 insertions(+), 24 deletions(-)
drivers/staging/silicom/bpctl_mod.c +17 -24
index 7f3d884..2fb9a6f 100644
@@ -6371,33 +6371,26 @@ static int __init bypass_init_module(void)
 
 	sema_init(&bpctl_sema, 1);
 	spin_lock_init(&bpvm_lock);
-	{
-
-		struct bpctl_dev *pbpctl_dev_c = NULL;
-		for (idx_dev = 0, dev = bpctl_dev_arr;
-		     idx_dev < device_num && dev->pdev;
-		     idx_dev++, dev++) {
-			if (dev->bp_10g9) {
-				pbpctl_dev_c = get_status_port_fn(dev);
-				if (is_bypass_fn(dev)) {
-					printk(KERN_INFO "%s found, ",
-					       dev->name);
-					dev->bp_fw_ver = bypass_fw_ver(dev);
-					printk("firmware version: 0x%x\n",
-					       dev->bp_fw_ver);
-				}
-				dev->wdt_status = WDT_STATUS_UNKNOWN;
-				dev->reset_time = 0;
-				atomic_set(&dev->wdt_busy, 0);
-				dev->bp_status_un = 1;
-
-				bypass_caps_init(dev);
-
-				init_bypass_wd_auto(dev);
-				init_bypass_tpl_auto(dev);
 
+	for (idx_dev = 0, dev = bpctl_dev_arr;
+	     idx_dev < device_num && dev->pdev;
+	     idx_dev++, dev++) {
+		if (dev->bp_10g9) {
+			if (is_bypass_fn(dev)) {
+				printk(KERN_INFO "%s found, ", dev->name);
+				dev->bp_fw_ver = bypass_fw_ver(dev);
+				printk("firmware version: 0x%x\n",
+				       dev->bp_fw_ver);
 			}
+			dev->wdt_status = WDT_STATUS_UNKNOWN;
+			dev->reset_time = 0;
+			atomic_set(&dev->wdt_busy, 0);
+			dev->bp_status_un = 1;
+
+			bypass_caps_init(dev);
 
+			init_bypass_wd_auto(dev);
+			init_bypass_tpl_auto(dev);
 		}
 	}
 
Signature · 1 line
1.9.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 8 lines · Christian Engelmayer

Pointer 'pbpctl_dev_c' in function bypass_init_module() is unused. Thus remove it. With the last variable declaration gone, there is no more need for an own block. Remove it and adapt the indenting accordingly.

---
v2: Added changes requested by Dan Carpenter:

Quoted 7 lines

Dan pointed out that with the declaration gone, the indent block shall be removed. This was intentionally left out in v1 in order to keep the changeset more readable. However, according to the input, also with the additional indenting change this still qualifies for one logical change.

Compile tested and applies against v3.15-rc2 as well as branch staging-next of tree git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git

Great thanks. :) You only need to work against staging next and not v3.15-rc2 because this will go into v3.16.

regards,
dan carpenter