[PATCH] drm/amdkfd: Fix "-Wmisleading-indentation" warning

Michel Dänzer michel at daenzer.net
Wed Mar 6 08:53:31 UTC 2019


On 2019-03-05 8:28 p.m., sunpeng.li at amd.com wrote:
> From: Leo Li <sunpeng.li at amd.com>
> 
> The following warning is seen during compile:
> 
> ./include/linux/idr.h:212:2: warning: this ‘for’ clause does not
> guard... [-Wmisleading-indentation]
>   for ((entry) = idr_get_next((idr), &(id));   \
>   ^
> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_events.c:1038:3: note: in
> expansion of macro ‘idr_for_each_entry_continue’
>    idr_for_each_entry_continue(&p->event_idr, ev, id)
>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_events.c:1043:4: note: ...this
> statement, but the latter is misleadingly indented as if it were guarded
> by the ‘for’
>     if (ev->type == KFD_EVENT_TYPE_MEMORY &&
>     ^~
> 
> Place braces around the indented block, as seemingly intended.
> 
> Signed-off-by: Leo Li <sunpeng.li at amd.com>

Thanks Leo, but I already sent a fix for this:

https://patchwork.freedesktop.org/patch/290410/


-- 
Earthling Michel Dänzer               |              https://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the amd-gfx mailing list