Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count

This was unusual; normally, inline functions are declared static as
well, and defined in a header file if used by multiple compilation
units. The latter would be more involved in this case, so just drop
the inline declaration for now.

Fixes compile failure building for ppc64le on RHEL 8:

In file included from ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h:32,
from ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:33:
../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c: In function ‘amdgpu_ras_recovery_init’:
../drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h:90:17: error: inlining failed in call
to ‘always_inline’ ‘amdgpu_ras_eeprom_max_record_count’: function body not available
90 | inline uint32_t amdgpu_ras_eeprom_max_record_count(void);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1985:34: note: called from here
1985 | max_eeprom_records_len = amdgpu_ras_eeprom_max_record_count();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: c84d46707ebb "drm/amdgpu: validate bad page threshold in ras(v3)"
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Michel Dänzer and committed by
Alex Deucher
114518ff 8b514e89

+2 -2
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
··· 757 757 return res; 758 758 } 759 759 760 - inline uint32_t amdgpu_ras_eeprom_max_record_count(void) 760 + uint32_t amdgpu_ras_eeprom_max_record_count(void) 761 761 { 762 762 return RAS_MAX_RECORD_COUNT; 763 763 }
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
··· 120 120 int amdgpu_ras_eeprom_append(struct amdgpu_ras_eeprom_control *control, 121 121 struct eeprom_table_record *records, const u32 num); 122 122 123 - inline uint32_t amdgpu_ras_eeprom_max_record_count(void); 123 + uint32_t amdgpu_ras_eeprom_max_record_count(void); 124 124 125 125 void amdgpu_ras_debugfs_set_ret_size(struct amdgpu_ras_eeprom_control *control); 126 126