From patchwork Wed Oct 28 14:29:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Meunier X-Patchwork-Id: 55698 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp154284lbr; Wed, 28 Oct 2015 07:31:19 -0700 (PDT) X-Received: by 10.68.226.161 with SMTP id rt1mr34970513pbc.98.1446042679393; Wed, 28 Oct 2015 07:31:19 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bk2si70789919pbc.78.2015.10.28.07.31.19; Wed, 28 Oct 2015 07:31:19 -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 S965912AbbJ1ObQ (ORCPT + 4 others); Wed, 28 Oct 2015 10:31:16 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:58302 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965482AbbJ1Oaz (ORCPT ); Wed, 28 Oct 2015 10:30:55 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by m0046037.ppops.net (8.14.5/8.14.5) with SMTP id t9SER88k006042; Wed, 28 Oct 2015 15:30:51 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by m0046037.ppops.net with ESMTP id 1xtxqj8e2t-1 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 28 Oct 2015 15:30:51 +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 06D2338; Wed, 28 Oct 2015 14:30:24 +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 3774F52A0; Wed, 28 Oct 2015 14:30:50 +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; Wed, 28 Oct 2015 15:30:50 +0100 From: Laurent Meunier To: CC: , , Laurent Meunier Subject: [PATCH] pinctrl: pinconf: remove needless loop Date: Wed, 28 Oct 2015 15:29:59 +0100 Message-ID: <1446042599-15093-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.14.151, 1.0.33, 0.0.0000 definitions=2015-10-28_10:2015-10-26, 2015-10-28, 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 catched in pinconf.c. Suggested-by: Andriy Shevchenko Signed-off-by: Laurent Meunier --- 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; } }