linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: artpec6: fix __iomem on reg in set
@ 2019-12-18 10:16 Ben Dooks (Codethink)
  2019-12-18 16:26 ` Jesper Nilsson
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Dooks (Codethink) @ 2019-12-18 10:16 UTC (permalink / raw)
  To: ben.dooks
  Cc: Jesper Nilsson, Lars Persson, Linus Walleij, linux-arm-kernel,
	linux-gpio, linux-kernel

The artpec6_pconf_set should have marked reg as __iomem,
 which ends up making sparse complain about address
space conversions. Add the __iomem to silence the
following warnings:

drivers/pinctrl/pinctrl-artpec6.c:814:13: warning: incorrect type in assignment (different address spaces)
drivers/pinctrl/pinctrl-artpec6.c:814:13:    expected unsigned int *reg
drivers/pinctrl/pinctrl-artpec6.c:814:13:    got void [noderef] <asn:2> *
drivers/pinctrl/pinctrl-artpec6.c:825:34: warning: incorrect type in argument 1 (different address spaces)
drivers/pinctrl/pinctrl-artpec6.c:825:34:    expected void const volatile [noderef] <asn:2> *addr
drivers/pinctrl/pinctrl-artpec6.c:825:34:    got unsigned int *reg
drivers/pinctrl/pinctrl-artpec6.c:827:25: warning: incorrect type in argument 2 (different address spaces)
drivers/pinctrl/pinctrl-artpec6.c:827:25:    expected void volatile [noderef] <asn:2> *addr
drivers/pinctrl/pinctrl-artpec6.c:827:25:    got unsigned int *reg
drivers/pinctrl/pinctrl-artpec6.c:837:34: warning: incorrect type in argument 1 (different address spaces)
drivers/pinctrl/pinctrl-artpec6.c:837:34:    expected void const volatile [noderef] <asn:2> *addr
drivers/pinctrl/pinctrl-artpec6.c:837:34:    got unsigned int *reg
drivers/pinctrl/pinctrl-artpec6.c:840:25: warning: incorrect type in argument 2 (different address spaces)
drivers/pinctrl/pinctrl-artpec6.c:840:25:    expected void volatile [noderef] <asn:2> *addr
drivers/pinctrl/pinctrl-artpec6.c:840:25:    got unsigned int *reg
drivers/pinctrl/pinctrl-artpec6.c:850:34: warning: incorrect type in argument 1 (different address spaces)
drivers/pinctrl/pinctrl-artpec6.c:850:34:    expected void const volatile [noderef] <asn:2> *addr
drivers/pinctrl/pinctrl-artpec6.c:850:34:    got unsigned int *reg
drivers/pinctrl/pinctrl-artpec6.c:853:25: warning: incorrect type in argument 2 (different address spaces)
drivers/pinctrl/pinctrl-artpec6.c:853:25:    expected void volatile [noderef] <asn:2> *addr
drivers/pinctrl/pinctrl-artpec6.c:853:25:    got unsigned int *reg
drivers/pinctrl/pinctrl-artpec6.c:864:34: warning: incorrect type in argument 1 (different address spaces)
drivers/pinctrl/pinctrl-artpec6.c:864:34:    expected void const volatile [noderef] <asn:2> *addr
drivers/pinctrl/pinctrl-artpec6.c:864:34:    got unsigned int *reg
drivers/pinctrl/pinctrl-artpec6.c:867:25: warning: incorrect type in argument 2 (different address spaces)
drivers/pinctrl/pinctrl-artpec6.c:867:25:    expected void volatile [noderef] <asn:2> *addr
drivers/pinctrl/pinctrl-artpec6.c:867:25:    got unsigned int *reg

Signed-off-by: Ben Dooks (Codethink) <ben.dooks@codethink.co.uk>
---
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Lars Persson <lars.persson@axis.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel@axis.com
Cc: linux-gpio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/pinctrl/pinctrl-artpec6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
index 986e04ac6b5b..439a997b6bdb 100644
--- a/drivers/pinctrl/pinctrl-artpec6.c
+++ b/drivers/pinctrl/pinctrl-artpec6.c
@@ -798,7 +798,7 @@ static int artpec6_pconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
 	enum pin_config_param param;
 	unsigned int arg;
 	unsigned int regval;
-	unsigned int *reg;
+	unsigned int __iomem *reg;
 	int i;
 
 	/* Check for valid pin */
-- 
2.24.0


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

* Re: [PATCH] pinctrl: artpec6: fix __iomem on reg in set
  2019-12-18 10:16 [PATCH] pinctrl: artpec6: fix __iomem on reg in set Ben Dooks (Codethink)
@ 2019-12-18 16:26 ` Jesper Nilsson
  2019-12-18 17:32   ` Ben Dooks
  0 siblings, 1 reply; 6+ messages in thread
From: Jesper Nilsson @ 2019-12-18 16:26 UTC (permalink / raw)
  To: Ben Dooks (Codethink)
  Cc: Jesper Nilsson, Lars Persson, Linus Walleij, linux-arm-kernel,
	linux-gpio, linux-kernel

On Wed, Dec 18, 2019 at 11:16:02AM +0100, Ben Dooks (Codethink) wrote:
> The artpec6_pconf_set should have marked reg as __iomem,
>  which ends up making sparse complain about address
> space conversions. Add the __iomem to silence the
> following warnings:
> 
> drivers/pinctrl/pinctrl-artpec6.c:814:13: warning: incorrect type in assignment (different address spaces)
> drivers/pinctrl/pinctrl-artpec6.c:814:13:    expected unsigned int *reg
> drivers/pinctrl/pinctrl-artpec6.c:814:13:    got void [noderef] <asn:2> *
> drivers/pinctrl/pinctrl-artpec6.c:825:34: warning: incorrect type in argument 1 (different address spaces)
> drivers/pinctrl/pinctrl-artpec6.c:825:34:    expected void const volatile [noderef] <asn:2> *addr
> drivers/pinctrl/pinctrl-artpec6.c:825:34:    got unsigned int *reg
> drivers/pinctrl/pinctrl-artpec6.c:827:25: warning: incorrect type in argument 2 (different address spaces)
> drivers/pinctrl/pinctrl-artpec6.c:827:25:    expected void volatile [noderef] <asn:2> *addr
> drivers/pinctrl/pinctrl-artpec6.c:827:25:    got unsigned int *reg
> drivers/pinctrl/pinctrl-artpec6.c:837:34: warning: incorrect type in argument 1 (different address spaces)
> drivers/pinctrl/pinctrl-artpec6.c:837:34:    expected void const volatile [noderef] <asn:2> *addr
> drivers/pinctrl/pinctrl-artpec6.c:837:34:    got unsigned int *reg
> drivers/pinctrl/pinctrl-artpec6.c:840:25: warning: incorrect type in argument 2 (different address spaces)
> drivers/pinctrl/pinctrl-artpec6.c:840:25:    expected void volatile [noderef] <asn:2> *addr
> drivers/pinctrl/pinctrl-artpec6.c:840:25:    got unsigned int *reg
> drivers/pinctrl/pinctrl-artpec6.c:850:34: warning: incorrect type in argument 1 (different address spaces)
> drivers/pinctrl/pinctrl-artpec6.c:850:34:    expected void const volatile [noderef] <asn:2> *addr
> drivers/pinctrl/pinctrl-artpec6.c:850:34:    got unsigned int *reg
> drivers/pinctrl/pinctrl-artpec6.c:853:25: warning: incorrect type in argument 2 (different address spaces)
> drivers/pinctrl/pinctrl-artpec6.c:853:25:    expected void volatile [noderef] <asn:2> *addr
> drivers/pinctrl/pinctrl-artpec6.c:853:25:    got unsigned int *reg
> drivers/pinctrl/pinctrl-artpec6.c:864:34: warning: incorrect type in argument 1 (different address spaces)
> drivers/pinctrl/pinctrl-artpec6.c:864:34:    expected void const volatile [noderef] <asn:2> *addr
> drivers/pinctrl/pinctrl-artpec6.c:864:34:    got unsigned int *reg
> drivers/pinctrl/pinctrl-artpec6.c:867:25: warning: incorrect type in argument 2 (different address spaces)
> drivers/pinctrl/pinctrl-artpec6.c:867:25:    expected void volatile [noderef] <asn:2> *addr
> drivers/pinctrl/pinctrl-artpec6.c:867:25:    got unsigned int *reg
> 
> Signed-off-by: Ben Dooks (Codethink) <ben.dooks@codethink.co.uk>
> ---




> Cc: Lars Persson <lars.persson@axis.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-arm-kernel@axis.com
> Cc: linux-gpio@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  drivers/pinctrl/pinctrl-artpec6.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
> index 986e04ac6b5b..439a997b6bdb 100644
> --- a/drivers/pinctrl/pinctrl-artpec6.c
> +++ b/drivers/pinctrl/pinctrl-artpec6.c
> @@ -798,7 +798,7 @@ static int artpec6_pconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
>  	enum pin_config_param param;
>  	unsigned int arg;
>  	unsigned int regval;
> -	unsigned int *reg;
> +	unsigned int __iomem *reg;

	void __iomem *reg;

We're using as an argument to readl()?

>  	int i;
>  
>  	/* Check for valid pin */
> -- 
> 2.24.0
> 

/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@axis.com

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

* Re: [PATCH] pinctrl: artpec6: fix __iomem on reg in set
  2019-12-18 16:26 ` Jesper Nilsson
