Re: Clang warning in drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

2019-03-21 Thread Nick Desaulniers
On Wed, Mar 20, 2019 at 2:37 AM Koenig, Christian wrote: > > Am 20.03.19 um 05:34 schrieb Nathan Chancellor: > > On Wed, Mar 20, 2019 at 01:31:27AM +, Pan, Xinhui wrote: > >> these two enumerated types are same for now. both of them might change in > >> the future. Please consider if the YAG

Re: Clang warning in drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

2019-03-21 Thread Stephen Hines
Resending as plain-text to rest of list. Steve On Wed, Mar 20, 2019 at 7:58 AM Stephen Hines wrote: > > Why are there 2 different enums for this same thing at all? By casting, you > are reducing type safety in the kernel, which can cause bugs later (should > the two enums diverge in encoding).

Re: Clang warning in drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

2019-03-21 Thread Nathan Chancellor
On Wed, Mar 20, 2019 at 07:58:09AM -0700, Stephen Hines wrote: > Why are there 2 different enums for this same thing at all? By casting, you > are reducing type safety in the kernel, which can cause bugs later (should > the two enums diverge in encoding). In my opinion, the proper solution is > to

Re: Clang warning in drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

2019-03-21 Thread Stephen Hines
Why are there 2 different enums for this same thing at all? By casting, you are reducing type safety in the kernel, which can cause bugs later (should the two enums diverge in encoding). In my opinion, the proper solution is to remove one of the enums or provide an explicit helper that does the con

RE: Clang warning in drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

2019-03-20 Thread Pan, Xinhui
@lists.freedesktop.org; linux-ker...@vger.kernel.org; clang-built-li...@googlegroups.com Subject: Re: Clang warning in drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c On Wed, Mar 20, 2019 at 07:58:09AM -0700, Stephen Hines wrote: > Why are there 2 different enums for this same thing at all? By > casting, y

Re: Clang warning in drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

2019-03-20 Thread Alex Deucher
On Wed, Mar 20, 2019 at 4:49 PM Nick Desaulniers wrote: > > On Wed, Mar 20, 2019 at 2:37 AM Koenig, Christian > wrote: > > > > Am 20.03.19 um 05:34 schrieb Nathan Chancellor: > > > On Wed, Mar 20, 2019 at 01:31:27AM +, Pan, Xinhui wrote: > > >> these two enumerated types are same for now. bot

Re: Clang warning in drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

2019-03-20 Thread Koenig, Christian
Am 20.03.19 um 05:34 schrieb Nathan Chancellor: > On Wed, Mar 20, 2019 at 01:31:27AM +, Pan, Xinhui wrote: >> these two enumerated types are same for now. both of them might change in >> the future. >> >> I have not used clang, but would .block_id = (int)head->block fix your >> warning? If

Re: Clang warning in drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

2019-03-20 Thread Nathan Chancellor
On Wed, Mar 20, 2019 at 01:31:27AM +, Pan, Xinhui wrote: > these two enumerated types are same for now. both of them might change in the > future. > > I have not used clang, but would .block_id = (int)head->block fix your > warning? If such change is acceptable, I can make one then. > > T

RE: Clang warning in drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

2019-03-19 Thread Pan, Xinhui
these two enumerated types are same for now. both of them might change in the future. I have not used clang, but would .block_id = (int)head->block fix your warning? If such change is acceptable, I can make one then. Thanks xinhui -Original Message- From: Nathan Chancellor Sent: 2