diff mbox

[V3] pinctrl: pinconf: remove needless loop

Message ID 1446214551-9523-1-git-send-email-laurent.meunier@st.com
State Accepted
Commit d99c8053fc2473115f506782822cb7c33c687513
Headers show

Commit Message

Laurent Meunier Oct. 30, 2015, 2:15 p.m. UTC
This removes a needless loop which was caught in pinconf.c.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Laurent Meunier <laurent.meunier@st.com>

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

---
 drivers/pinctrl/pinconf.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Linus Walleij Oct. 31, 2015, 9:07 p.m. UTC | #1
On Fri, Oct 30, 2015 at 3:15 PM, Laurent Meunier <laurent.meunier@st.com> wrote:

> This removes a needless loop which was caught in pinconf.c.

>

> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Laurent Meunier <laurent.meunier@st.com>

> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c
index 29a7bb1..4dd7722 100644
--- a/drivers/pinctrl/pinconf.c
+++ b/drivers/pinctrl/pinconf.c
@@ -411,7 +411,7 @@  static int pinconf_dbg_config_print(struct seq_file *s, void *d)
 	const struct pinctrl_map *found = NULL;
 	struct pinctrl_dev *pctldev;
 	struct dbg_cfg *dbg = &pinconf_dbg_conf;
-	int i, j;
+	int i;
 
 	mutex_lock(&pinctrl_maps_mutex);
 
@@ -424,13 +424,10 @@  static int pinconf_dbg_config_print(struct seq_file *s, void *d)
 		if (strcmp(map->name, dbg->state_name))
 			continue;
 
-		for (j = 0; j < map->data.configs.num_configs; j++) {
-			if (!strcmp(map->data.configs.group_or_pin,
-					dbg->pin_name)) {
-				/* We found the right pin / state */
-				found = map;
-				break;
-			}
+		if (!strcmp(map->data.configs.group_or_pin, dbg->pin_name)) {
+			/* We found the right pin */
+			found = map;
+			break;
 		}
 	}