[PATCH i-g-t 2/2] lib/xe/xe_query: Fix compilation -Wshadow warning

Kumar, Janga Rahul janga.rahul.kumar at intel.com
Wed Jan 17 09:43:33 UTC 2024



> -----Original Message-----
> From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Nirmoy
> Das
> Sent: Tuesday, January 16, 2024 8:14 PM
> To: igt-dev at lists.freedesktop.org
> Cc: Das, Nirmoy <nirmoy.das at intel.com>
> Subject: [PATCH i-g-t 2/2] lib/xe/xe_query: Fix compilation -Wshadow warning
> 
> Fix -Wshadow warning when xe_for_each_engine() and
> xe_for_each_mem_region are used together.
> 
> Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
Reviewed-by: Janga Rahul Kumar <janga.rahul.kumar at intel.com>
> ---
>  lib/xe/xe_query.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/xe/xe_query.h b/lib/xe/xe_query.h index 1e3a7bdb9..032db1308
> 100644
> --- a/lib/xe/xe_query.h
> +++ b/lib/xe/xe_query.h
> @@ -67,8 +67,8 @@ struct xe_device {
>  	for (__gt = 0; __gt < xe_number_gt(__fd); ++__gt)
> 
>  #define xe_for_each_mem_region(__fd, __memreg, __r) \
> -	for (uint64_t __i = 0; __i < igt_fls(__memreg); __i++) \
> -		for_if(__r = (__memreg & (1ull << __i)))
> +	for (uint64_t __j = 0; __j < igt_fls(__memreg); __j++) \
> +		for_if(__r = (__memreg & (1ull << __j)))
> 
>  #define XE_IS_CLASS_SYSMEM(__region) ((__region)->mem_class ==
> DRM_XE_MEM_REGION_CLASS_SYSMEM)  #define
> XE_IS_CLASS_VRAM(__region) ((__region)->mem_class ==
> DRM_XE_MEM_REGION_CLASS_VRAM)
> --
> 2.42.0



More information about the igt-dev mailing list