All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH v2 2/4] pinctrl: sh-pfc: Use unsigned int for register/field widths and offsets
Date: Thu, 12 Mar 2015 03:00:01 +0200	[thread overview]
Message-ID: <1705055.eTGDDjPxdV@avalon> (raw)
In-Reply-To: <1425985583-26279-3-git-send-email-geert+renesas@glider.be>

Hi Geert,

Thank you for the patch.

On Tuesday 10 March 2015 12:06:21 Geert Uytterhoeven wrote:
> As register and field widths and offsets are in the range 1..32, use
> unsigned int (mostly replacing unsigned long) to store them in local
> variables and for passing them around.
> 
> Move to one variable per line and move variables to the beginning of
> the block where they are used while we are at it.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v2:
>   - Move to one variable per line and move variables to the beginning of
>     the block where they are used for the code that is touched.
> ---
>  drivers/pinctrl/sh-pfc/core.c | 59 +++++++++++++++++++--------------------
>  drivers/pinctrl/sh-pfc/core.h |  4 +--
>  drivers/pinctrl/sh-pfc/gpio.c |  4 +--
>  3 files changed, 33 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c
> index 5591baf9738b5de9..aaf9c7fa742cc9c1 100644
> --- a/drivers/pinctrl/sh-pfc/core.c
> +++ b/drivers/pinctrl/sh-pfc/core.c

[snip]

> @@ -322,13 +319,15 @@ int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned
> mark, int pinmux_type) return -EINVAL;
>  	}
> 
> -	pos = 0;
> -	enum_id = 0;
> -	field = 0;
> -	value = 0;
> -
>  	/* Iterate over all the configuration fields we need to update. */
>  	while (1) {
> +		const struct pinmux_cfg_reg *cr = NULL;
> +		unsigned int field = 0;
> +		u16 enum_id = 0;
> +		u32 value = 0;

There's no need to initialize field, enum_id and value to 0 here.

With that fixed,

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +		int in_range;
> +		int ret;
> +
>  		pos = sh_pfc_mark_to_enum(pfc, mark, pos, &enum_id);
>  		if (pos < 0)
>  			return pos;

-- 
Regards,

Laurent Pinchart


WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH v2 2/4] pinctrl: sh-pfc: Use unsigned int for register/field widths and offsets
Date: Thu, 12 Mar 2015 01:00:01 +0000	[thread overview]
Message-ID: <1705055.eTGDDjPxdV@avalon> (raw)
In-Reply-To: <1425985583-26279-3-git-send-email-geert+renesas@glider.be>

Hi Geert,

Thank you for the patch.

On Tuesday 10 March 2015 12:06:21 Geert Uytterhoeven wrote:
> As register and field widths and offsets are in the range 1..32, use
> unsigned int (mostly replacing unsigned long) to store them in local
> variables and for passing them around.
> 
> Move to one variable per line and move variables to the beginning of
> the block where they are used while we are at it.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v2:
>   - Move to one variable per line and move variables to the beginning of
>     the block where they are used for the code that is touched.
> ---
>  drivers/pinctrl/sh-pfc/core.c | 59 +++++++++++++++++++--------------------
>  drivers/pinctrl/sh-pfc/core.h |  4 +--
>  drivers/pinctrl/sh-pfc/gpio.c |  4 +--
>  3 files changed, 33 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c
> index 5591baf9738b5de9..aaf9c7fa742cc9c1 100644
> --- a/drivers/pinctrl/sh-pfc/core.c
> +++ b/drivers/pinctrl/sh-pfc/core.c

[snip]

> @@ -322,13 +319,15 @@ int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned
> mark, int pinmux_type) return -EINVAL;
>  	}
> 
> -	pos = 0;
> -	enum_id = 0;
> -	field = 0;
> -	value = 0;
> -
>  	/* Iterate over all the configuration fields we need to update. */
>  	while (1) {
> +		const struct pinmux_cfg_reg *cr = NULL;
> +		unsigned int field = 0;
> +		u16 enum_id = 0;
> +		u32 value = 0;

There's no need to initialize field, enum_id and value to 0 here.

With that fixed,

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +		int in_range;
> +		int ret;
> +
>  		pos = sh_pfc_mark_to_enum(pfc, mark, pos, &enum_id);
>  		if (pos < 0)
>  			return pos;

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2015-03-12  1:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 11:06 [PATCH v2 0/4] pinctrl: sh-pfc: cleanups Geert Uytterhoeven
2015-03-10 11:06 ` Geert Uytterhoeven
2015-03-10 11:06 ` [PATCH v2 1/4] pinctrl: sh-pfc: Store register/field widths in u8 instead of unsigned long Geert Uytterhoeven
2015-03-10 11:06   ` Geert Uytterhoeven
2015-03-18  1:10   ` Linus Walleij
2015-03-18  1:10     ` Linus Walleij
2015-03-18  1:11     ` Linus Walleij
2015-03-18  1:11       ` Linus Walleij
2015-03-10 11:06 ` [PATCH v2 2/4] pinctrl: sh-pfc: Use unsigned int for register/field widths and offsets Geert Uytterhoeven
2015-03-10 11:06   ` Geert Uytterhoeven
2015-03-12  1:00   ` Laurent Pinchart [this message]
2015-03-12  1:00     ` Laurent Pinchart
2015-03-12  7:49     ` Geert Uytterhoeven
2015-03-12  7:49       ` Geert Uytterhoeven
2015-03-10 11:06 ` [PATCH v2 3/4] pinctrl: sh-pfc: Use reg_width instead of reg as sentinel Geert Uytterhoeven
2015-03-10 11:06   ` Geert Uytterhoeven
2015-03-12  1:19   ` Laurent Pinchart
2015-03-12  1:19     ` Laurent Pinchart
2015-03-10 11:06 ` [PATCH v2 4/4] pinctrl: sh-pfc: Use u32 to store register addresses Geert Uytterhoeven
2015-03-10 11:06   ` Geert Uytterhoeven
2015-03-12  1:02   ` Laurent Pinchart
2015-03-12  1:02     ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1705055.eTGDDjPxdV@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=geert+renesas@glider.be \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.