Skip to contentSkip to conversation

drm/amdkfd: Cast atomic64_read return value

PATCH New Michel Dänzer 1 participant 1 message Sep 13, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: Cast atomic64_read return value

From: Michel Dänzer <[email protected]>

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
---
 drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c +1 -1
index ed4bc5f844ce..46e1c0cda94c 100644
@@ -223,7 +223,7 @@ void kfd_smi_event_update_thermal_throttling(struct kfd_dev *dev,
 
 	len = snprintf(fifo_in, sizeof(fifo_in), "%x %llx:%llx\n",
 		       KFD_SMI_EVENT_THERMAL_THROTTLE, throttle_bitmask,
-		       atomic64_read(&adev->smu.throttle_int_counter));
+		       (u64)atomic64_read(&adev->smu.throttle_int_counter));
 
 	add_event_to_kfifo(dev, KFD_SMI_EVENT_THERMAL_THROTTLE,	fifo_in, len);
 }
Signature · 1 line
2.33.0