@ 2019-12-18 17:32   ` Ben Dooks
  2020-01-07  9:39     ` Linus Walleij
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Dooks @ 2019-12-18 17:32 UTC (permalink / raw)
  To: Jesper Nilsson
  Cc: Jesper Nilsson, Lars Persson, Linus Walleij, linux-arm-kernel,
	linux-gpio, linux-kernel

On 18/12/2019 16:26, Jesper Nilsson wrote:
> On Wed, Dec 18, 2019 at 11:16:02AM +0100, Ben Dooks (Codethink) wrote:
>> The artpec6_pconf_set should have marked reg as __iomem,
>>   which ends up making sparse complain about address
>> space conversions. Add the __iomem to silence the
>> following warnings:
>>
>> drivers/pinctrl/pinctrl-artpec6.c:814:13: warning: incorrect type in assignment (different address spaces)
>> drivers/pinctrl/pinctrl-artpec6.c:814:13:    expected unsigned int *reg
>> drivers/pinctrl/pinctrl-artpec6.c:814:13:    got void [noderef] <asn:2> *
>> drivers/pinctrl/pinctrl-artpec6.c:825:34: warning: incorrect type in argument 1 (different address spaces)
>> drivers/pinctrl/pinctrl-artpec6.c:825:34:    expected void const volatile [noderef] <asn:2> *addr
>> drivers/pinctrl/pinctrl-artpec6.c:825:34:    got unsigned int *reg
>> drivers/pinctrl/pinctrl-artpec6.c:827:25: warning: incorrect type in argument 2 (different address spaces)
>> drivers/pinctrl/pinctrl-artpec6.c:827:25:    expected void volatile [noderef] <asn:2> *addr
>> drivers/pinctrl/pinctrl-artpec6.c:827:25:    got unsigned int *reg
>> drivers/pinctrl/pinctrl-artpec6.c:837:34: warning: incorrect type in argument 1 (different address spaces)
>> drivers/pinctrl/pinctrl-artpec6.c:837:34:    expected void const volatile [noderef] <asn:2> *addr
>> drivers/pinctrl/pinctrl-artpec6.c:837:34:    got unsigned int *reg
>> drivers/pinctrl/pinctrl-artpec6.c:840:25: warning: incorrect type in argument 2 (different address spaces)
>> drivers/pinctrl/pinctrl-artpec6.c:840:25:    expected void volatile [noderef] <asn:2> *addr
>> drivers/pinctrl/pinctrl-artpec6.c:840:25:    got unsigned int *reg
>> drivers/pinctrl/pinctrl-artpec6.c:850:34: warning: incorrect type in argument 1 (different address spaces)
>> drivers/pinctrl/pinctrl-artpec6.c:850:34:    expected void const volatile [noderef] <asn:2> *addr
>> drivers/pinctrl/pinctrl-artpec6.c:850:34:    got unsigned int *reg
>> drivers/pinctrl/pinctrl-artpec6.c:853:25: warning: incorrect type in argument 2 (different address spaces)
>> drivers/pinctrl/pinctrl-artpec6.c:853:25:    expected void volatile [noderef] <asn:2> *addr
>> drivers/pinctrl/pinctrl-artpec6.c:853:25:    got unsigned int *reg
>> drivers/pinctrl/pinctrl-artpec6.c:864:34: warning: incorrect type in argument 1 (different address spaces)
>> drivers/pinctrl/pinctrl-artpec6.c:864:34:    expected void const volatile [noderef] <asn:2> *addr
>> drivers/pinctrl/pinctrl-artpec6.c:864:34:    got unsigned int *reg
>> drivers/pinctrl/pinctrl-artpec6.c:867:25: warning: incorrect type in argument 2 (different address spaces)
>> drivers/pinctrl/pinctrl-artpec6.c:867:25:    expected void volatile [noderef] <asn:2> *addr
>> drivers/pinctrl/pinctrl-artpec6.c:867:25:    got unsigned int *reg
>>
>> Signed-off-by: Ben Dooks (Codethink) <ben.dooks@codethink.co.uk>
>> ---
> 
> 
> 
> 
>> Cc: Lars Persson <lars.persson@axis.com>
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Cc: linux-arm-kernel@axis.com
>> Cc: linux-gpio@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
>> ---
>>   drivers/pinctrl/pinctrl-artpec6.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
>> index 986e04ac6b5b..439a997b6bdb 100644
>> --- a/drivers/pinctrl/pinctrl-artpec6.c
>> +++ b/drivers/pinctrl/pinctrl-artpec6.c
>> @@ -798,7 +798,7 @@ static int artpec6_pconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
>>   	enum pin_config_param param;
>>   	unsigned int arg;
>>   	unsigned int regval;
>> -	unsigned int *reg;
>> +	unsigned int __iomem *reg;
> 
> 	void __iomem *reg;
> 
> We're using as an argument to readl()?

