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: 537355 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 92FB3140D24 for ; Thu, 29 Oct 2015 01:31:19 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965912AbbJ1ObQ (ORCPT ); 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 Reviewed-by: Andy Shevchenko --- drivers/pinctrl/pinconf.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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; } }