Skip to contentSkip to conversation

staging: slicoss: fix different address space warnings

PATCH Superseded Sergio Paracuellos 3 participants 8 messages Nov 17, 2016 – Nov 18, 2016 Staging

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

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
#7 lore raw

PATCH v3 2/2 staging: slicoss: fix different address space warnings: 64 bits

This 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
index d637ab1..63637ba 100644
@@ -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
#1 lore raw

PATCH v3 1/2 staging: slicoss: fix different address space warnings: 32 bits

In reply to Sergio Paracuellos

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
index 420546d..d637ab1 100644
@@ -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
#2 lore raw

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

#3 lore raw

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 __iomem tag? 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

#4 lore raw

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 __iomem tag? 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?

Give it a shot and see if the warnings go away. I don't think the tag is correct.

regards,
dan carpenter

#5 lore raw

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

maintainer
#6 lore raw

Re: [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 __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?

Yes, please fix up this series and resend.

thanks,

greg k-h