yes, readl() shoud take an __iomem attributed pointer.

>>   	int i;
>>   
>>   	/* Check for valid pin */
>> -- 
>> 2.24.0
>>
> 
> /^JN - Jesper Nilsson
> 


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html

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

* Re: [PATCH] pinctrl: artpec6: fix __iomem on reg in set
  2019-12-18 17:32   ` Ben Dooks
@ 2020-01-07  9:39     ` Linus Walleij
  2020-01-07 11:18       ` Jesper Nilsson
  0 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2020-01-07  9:39 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Jesper Nilsson, Jesper Nilsson, Lars Persson, linux-arm-kernel,
	linux-gpio, linux-kernel

On Wed, Dec 18, 2019 at 6:32 PM Ben Dooks <ben.dooks@codethink.co.uk> wrote:
> On 18/12/2019 16:26, Jesper Nilsson wrote:
> > On Wed, Dec 18, 2019 at 11:16:02AM +0100, Ben Dooks (Codethink) wrote:

> >> -    unsigned int *reg;
> >> +    unsigned int __iomem *reg;
> >
> >       void __iomem *reg;
> >
> > We're using as an argument to readl()?
>
> yes, readl() shoud take an __iomem attributed pointer.

Shall I change it to void as well when applying?

Yours,
Linus Walleij

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

* Re: [PATCH] pinctrl: artpec6: fix __iomem on reg in set
  2020-01-07  9:39     ` Linus Walleij
