Skip to contentSkip to conversation

staging: slicoss: fix different address space warnings

PATCH Superseded Sergio Paracuellos 4 participants 5 messages Nov 15, 2016 – Nov 16, 2016 Staging

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: slicoss: fix different address space warnings

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

---
 drivers/staging/slicoss/slic.h    |  7 ++++
 drivers/staging/slicoss/slicoss.c | 83 ++++++++++++++++++++++-----------------
 2 files changed, 55 insertions(+), 35 deletions(-)
drivers/staging/slicoss/slic.h +7 -0
index 420546d..f76c0cd 100644
@@ -540,6 +540,13 @@ static inline void slic_flush_write(struct adapter *adapter)
 	ioread32(adapter->regs + SLIC_REG_HOSTID);
 }
 
+#define IOMEM_GET_FIELDADDR(base, member)				\
+({									\
+	char __iomem *_base = (char __iomem *)base;			\
+	_base += offsetof(typeof(*base), member);			\
+	(void __iomem *)_base;						\
+})
+
 #define UPDATE_STATS(largestat, newstat, oldstat)                        \
 {                                                                        \
 	if ((newstat) < (oldstat))                                       \
drivers/staging/slicoss/slicoss.c +48 -35

183 lines not on this page · raw message

Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 14 lines · Sergio Paracuellos

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

---
 drivers/staging/slicoss/slic.h    |  7 ++++
 drivers/staging/slicoss/slicoss.c | 83 ++++++++++++++++++++++-----------------
 2 files changed, 55 insertions(+), 35 deletions(-)
drivers/staging/slicoss/slic.h +0 -0
index 420546d..f76c0cd 100644

drivers/staging/slicoss/slic.h static inline void slic_flush_write(struct adapter *adapter) · line 548

Quoted 9 lines
drivers/staging/slicoss/slic.h +6 -0
@@ -540,6 +540,13 @@ static inline void slic_flush_write(struct adapter *adapter)
 	ioread32(adapter->regs + SLIC_REG_HOSTID);
 }
 
+#define IOMEM_GET_FIELDADDR(base, member)				\
+({									\
+	char __iomem *_base = (char __iomem *)base;			\
+	_base += offsetof(typeof(*base), member);			\
+	(void __iomem *)_base;						\
+})

Really? Why? Shouldn't you be marking base as __iomem all the time? That way you don't need this mess of a cast.

thanks,

greg k-h

#2 lore raw
In reply to Sergio Paracuellos
url: https://github.com/0day-ci/linux/commits/Sergio-Paracuellos/staging-slicoss-fix-different-address-space-warnings/20161116-025006 config: i386-randconfig-x003-201646 (attached as .config)…

Hi Sergio,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.9-rc5 next-20161115]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Sergio-Paracuellos/staging-slicoss-fix-different-address-space-warnings/20161116-025006
config: i386-randconfig-x003-201646 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:

        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

In file included from drivers/staging/slicoss/slicoss.c:97:0:
drivers/staging/slicoss/slicoss.c: In function 'slic_upr_request_complete':

>> drivers/staging/slicoss/slicoss.c:1019:5: error: implicit declaration of function 'ioread64' [-Werror=implicit-function-declaration]
        ioread64(&stats->xmit_tcp_segs),
        ^
   drivers/staging/slicoss/slic.h:560:19: note: in definition of macro 'UPDATE_STATS_GB'
     (largestat) += ((newstat) - (oldstat));                          \
                      ^~~~~~~

cc1: some warnings being treated as errors

vim +/ioread64 +1019 drivers/staging/slicoss/slicoss.c

1013 dev_err(&adapter->netdev->dev,
1014 "SLIC_UPR_STATS command failed isr[%x]\n", isr);
1015 break;
1016 }
1017
1018 UPDATE_STATS_GB(stst->tcp.xmit_tcp_segs,

> 1019					ioread64(&stats->xmit_tcp_segs),

1020 old->xmit_tcp_segs);
1021
1022 UPDATE_STATS_GB(stst->tcp.xmit_tcp_bytes,

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#3 lore raw
In reply to Sergio Paracuellos
url: https://github.com/0day-ci/linux/commits/Sergio-Paracuellos/staging-slicoss-fix-different-address-space-warnings/20161116-025006 config: x86_64-acpi-redef (attached as .config) compiler: gcc-6…

Hi Sergio,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.9-rc5 next-20161115]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Sergio-Paracuellos/staging-slicoss-fix-different-address-space-warnings/20161116-025006
config: x86_64-acpi-redef (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:

        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

drivers/built-in.o: In function `slic_upr_request_complete':

>> slicoss.c:(.text+0x6830c7): undefined reference to `ioread64'

slicoss.c:(.text+0x6830e4): undefined reference to ioread64' slicoss.c:(.text+0x683102): undefined reference to ioread64' slicoss.c:(.text+0x683120): undefined reference to ioread64' slicoss.c:(.text+0x68313e): undefined reference to ioread64' drivers/built-in.o:slicoss.c:(.text+0x68315c): more undefined references to `ioread64' follow

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation