drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count
Subsystems (2)
PATCH 1/1 drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count
From: Michel Dänzer <[email protected]>
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();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# The function is called amdgpu_ras_eeprom_get_record_max_length on
# stable branches Fixes: c84d46707ebb "drm/amdgpu: validate bad page threshold in ras(v3)" Signed-off-by: Michel Dänzer <[email protected]> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +1 -1
@@ -756,7 +756,7 @@ int amdgpu_ras_eeprom_read(struct amdgpu_ras_eeprom_control *control,return res; } -inline uint32_t amdgpu_ras_eeprom_max_record_count (void ) +uint32_t amdgpu_ras_eeprom_max_record_count (void ) {return RAS_MAX_RECORD_COUNT ; }
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h +1 -1
@@ -120,7 +120,7 @@ int amdgpu_ras_eeprom_read(struct amdgpu_ras_eeprom_control *control,int amdgpu_ras_eeprom_append (struct amdgpu_ras_eeprom_control *control,struct eeprom_table_record *records,const u32 num); -inline uint32_t amdgpu_ras_eeprom_max_record_count (void ); +uint32_t amdgpu_ras_eeprom_max_record_count (void );void amdgpu_ras_debugfs_set_ret_size (struct amdgpu_ras_eeprom_control *control);
Signature · 1 line
2.33.0
Quoted 66 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
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 | inlineuint32_tamdgpu_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();
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# The function is called
amdgpu_ras_eeprom_get_record_max_lengthon# stable branches Fixes: c84d46707ebb "drm/amdgpu: validate bad page threshold in ras(v3)" Signed-off-by: Michel Dänzer <[email protected]> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +0
-0@@ -756,7 +756,7 @@ int amdgpu_ras_eeprom_read(structamdgpu_ras_eeprom_control *control, return res; }drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +1
-1-inline uint32_t amdgpu_ras_eeprom_max_record_count (void ) +uint32_t amdgpu_ras_eeprom_max_record_count (void ){
returnRAS_MAX_RECORD_COUNT;
}drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h +0
-0@@ -120,7 +120,7 @@ int amdgpu_ras_eeprom_read(struct amdgpu_ras_eeprom_control *control, int amdgpu_ras_eeprom_append(struct amdgpu_ras_eeprom_control *control,struct
eeprom_table_record*records, const u32 num);drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h +1
-1-inline uint32_t amdgpu_ras_eeprom_max_record_count (void ); +uint32_t amdgpu_ras_eeprom_max_record_count (void );
voidamdgpu_ras_debugfs_set_ret_size(struct amdgpu_ras_eeprom_control *control);
Signature · 3 lines
Cheers, Lyude Paul (she/her) Software Engineer at Red Hat
Alex Deucher
AppliedApplied. Thanks!
Alex
Quoted 76 lines · Lyude Paul
Reviewed-by Lyude Paul <[email protected]>Quoted 63 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
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
available90 | 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(); |^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# The function is called
amdgpu_ras_eeprom_get_record_max_lengthon# stable branches Fixes: c84d46707ebb "drm/amdgpu: validate bad page threshold in ras(v3)" Signed-off-by: Michel Dänzer <[email protected]> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +1
-1@@ -756,7 +756,7 @@ int amdgpu_ras_eeprom_read(structamdgpu_ras_eeprom_control *control, return res; } -inline uint32_t amdgpu_ras_eeprom_max_record_count (void ) +uint32_t amdgpu_ras_eeprom_max_record_count (void ) {return RAS_MAX_RECORD_COUNT ;}
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h +1
-1@@ -120,7 +120,7 @@ int amdgpu_ras_eeprom_read(structamdgpu_ras_eeprom_control *control, int amdgpu_ras_eeprom_append(struct amdgpu_ras_eeprom_control *control,struct eeprom_table_record *records,const u32 num); -inline uint32_t amdgpu_ras_eeprom_max_record_count (void ); +uint32_t amdgpu_ras_eeprom_max_record_count (void );Quoted 3 lines
void amdgpu_ras_debugfs_set_ret_size(struct
amdgpu_ras_eeprom_control
*control);--
Cheers,
Lyude Paul (she/her)
Software Engineer at Red Hat