[PATCH] unisys: Fix sparse error - accessing __iomem directly
Copy the channel type into a temporary buffer so that code will work for architectures that don't support MMIO. This now works in same way as other tests in same function. Re-sent since I initially didn't copy de...@driverdev.osuosl.org and sparmaintai...@unisys.com doesn't seem to be a mailing list (despite what get_maintainer.pl indicates). Signed-off-by: Luke Hart --- drivers/staging/unisys/common-spar/include/channels/channel.h | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h b/drivers/staging/unisys/common-spar/include/channels/channel.h index 2004cfe..ef24f5a 100644 --- a/drivers/staging/unisys/common-spar/include/channels/channel.h +++ b/drivers/staging/unisys/common-spar/include/channels/channel.h @@ -347,10 +347,12 @@ ULTRA_check_channel_client(void __iomem *pChannel, u64 expectedSignature, char *fileName, int lineNumber, void *logCtx) { - if (uuid_le_cmp(expectedTypeGuid, NULL_UUID_LE) != 0) + if (uuid_le_cmp(expectedTypeGuid, NULL_UUID_LE) != 0) { + uuid_le guid; + + ioread8_rep(&((CHANNEL_HEADER __iomem *)(pChannel))->Type, + &guid, sizeof(guid)); /* caller wants us to verify type GUID */ - if (uuid_le_cmpCHANNEL_HEADER __iomem *)(pChannel))->Type), - expectedTypeGuid) != 0) { + if (uuid_le_cmp(guid, expectedTypeGuid) != 0) { CHANNEL_GUID_MISMATCH(expectedTypeGuid, channelName, "type", expectedTypeGuid, ((CHANNEL_HEADER __iomem *) @@ -358,6 +360,7 @@ ULTRA_check_channel_client(void __iomem *pChannel, lineNumber, logCtx); return 0; } + } if (expectedMinBytes > 0) /* caller wants us to verify * channel size */ if (readq(&((CHANNEL_HEADER __iomem *) -- 1.8.5.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: unisys: Fix sparse error - accessing __iomem directly
Copy the channel type into a temporary buffer so that code will work for architectures that don't support MMIO. This now works in same way as other tests in same function. Signed-off-by: Luke Hart --- drivers/staging/unisys/common-spar/include/channels/channel.h | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h b/drivers/staging/unisys/common-spar/include/channels/channel.h index 2004cfe..ef24f5a 100644 --- a/drivers/staging/unisys/common-spar/include/channels/channel.h +++ b/drivers/staging/unisys/common-spar/include/channels/channel.h @@ -347,10 +347,12 @@ ULTRA_check_channel_client(void __iomem *pChannel, u64 expectedSignature, char *fileName, int lineNumber, void *logCtx) { - if (uuid_le_cmp(expectedTypeGuid, NULL_UUID_LE) != 0) + if (uuid_le_cmp(expectedTypeGuid, NULL_UUID_LE) != 0) { + uuid_le guid; + + ioread8_rep(&((CHANNEL_HEADER __iomem *)(pChannel))->Type, + &guid, sizeof(guid)); /* caller wants us to verify type GUID */ - if (uuid_le_cmpCHANNEL_HEADER __iomem *)(pChannel))->Type), - expectedTypeGuid) != 0) { + if (uuid_le_cmp(guid, expectedTypeGuid) != 0) { CHANNEL_GUID_MISMATCH(expectedTypeGuid, channelName, "type", expectedTypeGuid, ((CHANNEL_HEADER __iomem *) @@ -358,6 +360,7 @@ ULTRA_check_channel_client(void __iomem *pChannel, lineNumber, logCtx); return 0; } + } if (expectedMinBytes > 0) /* caller wants us to verify * channel size */ if (readq(&((CHANNEL_HEADER __iomem *) -- 1.8.5.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: unisys: Fix sparse error - accessing __iomem directly
Copy the channel type into a temporary buffer so that code will work for architectures that don't support MMIO. This now works in same way as other tests in same function. Signed-off-by: Luke Hart --- drivers/staging/unisys/common-spar/include/channels/channel.h | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h b/drivers/staging/unisys/common-spar/include/channels/channel.h index 2004cfe..5ba5e56 100644 --- a/drivers/staging/unisys/common-spar/include/channels/channel.h +++ b/drivers/staging/unisys/common-spar/include/channels/channel.h @@ -347,10 +347,13 @@ ULTRA_check_channel_client(void __iomem *pChannel, u64 expectedSignature, char *fileName, int lineNumber, void *logCtx) { - if (uuid_le_cmp(expectedTypeGuid, NULL_UUID_LE) != 0) + if (uuid_le_cmp(expectedTypeGuid, NULL_UUID_LE) != 0) { + uuid_le guid; + + ioread8_rep(&((CHANNEL_HEADER __iomem *)(pChannel))->Type, + &guid, sizeof(guid)); /* caller wants us to verify type GUID */ - if (uuid_le_cmpCHANNEL_HEADER __iomem *)(pChannel))->Type), - expectedTypeGuid) != 0) { + if (uuid_le_cmp(guid, expectedTypeGuid) != 0) { CHANNEL_GUID_MISMATCH(expectedTypeGuid, channelName, "type", expectedTypeGuid, ((CHANNEL_HEADER __iomem *) @@ -358,6 +361,7 @@ ULTRA_check_channel_client(void __iomem *pChannel, lineNumber, logCtx); return 0; } + } if (expectedMinBytes > 0) /* caller wants us to verify * channel size */ if (readq(&((CHANNEL_HEADER __iomem *) -- 1.8.5.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: unisys: Fix sparse error - accessing __iomem directly
On 11/09/2014 22:53, Greg KH wrote: On Mon, Sep 08, 2014 at 03:27:35PM +0100, Luke Hart wrote: Copy the channel type into a temporary buffer so that code will work for architectures that don't support MMIO. This now works in same way as other tests in same function. Signed-off-by: Luke Hart --- drivers/staging/unisys/common-spar/include/channels/channel.h | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h b/drivers/staging/unisys/common-spar/include/channels/channel.h index 2004cfe..ef24f5a 100644 --- a/drivers/staging/unisys/common-spar/include/channels/channel.h +++ b/drivers/staging/unisys/common-spar/include/channels/channel.h @@ -347,10 +347,12 @@ ULTRA_check_channel_client(void __iomem *pChannel, u64 expectedSignature, char *fileName, int lineNumber, void *logCtx) { - if (uuid_le_cmp(expectedTypeGuid, NULL_UUID_LE) != 0) + if (uuid_le_cmp(expectedTypeGuid, NULL_UUID_LE) != 0) { + uuid_le guid; + + ioread8_rep(&((CHANNEL_HEADER __iomem *)(pChannel))->Type, + &guid, sizeof(guid)); /* caller wants us to verify type GUID */ - if (uuid_le_cmpCHANNEL_HEADER __iomem *)(pChannel))->Type), - expectedTypeGuid) != 0) { + if (uuid_le_cmp(guid, expectedTypeGuid) != 0) { CHANNEL_GUID_MISMATCH(expectedTypeGuid, channelName, "type", expectedTypeGuid, ((CHANNEL_HEADER __iomem *) @@ -358,6 +360,7 @@ ULTRA_check_channel_client(void __iomem *pChannel, lineNumber, logCtx); return 0; } + } if (expectedMinBytes > 0)/* caller wants us to verify * channel size */ if (readq(&((CHANNEL_HEADER __iomem *) Somehow this patch is corrupted: checking file drivers/staging/unisys/common-spar/include/channels/channel.h patch: malformed patch at line 128: ((CHANNEL_HEADER __iomem *) And git doesn't like it: Applying: staging: unisys: Fix sparse error - accessing __iomem directly fatal: corrupt patch at line 26 Patch failed at 0001 staging: unisys: Fix sparse error - accessing __iomem directly Can you please fix this up and resend? thanks, greg k-h Sorry about that, corrected patch has been resent. Thanks, Luke ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel