Added I/O versions for the functions vbuschannel_devinfo_to_string()
and ultra_vbus_init_channel() to get rid of noderef sparse warnings when
accessing I/O space.

Signed-off-by: Ken Cox <j...@redhat.com>
---
 .../staging/unisys/common-spar/include/channels/vbuschannel.h | 11 ++++++++++-
 drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h   | 11 ++++++++++-
 drivers/staging/unisys/uislib/uislib.c                        |  2 +-
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h 
b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
index 000182c..fc997bc 100644
--- a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
@@ -95,7 +95,7 @@ typedef struct _ULTRA_VBUS_CHANNEL_PROTOCOL {
 #define VBUS_CH_SIZE(MAXDEVICES) COVER(VBUS_CH_SIZE_EXACT(MAXDEVICES), 4096)
 
 static inline void
-ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
+ultra_vbus_init_channel_io(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
                        int bytesAllocated)
 {
        /* Please note that the memory at <x> does NOT necessarily have space
@@ -130,6 +130,15 @@ ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL 
__iomem *x,
               &x->HdrInfo.devInfoCount);
 }
 
+static inline void
+ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL *x,
+                       int bytes_allocated)
+{
+       ultra_vbus_init_channel_io(
+               (__force ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *)x,
+               bytes_allocated);
+}
+
 #pragma pack(pop)
 
 #endif
diff --git a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h 
b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
index abf01f6..c18efe5 100644
--- a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
+++ b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
@@ -146,7 +146,7 @@ VBUSCHANNEL_itoa(char *p, int remain, int num)
  * Returns the number of bytes written to <p>.
  */
 static inline int
-vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
+vbuschannel_devinfo_to_string_io(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
                                  char *p, int remain, int devix)
 {
        char __iomem *psrc;
@@ -206,4 +206,13 @@ vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO 
__iomem *devInfo,
        return chars;
 }
 
+static inline int
+vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO *devinfo,
+                                 char *p, int remain, int devix)
+{
+       return vbuschannel_devinfo_to_string_io(
+               (ULTRA_VBUS_DEVICEINFO __force __iomem *)devinfo,
+               p, remain, devix);
+}
+
 #endif
diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index 70cc00f..4d7c7f8 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -148,7 +148,7 @@ init_vbus_channel(U64 channelAddr, U32 channelBytes, int 
isServer)
                        rc = NULL;
                        goto Away;
                }
-               ultra_vbus_init_channel(pChan, channelBytes);
+               ultra_vbus_init_channel_io(pChan, channelBytes);
        } else {
                if (!ULTRA_VBUS_CHANNEL_OK_CLIENT(pChan, NULL)) {
                        ERRDRV("%s channel cannot be used", __func__);
-- 
1.8.5.3

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to