linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] staging: slicoss: fix different address space warnings
@ 2016-11-18 17:57 Sergio Paracuellos
  2016-11-18 17:57 ` Sergio Paracuellos
  0 siblings, 1 reply; 6+ messages in thread
From: Sergio Paracuellos @ 2016-11-18 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, liodot, charrer

This patchset fix the following sparse warning:
warning: incorrect type in assignment (different address spaces)

Changes in v2:
* Remove IOMEM_GET_FIELDADDR macro
* Add ioread64 and iowrite64 defines

Changes in v3:
* Remove ioread64 and iowrite64 defines
* Split into two patches: one for 32 bits stuff and the other for 64 bits.

Changes in v4:
* Undo all of previous changes and just remove __iomem annotation from 
field of struct because it is incorrect.

Sergio Paracuellos (1):
  staging: slicoss: fix different address space warnings

 drivers/staging/slicoss/slic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
1.9.1

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

* [PATCH v4] staging: slicoss: fix different address space warnings
  2016-11-18 17:57 [PATCH v4] staging: slicoss: fix different address space warnings Sergio Paracuellos
@ 2016-11-18 17:57 ` Sergio Paracuellos
  2016-11-19 13:20   ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Sergio Paracuellos @ 2016-11-18 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, liodot, charrer

Remove incorrect __iomem annotation.

