linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Clang warning in drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@ 2019-03-20  0:54 Nathan Chancellor
  2019-03-20  1:31 ` Pan, Xinhui
  0 siblings, 1 reply; 9+ messages in thread
From: Nathan Chancellor @ 2019-03-20  0:54 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David (ChunMing) Zhou, xinhui pan
  Cc: amd-gfx, dri-devel, linux-kernel, clang-built-linux

Hi all,

The introduction of this file in commit dbd249c24427 ("drm/amdgpu: add
amdgpu_ras.c to support ras (v2)") introduces the following Clang
warnings:

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:544:23: warning: implicit conversion from enumeration type 'enum amdgpu_ras_block' to different enumeration type 'enum ta_ras_block' [-Wenum-conversion]
                        .block_id =  head->block,
                                     ~~~~~~^~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:545:24: warning: implicit conversion from enumeration type 'enum amdgpu_ras_error_type' to different enumeration type 'enum ta_ras_error_type' [-Wenum-conversion]
                        .error_type = head->type,
                                      ~~~~~~^~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:549:23: warning: implicit conversion from enumeration type 'enum amdgpu_ras_block' to different enumeration type 'enum ta_ras_block' [-Wenum-conversion]
                        .block_id =  head->block,
                                     ~~~~~~^~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:550:24: warning: implicit conversion from enumeration type 'enum amdgpu_ras_error_type' to different enumeration type 'enum ta_ras_error_type' [-Wenum-conversion]
                        .error_type = head->type,
                                      ~~~~~~^~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:650:26: warning: implicit conversion from enumeration type 'enum amdgpu_ras_block' to different enumeration type 'enum ta_ras_block' [-Wenum-conversion]
                .block_id = info->head.block,
                            ~~~~~~~~~~~^~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:651:35: warning: implicit conversion from enumeration type 'enum amdgpu_ras_error_type' to different enumeration type 'enum ta_ras_error_type' [-Wenum-conversion]
                .inject_error_type = info->head.type,
                                     ~~~~~~~~~~~^~~~
6 warnings generated.

Normally, I would sent a fix for this myself but I am not entirely sure
why these two enumerated types exist when one would do since they have
the same values minus the prefix. In fact, the ta_ras_{block,error_type}
values are never used aside from being defined. Some clarification would
be appreciated.

Thank you,
Nathan

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-03-21  6:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-20  0:54 Clang warning in drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c Nathan Chancellor
2019-03-20  1:31 ` Pan, Xinhui
2019-03-20  4:34   ` Nathan Chancellor
2019-03-20  9:37     ` Koenig, Christian
     [not found]       ` <CAAzmS6_LL1bveq0HaHMqE-T2ciuZu=zd4HOFfwW99P1n0cmakA@mail.gmail.com>
2019-03-20 15:32         ` Stephen Hines
2019-03-20 15:44         ` Nathan Chancellor
2019-03-21  6:58           ` Pan, Xinhui
2019-03-20 17:19       ` Nick Desaulniers
2019-03-21  4:44         ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).