Added ULTRA_VBUS_IOinit_channel() and modified ULTRA_VBUS_init_channel()
function so that it can operate on both memory space and IO space
without getting sparse warnings.

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

diff --git a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h 
b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
index 0dd3e2d..a624e9e 100644
--- a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
@@ -94,8 +94,8 @@ typedef struct _ULTRA_VBUS_CHANNEL_PROTOCOL {
                                                sizeof(ULTRA_VBUS_DEVICEINFO)))
 #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,
+static inline void
+ULTRA_VBUS_IOinit_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
                        int bytesAllocated)
 {
        /* Please note that the memory at <x> does NOT necessarily have space
@@ -130,6 +130,14 @@ 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 bytesAllocated)
+{
+       ULTRA_VBUS_IOinit_channel(
+               (__force ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *)x,
+               bytesAllocated);
+}
+
 #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 8c0259a..4ae6960 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_devInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
+VBUSCHANNEL_IOdevInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
                                  char *p, int remain, int devix)
 {
        char __iomem *psrc;
@@ -206,4 +206,13 @@ VBUSCHANNEL_devInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO 
__iomem *devInfo,
        return chars;
 }
 
+static inline int
+VBUSCHANNEL_devInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO *devInfo,
+                                 char *p, int remain, int devix)
+{
+       return VBUSCHANNEL_IOdevInfoToStringBuffer(
+               (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 e3903ee..4ad0880 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_IOinit_channel(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