@ 2020-01-07 11:18       ` Jesper Nilsson
  2020-01-07 12:52         ` Linus Walleij
  0 siblings, 1 reply; 6+ messages in thread
From: Jesper Nilsson @ 2020-01-07 11:18 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Ben Dooks, Jesper Nilsson, Lars Persson, linux-arm-kernel,
	linux-gpio, linux-kernel

On Tue, Jan 07, 2020 at 10:39:34AM +0100, Linus Walleij wrote:
> On Wed, Dec 18, 2019 at 6:32 PM Ben Dooks <ben.dooks@codethink.co.uk> wrote:
> > On 18/12/2019 16:26, Jesper Nilsson wrote:
> > > On Wed, Dec 18, 2019 at 11:16:02AM +0100, Ben Dooks (Codethink) wrote:
> 
> > >> -    unsigned int *reg;
> > >> +    unsigned int __iomem *reg;
> > >
> > >       void __iomem *reg;
> > >
> > > We're using as an argument to readl()?
> >
> > yes, readl() shoud take an __iomem attributed pointer.
> 
> Shall I change it to void as well when applying?

Please do, sorry that my comment wasn't clear above.

> Yours,
> Linus Walleij

/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@axis.com

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

* Re: [PATCH] pinctrl: artpec6: fix __iomem on reg in set
  2020-01-07 11:18       ` Jesper Nilsson
@ 2020-01-07 12:52         ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2020-01-07 12:52 UTC (permalink / raw)
  To: Jesper Nilsson
  Cc: Ben Dooks, Jesper Nilsson, Lars Persson, linux-arm-kernel,
	linux-gpio, linux-kernel

On Tue, Jan 7, 2020 at 12:18 PM Jesper Nilsson <jesper.nilsson@axis.com> wrote:
> On Tue, Jan 07, 2020 at 10:39:34AM +0100, Linus Walleij wrote:
> > On Wed, Dec 18, 2019 at 6:32 PM Ben Dooks <ben.dooks@codethink.co.uk> wrote:
> > > On 18/12/2019 16:26, Jesper Nilsson wrote:
> > > > On Wed, Dec 18, 2019 at 11:16:02AM +0100, Ben Dooks (Codethink) wrote:
> >
> > > >> -    unsigned int *reg;
> > > >> +    unsigned int __iomem *reg;
> > > >
> > > >       void __iomem *reg;
> > > >
> > > > We're using as an argument to readl()?
> > >
> > > yes, readl() shoud take an __iomem attributed pointer.
> >
> > Shall I change it to void as well when applying?
>
> Please do, sorry that my comment wasn't clear above.

OK I did that and applied, let's see if it works :)

Yours,
Linus Walleij

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

end of thread, other threads:[~2020-01-07 12:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 10:16 [PATCH] pinctrl: artpec6: fix __iomem on reg in set Ben Dooks (Codethink)
2019-12-18 16:26 ` Jesper Nilsson
2019-12-18 17:32   ` Ben Dooks
2020-01-07  9:39     ` Linus Walleij
2020-01-07 11:18       ` Jesper Nilsson
2020-01-07 12:52         ` Linus Walleij

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