2023-10-13 03:01:23

by chenguohua

[permalink] [raw]
Subject: [PATCH] iosys-map: Clean up errors in iosys-map.h

Fix the following errors reported by checkpatch:

ERROR: spaces required around that ':' (ctx:VxW)

Signed-off-by: GuoHua Cheng <[email protected]>
---
include/linux/iosys-map.h | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/linux/iosys-map.h b/include/linux/iosys-map.h
index cb71aa616bd3..108fd0dd9121 100644
--- a/include/linux/iosys-map.h
+++ b/include/linux/iosys-map.h
@@ -349,29 +349,29 @@ static inline void iosys_map_memset(struct iosys_map *dst, size_t offset,

#ifdef CONFIG_64BIT
#define __iosys_map_rd_io_u64_case(val_, vaddr_iomem_) \
- u64: val_ = readq(vaddr_iomem_)
+ u64 : val_ = readq(vaddr_iomem_)
#define __iosys_map_wr_io_u64_case(val_, vaddr_iomem_) \
- u64: writeq(val_, vaddr_iomem_)
+ u64 : writeq(val_, vaddr_iomem_)
#else
#define __iosys_map_rd_io_u64_case(val_, vaddr_iomem_) \
- u64: memcpy_fromio(&(val_), vaddr_iomem_, sizeof(u64))
+ u64 : memcpy_fromio(&(val_), vaddr_iomem_, sizeof(u64))
#define __iosys_map_wr_io_u64_case(val_, vaddr_iomem_) \
- u64: memcpy_toio(vaddr_iomem_, &(val_), sizeof(u64))
+ u64 : memcpy_toio(vaddr_iomem_, &(val_), sizeof(u64))
#endif

#define __iosys_map_rd_io(val__, vaddr_iomem__, type__) _Generic(val__, \
- u8: val__ = readb(vaddr_iomem__), \
- u16: val__ = readw(vaddr_iomem__), \
- u32: val__ = readl(vaddr_iomem__), \
+ u8 : val__ = readb(vaddr_iomem__), \
+ u16 : val__ = readw(vaddr_iomem__), \
+ u32 : val__ = readl(vaddr_iomem__), \
__iosys_map_rd_io_u64_case(val__, vaddr_iomem__))

#define __iosys_map_rd_sys(val__, vaddr__, type__) \
val__ = READ_ONCE(*(type__ *)(vaddr__))

#define __iosys_map_wr_io(val__, vaddr_iomem__, type__) _Generic(val__, \
- u8: writeb(val__, vaddr_iomem__), \
- u16: writew(val__, vaddr_iomem__), \
- u32: writel(val__, vaddr_iomem__), \
+ u8 : writeb(val__, vaddr_iomem__), \
+ u16 : writew(val__, vaddr_iomem__), \
+ u32 : writel(val__, vaddr_iomem__), \
__iosys_map_wr_io_u64_case(val__, vaddr_iomem__))

#define __iosys_map_wr_sys(val__, vaddr__, type__) \
--
2.17.1


2023-10-13 06:57:15

by Thomas Zimmermann

[permalink] [raw]
Subject: Re: [PATCH] iosys-map: Clean up errors in iosys-map.h

Hi

Am 13.10.23 um 04:58 schrieb [email protected]:
> Fix the following errors reported by checkpatch:
>
> ERROR: spaces required around that ':' (ctx:VxW)

This looks like a false-positive report and I'd say that checkpatch
assumes that it's a ?: operator. But these macros contain _Generic
statements, which are similar to switch.

Best regards
Thomas

>
> Signed-off-by: GuoHua Cheng <[email protected]>
> ---
> include/linux/iosys-map.h | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/include/linux/iosys-map.h b/include/linux/iosys-map.h
> index cb71aa616bd3..108fd0dd9121 100644
> --- a/include/linux/iosys-map.h
> +++ b/include/linux/iosys-map.h
> @@ -349,29 +349,29 @@ static inline void iosys_map_memset(struct iosys_map *dst, size_t offset,
>
> #ifdef CONFIG_64BIT
> #define __iosys_map_rd_io_u64_case(val_, vaddr_iomem_) \
> - u64: val_ = readq(vaddr_iomem_)
> + u64 : val_ = readq(vaddr_iomem_)
> #define __iosys_map_wr_io_u64_case(val_, vaddr_iomem_) \
> - u64: writeq(val_, vaddr_iomem_)
> + u64 : writeq(val_, vaddr_iomem_)
> #else
> #define __iosys_map_rd_io_u64_case(val_, vaddr_iomem_) \
> - u64: memcpy_fromio(&(val_), vaddr_iomem_, sizeof(u64))
> + u64 : memcpy_fromio(&(val_), vaddr_iomem_, sizeof(u64))
> #define __iosys_map_wr_io_u64_case(val_, vaddr_iomem_) \
> - u64: memcpy_toio(vaddr_iomem_, &(val_), sizeof(u64))
> + u64 : memcpy_toio(vaddr_iomem_, &(val_), sizeof(u64))
> #endif
>
> #define __iosys_map_rd_io(val__, vaddr_iomem__, type__) _Generic(val__, \
> - u8: val__ = readb(vaddr_iomem__), \
> - u16: val__ = readw(vaddr_iomem__), \
> - u32: val__ = readl(vaddr_iomem__), \
> + u8 : val__ = readb(vaddr_iomem__), \
> + u16 : val__ = readw(vaddr_iomem__), \
> + u32 : val__ = readl(vaddr_iomem__), \
> __iosys_map_rd_io_u64_case(val__, vaddr_iomem__))
>
> #define __iosys_map_rd_sys(val__, vaddr__, type__) \
> val__ = READ_ONCE(*(type__ *)(vaddr__))
>
> #define __iosys_map_wr_io(val__, vaddr_iomem__, type__) _Generic(val__, \
> - u8: writeb(val__, vaddr_iomem__), \
> - u16: writew(val__, vaddr_iomem__), \
> - u32: writel(val__, vaddr_iomem__), \
> + u8 : writeb(val__, vaddr_iomem__), \
> + u16 : writew(val__, vaddr_iomem__), \
> + u32 : writel(val__, vaddr_iomem__), \
> __iosys_map_wr_io_u64_case(val__, vaddr_iomem__))
>
> #define __iosys_map_wr_sys(val__, vaddr__, type__) \

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


Attachments:
OpenPGP_signature.asc (855.00 B)
OpenPGP digital signature