diff mbox series

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

Message ID 20230404111955.43266-1-hdegoede@redhat.com (mailing list archive)
State Accepted, archived
Headers show
Series platform/x86: apple-gmux: Fix iomem_base __iomem annotation | expand

Commit Message

Hans de Goede April 4, 2023, 11:19 a.m. UTC
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")
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202304040401.IMxt7Ubi-lkp@intel.com/
Suggested-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/apple-gmux.c | 2 +-
 include/linux/apple-gmux.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Orlando Chamberlain April 4, 2023, 11:47 a.m. UTC | #1
Thanks for fixing this up, Hans.

Reviewed-by: Orlando Chamberlain <orlandoch.dev@gmail.com>
> On 4 Apr 2023, at 9:20 pm, Hans de Goede <hdegoede@redhat.com> wrote:
> 
> 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")
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/oe-kbuild-all/202304040401.IMxt7Ubi-lkp@intel.com/
> Suggested-by: Dan Carpenter <error27@gmail.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/platform/x86/apple-gmux.c | 2 +-
> include/linux/apple-gmux.h        | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c
> index 4c311e1dedad..e02b4aea4f1e 100644
> --- a/drivers/platform/x86/apple-gmux.c
> +++ b/drivers/platform/x86/apple-gmux.c
> @@ -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;
> diff --git a/include/linux/apple-gmux.h b/include/linux/apple-gmux.h
> index a7a7d430024b..206d97ffda79 100644
> --- a/include/linux/apple-gmux.h
> +++ b/include/linux/apple-gmux.h
> @@ -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)
> -- 
> 2.39.1
>
Hans de Goede April 6, 2023, 12:24 p.m. UTC | #2
Hi,

On 4/4/23 13:47, Orlando Chamberlain wrote:
> Thanks for fixing this up, Hans.
> 
> Reviewed-by: Orlando Chamberlain <orlandoch.dev@gmail.com>

Thanks.

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

Regards,

Hans



>> On 4 Apr 2023, at 9:20 pm, Hans de Goede <hdegoede@redhat.com> wrote:
>>
>> 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")
>> Reported-by: kernel test robot <lkp@intel.com>
>> Link: https://lore.kernel.org/oe-kbuild-all/202304040401.IMxt7Ubi-lkp@intel.com/
>> Suggested-by: Dan Carpenter <error27@gmail.com>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>> drivers/platform/x86/apple-gmux.c | 2 +-
>> include/linux/apple-gmux.h        | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c
>> index 4c311e1dedad..e02b4aea4f1e 100644
>> --- a/drivers/platform/x86/apple-gmux.c
>> +++ b/drivers/platform/x86/apple-gmux.c
>> @@ -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;
>> diff --git a/include/linux/apple-gmux.h b/include/linux/apple-gmux.h
>> index a7a7d430024b..206d97ffda79 100644
>> --- a/include/linux/apple-gmux.h
>> +++ b/include/linux/apple-gmux.h
>> @@ -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)
>> -- 
>> 2.39.1
>>
>
diff mbox series

Patch

diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c
index 4c311e1dedad..e02b4aea4f1e 100644
--- a/drivers/platform/x86/apple-gmux.c
+++ b/drivers/platform/x86/apple-gmux.c
@@ -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;
diff --git a/include/linux/apple-gmux.h b/include/linux/apple-gmux.h
index a7a7d430024b..206d97ffda79 100644
--- a/include/linux/apple-gmux.h
+++ b/include/linux/apple-gmux.h
@@ -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)