This patch fix the following sparse warnings in slicoss driver:
warning: incorrect type in assignment (different address spaces)

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/slicoss/slic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 420546d..14d7555 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -380,7 +380,7 @@ struct slic_shmemory {
 	dma_addr_t isr_phaddr;
 	dma_addr_t lnkstatus_phaddr;
 	dma_addr_t stats_phaddr;
-	struct slic_shmem_data __iomem *shmem_data;
+	struct slic_shmem_data *shmem_data;
 };
 
 struct slic_upr {
-- 
1.9.1

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

* Re: [PATCH v4] staging: slicoss: fix different address space warnings
  2016-11-18 17:57 ` Sergio Paracuellos
@ 2016-11-19 13:20   ` Greg KH
  2016-11-20  8:21     ` Sergio Paracuellos
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2016-11-19 13:20 UTC (permalink / raw)
  To: Sergio Paracuellos; +Cc: devel, linux-kernel, liodot

On Fri, Nov 18, 2016 at 06:57:18PM +0100, Sergio Paracuellos wrote:
> Remove incorrect __iomem annotation.
> 
> This patch fix the following sparse warnings in slicoss driver:
> warning: incorrect type in assignment (different address spaces)
> 
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---
>  drivers/staging/slicoss/slic.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
> index 420546d..14d7555 100644
> --- a/drivers/staging/slicoss/slic.h
> +++ b/drivers/staging/slicoss/slic.h
> @@ -380,7 +380,7 @@ struct slic_shmemory {
>  	dma_addr_t isr_phaddr;
>  	dma_addr_t lnkstatus_phaddr;
>  	dma_addr_t stats_phaddr;
> -	struct slic_shmem_data __iomem *shmem_data;
> +	struct slic_shmem_data *shmem_data;

But, is this the correct fix?  It looks like shmem_data is being treated
like a pointer to io memory, so we need to use the correct accessors for
that memory, and not just a "raw" pointer, right?  Removing this marking
seems to be moving backwards...

thanks,

greg k-h

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

* Re: [PATCH v4] staging: slicoss: fix different address space warnings
  2016-11-19 13:20   ` Greg KH
@ 2016-11-20  8:21     ` Sergio Paracuellos
  2016-11-21 10:09       ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Sergio Paracuellos @ 2016-11-20  8:21 UTC (permalink / raw)
  To: Greg KH; +Cc: devel, linux-kernel, Lior Dotan

On Sat, Nov 19, 2016 at 2:20 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Fri, Nov 18, 2016 at 06:57:18PM +0100, Sergio Paracuellos wrote:
>> Remove incorrect __iomem annotation.
>>
>> This patch fix the following sparse warnings in slicoss driver:
>> warning: incorrect type in assignment (different address spaces)
>>
>> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
>> ---
>>  drivers/staging/slicoss/slic.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
>> index 420546d..14d7555 100644
>> --- a/drivers/staging/slicoss/slic.h
>> +++ b/drivers/staging/slicoss/slic.h
>> @@ -380,7 +380,7 @@ struct slic_shmemory {
>>       dma_addr_t isr_phaddr;
>>       dma_addr_t lnkstatus_phaddr;
>>       dma_addr_t stats_phaddr;
>> -     struct slic_shmem_data __iomem *shmem_data;
>> +     struct slic_shmem_data *shmem_data;
>
> But, is this the correct fix?  It looks like shmem_data is being treated
> like a pointer to io memory, so we need to use the correct accessors for
> that memory, and not just a "raw" pointer, right?  Removing this marking
> seems to be moving backwards...

That was the intention of v3 of the patch. But after Dan suggestions I
though that just
removing this mark would be enough because it was wrong. I am a little
lost now :)

Cheers,
    Sergio Paracuellos

>
> thanks,
>
> greg k-h

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

* Re: [PATCH v4] staging: slicoss: fix different address space warnings
  2016-11-20  8:21     ` Sergio Paracuellos
@ 2016-11-21 10:09       ` Greg KH
  2016-11-21 11:02         ` Sergio Paracuellos
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2016-11-21 10:09 UTC (permalink / raw)
  To: Sergio Paracuellos; +Cc: devel, linux-kernel, Lior Dotan

On Sun, Nov 20, 2016 at 09:21:51AM +0100, Sergio Paracuellos wrote:
> On Sat, Nov 19, 2016 at 2:20 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Fri, Nov 18, 2016 at 06:57:18PM +0100, Sergio Paracuellos wrote:
> >> Remove incorrect __iomem annotation.
> >>
> >> This patch fix the following sparse warnings in slicoss driver:
> >> warning: incorrect type in assignment (different address spaces)
> >>
> >> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> >> ---
> >>  drivers/staging/slicoss/slic.h | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
> >> index 420546d..14d7555 100644
> >> --- a/drivers/staging/slicoss/slic.h
> >> +++ b/drivers/staging/slicoss/slic.h
> >> @@ -380,7 +380,7 @@ struct slic_shmemory {
> >>       dma_addr_t isr_phaddr;
> >>       dma_addr_t lnkstatus_phaddr;
> >>       dma_addr_t stats_phaddr;
> >> -     struct slic_shmem_data __iomem *shmem_data;
> >> +     struct slic_shmem_data *shmem_data;
> >
> > But, is this the correct fix?  It looks like shmem_data is being treated
> > like a pointer to io memory, so we need to use the correct accessors for
> > that memory, and not just a "raw" pointer, right?  Removing this marking
> > seems to be moving backwards...
> 
> That was the intention of v3 of the patch. But after Dan suggestions I
> though that just
> removing this mark would be enough because it was wrong. I am a little
> lost now :)

Ok, I'm lost too, sorry.  I looked at the driver and shmem_data is
created by calling pci_zalloc_consistent, and that's not __iomem space,
but a real pointer.

So your patch is correct here, sorry for the noise, I'll go apply it.

thanks,

greg k-h

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

* Re: [PATCH v4] staging: slicoss: fix different address space warnings
  2016-11-21 10:09       ` Greg KH
@ 2016-11-21 11:02         ` Sergio Paracuellos
  0 siblings, 0 replies; 6+ messages in thread
From: Sergio Paracuellos @ 2016-11-21 11:02 UTC (permalink / raw)
  To: Greg KH; +Cc: devel, linux-kernel, Lior Dotan

On Mon, Nov 21, 2016 at 11:09 AM, Greg KH <gregkh@linuxfoundation.org> wrote:

> Ok, I'm lost too, sorry.  I looked at the driver and shmem_data is
> created by calling pci_zalloc_consistent, and that's not __iomem space,
> but a real pointer.
>
> So your patch is correct here, sorry for the noise, I'll go apply it.
>
> thanks,
>
> greg k-h

I was thinking that my English wasn't good enough and I was missing
something :-)

Thanks for let me know, Greg.

Cheers,
    Sergio Paracuellos

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

end of thread, other threads:[~2016-11-21 11:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-18 17:57 [PATCH v4] staging: slicoss: fix different address space warnings Sergio Paracuellos
2016-11-18 17:57 ` Sergio Paracuellos
2016-11-19 13:20   ` Greg KH
2016-11-20  8:21     ` Sergio Paracuellos
2016-11-21 10:09       ` Greg KH
2016-11-21 11:02         ` Sergio Paracuellos

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