[PATCH] drm/amdkfd: Cast atomic64_read return value

Michel Dänzer michel at daenzer.net
Mon Sep 13 16:18:12 UTC 2021


On 2021-09-13 17:19, Felix Kuehling wrote:
> Am 2021-09-13 um 10:19 a.m. schrieb Michel Dänzer:
>> From: Michel Dänzer <mdaenzer at redhat.com>
>>
>> Avoids warning with -Wformat:
>>
>>   CC [M]  drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_smi_events.o
>> ../drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_smi_events.c: In function ‘kfd_smi_event_update_thermal_throttling’:
>> ../drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_smi_events.c:224:60: warning: format ‘%llx’ expects argument of type
>>  ‘long long unsigned int’, but argument 6 has type ‘long int’ [-Wformat=]
>>   224 |         len = snprintf(fifo_in, sizeof(fifo_in), "%x %x:%llx\n",
>>       |                                                         ~~~^
>>       |                                                            |
>>       |                                                            long long unsigned int
>>       |                                                         %lx
>>   225 |                        KFD_SMI_EVENT_THERMAL_THROTTLE, throttle_bitmask,
>>   226 |                        atomic64_read(&adev->smu.throttle_int_counter));
>>       |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>       |                        |
>>       |                        long int
> 
> That's weird. As far as I can see, atomic64_read is defined to return
> s64, which should be the same as long long. Which architecture are you
> on?

This was from a 64-bit powerpc build. atomic64_read returns long there.


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


More information about the amd-gfx mailing list