]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/amdkfd: Add format attribute to kfd_smi_event_add
authorPhilip Yang <Philip.Yang@amd.com>
Fri, 4 Mar 2022 14:33:27 +0000 (09:33 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Mar 2022 19:59:59 +0000 (14:59 -0500)
To enable compiler type-checked against the format string in callers.

All warnings (new ones prefixed by >>):

>> warning: function 'kfd_smi_event_add' might be a candidate for
'gnu_printf' format attribute [-Wsuggest-attribute=format]

Fixes: d58b8a99cbb8 ("drm/amdkfd: Add SMI add event helper")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c

index bba8d9692a4cad5eabfec2af9309c327cd14bc6d..e4beebb1c80a21ed62b5c0abca0a373aed9bce35 100644 (file)
@@ -176,6 +176,7 @@ static void add_event_to_kfifo(struct kfd_dev *dev, unsigned int smi_event,
        rcu_read_unlock();
 }
 
+__printf(3, 4)
 static void kfd_smi_event_add(struct kfd_dev *dev, unsigned int event,
                              char *fmt, ...)
 {