Skip to contentSkip to conversation

pinctrl: remove minor dead code

PATCH In review Michael Opdenacker 2 participants 2 messages Oct 29, 2013 – Nov 4, 2013 Pin control

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: remove minor dead code

This removes a test whether the 'desc' variable is NULL. This possibility has already been eliminated by the below test earlier in the loop:

                if (desc == NULL) {
                        dev_warn(pctldev->dev,
                                 "could not get pin desc for pin %d\n",
                                 pins[i]);
                        continue;
                }

Found with Coverity: CID #1090078

---
 drivers/pinctrl/pinmux.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pinctrl/pinmux.c +1 -3
index 9d144a2..9248ce4 100644
@@ -505,16 +505,14 @@ void pinmux_disable_setting(struct pinctrl_setting const *setting)
 			pin_free(pctldev, pins[i], NULL);
 		} else {
 			const char *gname;
-			const char *pname;
 
-			pname = desc ? desc->name : "non-existing";
 			gname = pctlops->get_group_name(pctldev,
 						setting->data.mux.group);
 			dev_warn(pctldev->dev,
 				 "not freeing pin %d (%s) as part of "
 				 "deactivating group %s - it is already "
 				 "used for some other setting",
-				 pins[i], pname, gname);
+				 pins[i], desc->name, gname);
 		}
 	}
 
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 11 lines · Michael Opdenacker

This removes a test whether the 'desc' variable is NULL. This possibility has already been eliminated by the below test earlier in the loop:

                if (desc == NULL) {
                        dev_warn(pctldev->dev,
                                 "could not get pin desc for pin %d\n",
                                 pins[i]);
                        continue;
                }
Quoted 3 lines

Found with Coverity: CID #1090078

Pretty cool find!

Patch applied.

Yours,
Linus Walleij