[PATCH] drm/amdgpu: Mark mmhub_v1_8_mmea_err_status_reg as __maybe_unused

Luben Tuikov luben.tuikov at amd.com
Thu May 25 16:45:13 UTC 2023


On 2023-05-25 12:29, Nathan Chancellor wrote:
> On Thu, May 25, 2023 at 12:26:56PM -0400, Luben Tuikov wrote:
>> On 2023-05-25 11:22, Nathan Chancellor wrote:
>>> On Fri, May 19, 2023 at 06:14:38PM +0530, Srinivasan Shanmugam wrote:
>>>> Silencing the compiler from below compilation error:
>>>>
>>>> drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c:704:23: error: variable 'mmhub_v1_8_mmea_err_status_reg' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
>>>> static const uint32_t mmhub_v1_8_mmea_err_status_reg[] = {
>>>>                       ^
>>>> 1 error generated.
>>>>
>>>> Mark the variable as __maybe_unused to make it clear to clang that this
>>>> is expected, so there is no more warning.
>>>>
>>>> Cc: Christian König <christian.koenig at amd.com>
>>>> Cc: Lijo Lazar <lijo.lazar at amd.com>
>>>> Cc: Luben Tuikov <luben.tuikov at amd.com>
>>>> Cc: Alex Deucher <alexander.deucher at amd.com>
>>>> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
>>>
>>> Traditionally, this attribute would go between the [] and =, but that is
>>> a nit. Can someone please pick this up to unblock our builds on -next?
>>>
>>> Reviewed-by: Nathan Chancellor <nathan at kernel.org>
>>
>> I'll pick this up, fix it, and submit to amd-staging-drm-next.
> 
> Thanks a lot :)
> 
>> Which -next are you referring to, Nathan?
> 
> linux-next, this warning breaks the build when -Werror is enabled, such
> as with allmodconfig:
> 
> https://storage.tuxsuite.com/public/clangbuiltlinux/continuous-integration2/builds/2QHtlCTz2JL0yXNpRB5hVmiP9lq/build.log
> 

Hi Nathan,

Thanks for the pointers.

Srinivasan has already submitted it to amd-staging-drm-next.

Seems Alex will push it upstream.

Not sure who fast you need it, we can send you the commit itself
for you to git-am if you cannot wait.

Regards,
Luben

> Cheers,
> Nathan
> 
>>>> ---
>>>>  drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c | 1 +
>>>>  1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
>>>> index 3648994724c2..cba087e529c0 100644
>>>> --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
>>>> +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
>>>> @@ -701,6 +701,7 @@ static void mmhub_v1_8_reset_ras_error_count(struct amdgpu_device *adev)
>>>>  		mmhub_v1_8_inst_reset_ras_error_count(adev, i);
>>>>  }
>>>>  
>>>> +__maybe_unused
>>>>  static const uint32_t mmhub_v1_8_mmea_err_status_reg[] = {
>>>>  	regMMEA0_ERR_STATUS,
>>>>  	regMMEA1_ERR_STATUS,
>>>> -- 
>>>> 2.25.1
>>>>
>>



More information about the amd-gfx mailing list