Re: [PATCH v2 2/2] Staging: unisys: Fix sparse warnings in uislib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 06/05/2014 11:22 AM, Greg KH wrote:
On Thu, Jun 05, 2014 at 11:04:32AM -0500, Ken Cox wrote:
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 <jkc@xxxxxxxxxx>
---
  .../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,
Why do you need to __force anything here?  Why not fix it up in the
callers by marking those variables properly?
I was using memcpy_toio(), etc. as an example, but can see that it would be more portable to take care of it in the calling function, even though this is x86_64 only. I will rework the patch.

Thanks,
Ken
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux