Blob Blame History Raw
From 6cd1f9b40a3a74c67f9a9dc1b81cbe99900f1bf7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Thu, 9 Sep 2021 18:56:28 +0200
Subject: drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: 6cd1f9b40a3a74c67f9a9dc1b81cbe99900f1bf7
Patch-mainline: v5.16-rc1
References: git-fixes

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>
Signed-off-by: Patrik Jakobsson <pjakobsson@suse.de>
---
 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(-)

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
@@ -615,7 +615,7 @@
 	return ret == num ? 0 : -EIO;
 }
 
-inline uint32_t amdgpu_ras_eeprom_get_record_max_length(void)
+uint32_t amdgpu_ras_eeprom_get_record_max_length(void)
 {
 	return EEPROM_MAX_RECORD_NUM;
 }
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
@@ -87,7 +87,7 @@
 					    bool write,
 					    int num);
 
-inline uint32_t amdgpu_ras_eeprom_get_record_max_length(void);
+uint32_t amdgpu_ras_eeprom_get_record_max_length(void);
 
 void amdgpu_ras_eeprom_test(struct amdgpu_ras_eeprom_control *control);