linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Reid <preid@electromag.com.au>
To: Hennie Muller <hm@bitlabs.co.za>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] [PATCH] gpio: Replace usage of bare 'unsigned' with 'unsigned int'
Date: Mon, 22 Jul 2019 10:05:00 +0800	[thread overview]
Message-ID: <61045f29-73ca-cb62-ba6f-5b12970735a9@electromag.com.au> (raw)
In-Reply-To: <20190721125259.13990-1-hm@bitlabs.co.za>

G'day Hennie,

patch title should be:
gpio: viperboard: Replace usage of bare 'unsigned' with 'unsigned int'

On 21/07/2019 20:52, Hennie Muller wrote:
> Fixes a couple of warnings by checkpatch and sparse.
> 
> Signed-off-by: Hennie Muller <hm@bitlabs.co.za>
> ---
>   drivers/gpio/gpio-viperboard.c | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-viperboard.c b/drivers/gpio/gpio-viperboard.c
> index 9b604f13e302..c301c1d56dd2 100644
> --- a/drivers/gpio/gpio-viperboard.c
> +++ b/drivers/gpio/gpio-viperboard.c
> @@ -79,7 +79,7 @@ MODULE_PARM_DESC(gpioa_freq,
>   /* ----- begin of gipo a chip -------------------------------------------- */
>   
>   static int vprbrd_gpioa_get(struct gpio_chip *chip,
> -		unsigned offset)
> +		unsigned int offset)

I've encountered these checkpatch warnings as well.

However 'struct gpio_chip' callbacks define the function signatures
as 'unsigned', not 'unsigned int'. So I've also left them as is, to explicitly
match the struct definition.

Be interested to know what the official take on this is.


>   {
>   	int ret, answer, error = 0;
>   	struct vprbrd_gpio *gpio = gpiochip_get_data(chip);
> @@ -129,7 +129,7 @@ static int vprbrd_gpioa_get(struct gpio_chip *chip,
>   }
>   
>   static void vprbrd_gpioa_set(struct gpio_chip *chip,
> -		unsigned offset, int value)
> +		unsigned int offset, int value)
>   {
>   	int ret;
>   	struct vprbrd_gpio *gpio = gpiochip_get_data(chip);
> @@ -170,7 +170,7 @@ static void vprbrd_gpioa_set(struct gpio_chip *chip,
>   }
>   
>   static int vprbrd_gpioa_direction_input(struct gpio_chip *chip,
> -			unsigned offset)
> +			unsigned int offset)
>   {
>   	int ret;
>   	struct vprbrd_gpio *gpio = gpiochip_get_data(chip);
> @@ -207,7 +207,7 @@ static int vprbrd_gpioa_direction_input(struct gpio_chip *chip,
>   }
>   
>   static int vprbrd_gpioa_direction_output(struct gpio_chip *chip,
> -			unsigned offset, int value)
> +			unsigned int offset, int value)
>   {
>   	int ret;
>   	struct vprbrd_gpio *gpio = gpiochip_get_data(chip);
> @@ -251,8 +251,8 @@ static int vprbrd_gpioa_direction_output(struct gpio_chip *chip,
>   
>   /* ----- begin of gipo b chip -------------------------------------------- */
>   
> -static int vprbrd_gpiob_setdir(struct vprbrd *vb, unsigned offset,
> -	unsigned dir)
> +static int vprbrd_gpiob_setdir(struct vprbrd *vb, unsigned int offset,
> +	unsigned int dir)
>   {
>   	struct vprbrd_gpiob_msg *gbmsg = (struct vprbrd_gpiob_msg *)vb->buf;
>   	int ret;
> @@ -273,7 +273,7 @@ static int vprbrd_gpiob_setdir(struct vprbrd *vb, unsigned offset,
>   }
>   
>   static int vprbrd_gpiob_get(struct gpio_chip *chip,
> -		unsigned offset)
> +		unsigned int offset)
>   {
>   	int ret;
>   	u16 val;
> @@ -305,7 +305,7 @@ static int vprbrd_gpiob_get(struct gpio_chip *chip,
>   }
>   
>   static void vprbrd_gpiob_set(struct gpio_chip *chip,
> -		unsigned offset, int value)
> +		unsigned int offset, int value)
>   {
>   	int ret;
>   	struct vprbrd_gpio *gpio = gpiochip_get_data(chip);
> @@ -338,7 +338,7 @@ static void vprbrd_gpiob_set(struct gpio_chip *chip,
>   }
>   
>   static int vprbrd_gpiob_direction_input(struct gpio_chip *chip,
> -			unsigned offset)
> +			unsigned int offset)
>   {
>   	int ret;
>   	struct vprbrd_gpio *gpio = gpiochip_get_data(chip);
> @@ -359,7 +359,7 @@ static int vprbrd_gpiob_direction_input(struct gpio_chip *chip,
>   }
>   
>   static int vprbrd_gpiob_direction_output(struct gpio_chip *chip,
> -			unsigned offset, int value)
> +			unsigned int offset, int value)
>   {
>   	int ret;
>   	struct vprbrd_gpio *gpio = gpiochip_get_data(chip);
> 


-- 
Regards
Phil Reid

  parent reply	other threads:[~2019-07-22  2:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-21 12:52 [PATCH 1/2] [PATCH] gpio: Replace usage of bare 'unsigned' with 'unsigned int' Hennie Muller
2019-07-21 12:52 ` [PATCH 2/2] [PATCH] gpio: Explicitly cast from __be16 to unsigned short Hennie Muller
2019-08-05  9:10   ` Linus Walleij
2019-08-05 11:52     ` Arnd Bergmann
2019-07-22  2:05 ` Phil Reid [this message]
2019-07-22  4:51   ` [PATCH 1/2] [PATCH] gpio: Replace usage of bare 'unsigned' with 'unsigned int' Hennie Muller
2019-08-05  9:26     ` Linus Walleij
2019-08-05  9:27 ` Linus Walleij

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=61045f29-73ca-cb62-ba6f-5b12970735a9@electromag.com.au \
    --to=preid@electromag.com.au \
    --cc=bgolaszewski@baylibre.com \
    --cc=hm@bitlabs.co.za \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@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 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).