staging: slicoss: fix different address space warnings
PATCH v4 1/1 staging: slicoss: fix different address space warnings
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(-)
Signature · 1 line
1.9.1
PATCH v4 1/1 staging: slicoss: fix different address space warnings
Remove incorrect __iomem annotation.
This patch fix the following sparse warnings in slicoss driver:
warning: incorrect type in assignment (different address spaces)
--- drivers/staging/slicoss/slic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/slicoss/slic.h +1 -1
@@ -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 {
Signature · 1 line
1.9.1
Greg KH
maintainerQuoted 15 lines · Sergio Paracuellos
Remove incorrect
__iomemannotation.This patch fix the following sparse warnings in slicoss driver:
warning: incorrect type in assignment (different address spaces)Signed-off-by Sergio Paracuellos <[email protected]>--- drivers/staging/slicoss/slic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/slicoss/slic.h +0
-0
drivers/staging/slicoss/slic.h struct slic_shmemory { · line 383
Quoted 5 lines
drivers/staging/slicoss/slic.h +1
-1@@ -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
Quoted 11 lines · Greg KH
Quoted 10 lines · Sergio Paracuellos
Remove incorrect
__iomemannotation.This patch fix the following sparse warnings in slicoss driver:
warning: incorrect type in assignment (different address spaces)Signed-off-by Sergio Paracuellos <[email protected]>--- drivers/staging/slicoss/slic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
drivers/staging/slicoss/slic.h struct slic_shmemory { · line 383
Quoted 10 lines
drivers/staging/slicoss/slic.h +1
-1@@ -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_datais 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
Quoted 4 lines
thanks,
greg k-h
Greg KH
maintainerQuoted 28 lines · Sergio Paracuellos
Quoted 11 lines · Greg KH
Quoted 10 lines · Sergio Paracuellos
Remove incorrect
__iomemannotation.This patch fix the following sparse warnings in slicoss driver:
warning: incorrect type in assignment (different address spaces)Signed-off-by Sergio Paracuellos <[email protected]>--- drivers/staging/slicoss/slic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 15 lines
drivers/staging/slicoss/slic.h struct slic_shmemory { · line 383
Quoted 10 lines
drivers/staging/slicoss/slic.h +1
-1@@ -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_datais 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...
Quoted 4 lines
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
Quoted 9 lines · Greg KH
Ok, I'm lost too, sorry. I looked at the driver and
shmem_datais created by callingpci_zalloc_consistent, and that's not__iomemspace, 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