Skip to contentSkip to conversation

platform/x86: apple-gmux: Fix iomem_base __iomem annotation

PATCH In review Hans de Goede 2 participants 3 messages Apr 4, 2023 – Apr 6, 2023 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: apple-gmux: Fix iomem_base __iomem annotation

Fix the __iomem annotation of the iomem_base pointers in the apple-gmux code. The __iomem should go before the *.

This fixes a bunch of sparse warnings like this one:

drivers/platform/x86/apple-gmux.c:224:48: sparse:
expected void const [noderef] __iomem *
got unsigned char [usertype] *

Fixes 0c18184de990 ("platform/x86: apple-gmux: support MMIO gmux on T2 Macs")
---
 drivers/platform/x86/apple-gmux.c | 2 +-
 include/linux/apple-gmux.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/apple-gmux.c +1 -1
index 4c311e1dedad..e02b4aea4f1e 100644
@@ -57,7 +57,7 @@
 struct apple_gmux_config;
 
 struct apple_gmux_data {
-	u8 *__iomem iomem_base;
+	u8 __iomem *iomem_base;
 	unsigned long iostart;
 	unsigned long iolen;
 	const struct apple_gmux_config *config;
include/linux/apple-gmux.h +1 -1
index a7a7d430024b..206d97ffda79 100644
@@ -66,7 +66,7 @@ static inline bool apple_gmux_is_indexed(unsigned long iostart)
 
 static inline bool apple_gmux_is_mmio(unsigned long iostart)
 {
-	u8 *__iomem iomem_base = ioremap(iostart, 16);
+	u8 __iomem *iomem_base = ioremap(iostart, 16);
 	u8 val;
 
 	if (!iomem_base)
Signature · 1 line
2.39.1
Reviewed-by on v1 1/1
#1 lore raw

Thanks for fixing this up, Hans.

Quoted 50 lines · Hans de Goede

Fix the __iomem annotation of the iomem_base pointers in the apple-gmux code. The __iomem should go before the *.

This fixes a bunch of sparse warnings like this one:

drivers/platform/x86/apple-gmux.c:224:48: sparse:
expected void const [noderef] __iomem *
got unsigned char [usertype] *

Fixes 0c18184de990 ("platform/x86: apple-gmux: support MMIO gmux on T2 Macs")

---
drivers/platform/x86/apple-gmux.c | 2 +-
include/linux/apple-gmux.h | 2 +-

2 files changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/apple-gmux.c +1 -1
index 4c311e1dedad..e02b4aea4f1e 100644
@@ -57,7 +57,7 @@
 struct apple_gmux_config;
 
 struct apple_gmux_data {
-    u8 *__iomem iomem_base;
+    u8 __iomem *iomem_base;
   unsigned long iostart;
   unsigned long iolen;
   const struct apple_gmux_config *config;
include/linux/apple-gmux.h +1 -1
index a7a7d430024b..206d97ffda79 100644
@@ -66,7 +66,7 @@ static inline bool apple_gmux_is_indexed(unsigned long iostart)
 
 static inline bool apple_gmux_is_mmio(unsigned long iostart)
 {
-    u8 *__iomem iomem_base = ioremap(iostart, 16);
+    u8 __iomem *iomem_base = ioremap(iostart, 16);
   u8 val;
 
   if (!iomem_base)
Signature · 1 line
2.39.1
#2 lore raw

Hi,

Quoted 3 lines · Orlando Chamberlain

Thanks for fixing this up, Hans.

Thanks.

I've added this to my review-hans (soon to be for-next) branch now.

Regards,

Hans

Quoted 51 lines
Quoted 50 lines · Hans de Goede

Fix the __iomem annotation of the iomem_base pointers in the apple-gmux code. The __iomem should go before the *.

This fixes a bunch of sparse warnings like this one:

drivers/platform/x86/apple-gmux.c:224:48: sparse:
expected void const [noderef] __iomem *
got unsigned char [usertype] *

Fixes 0c18184de990 ("platform/x86: apple-gmux: support MMIO gmux on T2 Macs")

---
drivers/platform/x86/apple-gmux.c | 2 +-
include/linux/apple-gmux.h | 2 +-

2 files changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/apple-gmux.c +1 -1
index 4c311e1dedad..e02b4aea4f1e 100644
@@ -57,7 +57,7 @@
 struct apple_gmux_config;
 
 struct apple_gmux_data {
-    u8 *__iomem iomem_base;
+    u8 __iomem *iomem_base;
   unsigned long iostart;
   unsigned long iolen;
   const struct apple_gmux_config *config;
include/linux/apple-gmux.h +1 -1
index a7a7d430024b..206d97ffda79 100644
@@ -66,7 +66,7 @@ static inline bool apple_gmux_is_indexed(unsigned long iostart)
 
 static inline bool apple_gmux_is_mmio(unsigned long iostart)
 {
-    u8 *__iomem iomem_base = ioremap(iostart, 16);
+    u8 __iomem *iomem_base = ioremap(iostart, 16);
   u8 val;
 
   if (!iomem_base)
Signature · 1 line
2.39.1