From patchwork Fri Oct 30 14:15:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Meunier X-Patchwork-Id: 55837 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp1251876lbr; Fri, 30 Oct 2015 07:16:04 -0700 (PDT) X-Received: by 10.68.133.136 with SMTP id pc8mr7088502pbb.35.1446214564373; Fri, 30 Oct 2015 07:16:04 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tb2si11234435pac.105.2015.10.30.07.16.04; Fri, 30 Oct 2015 07:16:04 -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 S1757331AbbJ3OQD (ORCPT + 4 others); Fri, 30 Oct 2015 10:16:03 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:2232 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756769AbbJ3OQC (ORCPT ); Fri, 30 Oct 2015 10:16:02 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.14.5/8.14.5) with SMTP id t9UED4ai027991; Fri, 30 Oct 2015 15:15:56 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 1xttd43wvc-1 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 30 Oct 2015 15:15:56 +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 EC59B34; Fri, 30 Oct 2015 14:15:29 +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 0EA97B1F9; Fri, 30 Oct 2015 14:15:55 +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; Fri, 30 Oct 2015 15:15:54 +0100 From: Laurent Meunier To: CC: , , Laurent Meunier Subject: [PATCH V3] pinctrl: pinconf: remove needless loop Date: Fri, 30 Oct 2015 15:15:51 +0100 Message-ID: <1446214551-9523-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-30_10:2015-10-29, 2015-10-30, 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 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; } }