From patchwork Thu Oct 29 13:25:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Meunier X-Patchwork-Id: 55769 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp563860lbr; Thu, 29 Oct 2015 06:26:08 -0700 (PDT) X-Received: by 10.107.35.16 with SMTP id j16mr3509786ioj.120.1446125168281; Thu, 29 Oct 2015 06:26:08 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si26358144igl.33.2015.10.29.06.26.06; Thu, 29 Oct 2015 06:26:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932574AbbJ2N0G (ORCPT + 4 others); Thu, 29 Oct 2015 09:26:06 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:24711 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932088AbbJ2N0F (ORCPT ); Thu, 29 Oct 2015 09:26:05 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.14.5/8.14.5) with SMTP id t9TDPnOw029119; Thu, 29 Oct 2015 14:25:59 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 1xugm193tg-1 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 29 Oct 2015 14:25:59 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1773E3F; Thu, 29 Oct 2015 13:25:32 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 36B195520; Thu, 29 Oct 2015 13:25:58 +0000 (GMT) Received: from localhost (10.201.23.96) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.235.1; Thu, 29 Oct 2015 14:25:57 +0100 From: Laurent Meunier To: CC: , , Laurent Meunier Subject: [PATCH V2] pinctrl: pinconf: remove needless loop Date: Thu, 29 Oct 2015 14:25:47 +0100 Message-ID: <1446125147-10670-1-git-send-email-laurent.meunier@st.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.201.23.96] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.15.21, 1.0.33, 0.0.0000 definitions=2015-10-29_09:2015-10-28, 2015-10-29, 1970-01-01 signatures=0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This removes a needless loop which was caught in pinconf.c. Suggested-by: Andy Shevchenko Signed-off-by: Laurent Meunier Reviewed-by: Andy Shevchenko --- 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 diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c index 1fc09dc..19af718 100644 --- a/drivers/pinctrl/pinconf.c +++ b/drivers/pinctrl/pinconf.c @@ -414,7 +414,7 @@ static int pinconf_dbg_config_print(struct seq_file *s, void *d) struct pinctrl_dev *pctldev; const struct pinconf_ops *confops = NULL; struct dbg_cfg *dbg = &pinconf_dbg_conf; - int i, j; + int i; unsigned long config; mutex_lock(&pinctrl_maps_mutex); @@ -428,13 +428,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; } }