[Intel-xe] ✗ CI.checkpatch: warning for iosys-map: Rename locals used inside macros

Patchwork patchwork at emeril.freedesktop.org
Wed Nov 15 20:12:57 UTC 2023


== Series Details ==

Series: iosys-map: Rename locals used inside macros
URL   : https://patchwork.freedesktop.org/series/126484/
State : warning

== Summary ==

+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
63c2b6b160bca2df6efc7bc4cea6f442097d7854
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit f0e788e5c3507534afa730c0e724a383a7e1abb6
Author: Michał Winiarski <michal.winiarski at intel.com>
Date:   Wed Nov 15 08:06:00 2023 -0800

    iosys-map: Rename locals used inside macros
    
    Widely used variable names can be used by macro users, potentially
    leading to name collisions.
    Suffix locals used inside the macros with an underscore, to reduce the
    collision potential.
    
    Suggested-by: Lucas De Marchi <lucas.demarchi at intel.com>
    Signed-off-by: Michał Winiarski <michal.winiarski at intel.com>
    Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>
    Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20231024110710.3039807-1-michal.winiarski@intel.com
    (cherry picked from commit 2e122362d25e1b977aa5c5c88c03956be4228e02)
+ /mt/dim checkpatch eba8bfb1dc87535362e28de282addc8752204df4 drm-intel
f0e788e5c iosys-map: Rename locals used inside macros
-:50: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'map__' - possible side-effects?
#50: FILE: include/linux/iosys-map.h:394:
+#define iosys_map_rd(map__, offset__, type__) ({					\
+	type__ val_;									\
+	if ((map__)->is_iomem) {							\
+		__iosys_map_rd_io(val_, (map__)->vaddr_iomem + (offset__), type__);	\
+	} else {									\
+		__iosys_map_rd_sys(val_, (map__)->vaddr + (offset__), type__);		\
+	}										\
+	val_;										\
 })

-:50: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'offset__' - possible side-effects?
#50: FILE: include/linux/iosys-map.h:394:
+#define iosys_map_rd(map__, offset__, type__) ({					\
+	type__ val_;									\
+	if ((map__)->is_iomem) {							\
+		__iosys_map_rd_io(val_, (map__)->vaddr_iomem + (offset__), type__);	\
+	} else {									\
+		__iosys_map_rd_sys(val_, (map__)->vaddr + (offset__), type__);		\
+	}										\
+	val_;										\
 })

-:50: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'type__' - possible side-effects?
#50: FILE: include/linux/iosys-map.h:394:
+#define iosys_map_rd(map__, offset__, type__) ({					\
+	type__ val_;									\
+	if ((map__)->is_iomem) {							\
+		__iosys_map_rd_io(val_, (map__)->vaddr_iomem + (offset__), type__);	\
+	} else {									\
+		__iosys_map_rd_sys(val_, (map__)->vaddr + (offset__), type__);		\
+	}										\
+	val_;										\
 })

-:72: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'map__' - possible side-effects?
#72: FILE: include/linux/iosys-map.h:416:
+#define iosys_map_wr(map__, offset__, type__, val__) ({					\
+	type__ val_ = (val__);								\
+	if ((map__)->is_iomem) {							\
+		__iosys_map_wr_io(val_, (map__)->vaddr_iomem + (offset__), type__);	\
+	} else {									\
+		__iosys_map_wr_sys(val_, (map__)->vaddr + (offset__), type__);		\
+	}										\
 })

-:72: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'offset__' - possible side-effects?
#72: FILE: include/linux/iosys-map.h:416:
+#define iosys_map_wr(map__, offset__, type__, val__) ({					\
+	type__ val_ = (val__);								\
+	if ((map__)->is_iomem) {							\
+		__iosys_map_wr_io(val_, (map__)->vaddr_iomem + (offset__), type__);	\
+	} else {									\
+		__iosys_map_wr_sys(val_, (map__)->vaddr + (offset__), type__);		\
+	}										\
 })

-:72: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'type__' - possible side-effects?
#72: FILE: include/linux/iosys-map.h:416:
+#define iosys_map_wr(map__, offset__, type__, val__) ({					\
+	type__ val_ = (val__);								\
+	if ((map__)->is_iomem) {							\
+		__iosys_map_wr_io(val_, (map__)->vaddr_iomem + (offset__), type__);	\
+	} else {									\
+		__iosys_map_wr_sys(val_, (map__)->vaddr + (offset__), type__);		\
+	}										\
 })

total: 0 errors, 0 warnings, 6 checks, 76 lines checked




More information about the Intel-xe mailing list