staging: slicoss: fix different address space warnings
v3 cover 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.
Sergio Paracuellos (2):
staging: slicoss: fix different address space warnings: 32 bits
staging: slicoss: fix different address space warnings: 64 bits
drivers/staging/slicoss/slic.h | 18 +++++++++ drivers/staging/slicoss/slicoss.c | 82 ++++++++++++++++++++++----------------- 2 files changed, 65 insertions(+), 35 deletions(-)
Signature · 1 line
1.9.1
PATCH v3 1/2 staging: slicoss: fix different address space warnings: 32 bits
This patch fix the following sparse warnings in slicoss driver:
warning: incorrect type in assignment (different address spaces)
This changes are for 32 bit architectures.
--- drivers/staging/slicoss/slic.h | 9 +++++ drivers/staging/slicoss/slicoss.c | 82 ++++++++++++++++++++++----------------- 2 files changed, 56 insertions(+), 35 deletions(-)
drivers/staging/slicoss/slic.h +9 -0
@@ -540,6 +540,15 @@ static inline void slic_flush_write(struct adapter *adapter)ioread32 (adapter->regs +SLIC_REG_HOSTID ); } +static inline u64 slic_ioread64 (void __iomem *mmio) +{ +u64 low, high; + + low =ioread32 (mmio); + high =ioread32 (mmio +sizeof (u32)); +return low | (high <<32 ); +} +#define UPDATE_STATS (largestat, newstat, oldstat) \ { \ if ((newstat) < (oldstat)) \
drivers/staging/slicoss/slicoss.c +47 -35
182 lines not on this page · raw message
Signature · 1 line
1.9.1
Re: [PATCH v3 1/2] staging: slicoss: fix different address space warnings: 32 bits
Hm... I seem to duplicate the Sparse warnings at all. That's weird.
Anyway as far as I can tell the warnings are false positives... Can't you just remove the __iomem tag? Have you tested this change?
regards,
dan carpenter
Re: [PATCH v3 1/2] staging: slicoss: fix different address space warnings: 32 bits
Quoted 2 lines · Dan Carpenter
Hm... I seem to duplicate the Sparse warnings at all. That's weird.
With this patch applied, sparse warnings dissapear for me... That's weird.
Quoted 3 lines
Anyway as far as I can tell the warnings are false positives... Can't you just remove the
__iomemtag? Have you tested this change?
I haven' t tested this change because I can't test it :(. Do you think that just removing__iomem tag is enough? Maybe we can get feedback from Lior or someone.
Thanks for your review time, Dan.
Cheers,
Sergio Paracuellos
Re: [PATCH v3 1/2] staging: slicoss: fix different address space warnings: 32 bits
Quoted 7 lines · Sergio Paracuellos
Quoted 2 lines · Dan Carpenter
Hm... I seem to duplicate the Sparse warnings at all. That's weird.
With this patch applied, sparse warnings dissapear for me... That's weird.
I understand that.
Quoted 6 lines
Quoted 3 lines
Anyway as far as I can tell the warnings are false positives... Can't you just remove the
__iomemtag? Have you tested this change?I haven' t tested this change because I can't test it :(. Do you think that just removing
__iomemtag is enough?
Give it a shot and see if the warnings go away. I don't think the tag is correct.
regards,
dan carpenter
Re: [PATCH v3 1/2] staging: slicoss: fix different address space warnings: 32 bits
Quoted 2 lines · Dan Carpenter
Give it a shot and see if the warnings go away. I don't think the tag is correct.
Just removing __iomem tag in shmem_data field of slic_shmemory struct makes sparse happy. No warnings around.
Should I send a v4 patch with the tag removed?
Cheers,
Sergio Paracuellos
Greg KH
maintainerRe: [PATCH v3 1/2] staging: slicoss: fix different address space warnings: 32 bits
Quoted 9 lines · Sergio Paracuellos
Quoted 2 lines · Dan Carpenter
Give it a shot and see if the warnings go away. I don't think the tag is correct.
Just removing
__iomemtag inshmem_datafield ofslic_shmemorystruct makes sparse happy. No warnings around.Should I send a v4 patch with the tag removed?
Yes, please fix up this series and resend.
thanks,
greg k-h
PATCH v3 2/2 staging: slicoss: fix different address space warnings: 64 bits
In reply to Sergio ParacuellosThis patch fix the following sparse warnings in slicoss driver:
warning: incorrect type in assignment (different address spaces)
This changes are for 64 bits.
--- drivers/staging/slicoss/slic.h | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/staging/slicoss/slic.h +9 -0
@@ -540,6 +540,7 @@ static inline void slic_flush_write(struct adapter *adapter)ioread32 (adapter->regs +SLIC_REG_HOSTID ); } +#if BITS_PER_LONG ==32 static inline u64 slic_ioread64 (void __iomem *mmio) {u64 low, high;
@@ -548,6 +549,14 @@ static inline u64 slic_ioread64(void __iomem *mmio) high =ioread32 (mmio +sizeof (u32));return low | (high <<32 ); } +#elif BITS_PER_LONG ==64 +static inline u64 slic_ioread64 (void __iomem *mmio) +{ +return readq (mmio); +} +#else +#error BITS_PER_LONG must be 32 or 64 +#endif #define UPDATE_STATS (largestat, newstat, oldstat) \ { \
Signature · 1 line
1.9.1