linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: pinconf: remove needless loop
@ 2015-10-28 14:29 Laurent Meunier
  2015-10-28 17:00 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Meunier @ 2015-10-28 14:29 UTC (permalink / raw)
  To: linux-gpio; +Cc: linus.walleij, andriy.shevchenko, Laurent Meunier

This removes a needless loop which was catched in pinconf.c.

Suggested-by: Andriy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Laurent Meunier <laurent.meunier@st.com>
---
 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;
 		}
 	}
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: pinconf: remove needless loop
  2015-10-28 14:29 [PATCH] pinctrl: pinconf: remove needless loop Laurent Meunier
@ 2015-10-28 17:00 ` Andy Shevchenko
  2015-10-29 13:25   ` Laurent MEUNIER
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2015-10-28 17:00 UTC (permalink / raw)
  To: Laurent Meunier, linux-gpio; +Cc: linus.walleij

On Wed, 2015-10-28 at 15:29 +0100, Laurent Meunier wrote:
> This removes a needless loop which was catched in pinconf.c.

I'm not a fan of irregular verbs, but here we are: catched -> caught.

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

Sometimes the broken Evolution uses wrong address. Please add "linux."
part after "@". Also, I prefer to use Andy since it's how I'm known
here.

Otherwise:

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

> Signed-off-by: Laurent Meunier <laurent.meunier@st.com>
> ---
>  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;
>  		}
>  	}
>  

-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy

--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] pinctrl: pinconf: remove needless loop
  2015-10-28 17:00 ` Andy Shevchenko
@ 2015-10-29 13:25   ` Laurent MEUNIER
  0 siblings, 0 replies; 3+ messages in thread
From: Laurent MEUNIER @ 2015-10-29 13:25 UTC (permalink / raw)
  To: Andy Shevchenko, linux-gpio@vger.kernel.org; +Cc: linus.walleij@linaro.org

> 
> On Wed, 2015-10-28 at 15:29 +0100, Laurent Meunier wrote:
> > This removes a needless loop which was catched in pinconf.c.
> 
> I'm not a fan of irregular verbs, but here we are: catched -> caught.

Looks like my lack of skills in English grammar got caught  ... 
 
> >
> > Suggested-by: Andriy Shevchenko <andriy.shevchenko@intel.com>
> 
> Sometimes the broken Evolution uses wrong address. Please add "linux."
> part after "@". Also, I prefer to use Andy since it's how I'm known here.
> 
> Otherwise:
> 
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Ok sure - I will add it in the V2 and will also update the previous one
Thanks 

> > Signed-off-by: Laurent Meunier <laurent.meunier@st.com>
> > ---
> >  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;
> >  		}
> >  	}
> >
> 
> --
> Andy Shevchenko <andriy.shevchenko@intel.com> Intel Finland Oy


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-29 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-28 14:29 [PATCH] pinctrl: pinconf: remove needless loop Laurent Meunier
2015-10-28 17:00 ` Andy Shevchenko
2015-10-29 13:25   ` Laurent MEUNIER

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).