[PATCH 1/2] x86/MCE/AMD: Export smca_get_bank_type()

From: Ghannam, Yazen
Date: Thu Mar 07 2019 - 16:26:09 EST


From: Yazen Ghannam <yazen.ghannam@xxxxxxx>

Export the smca_get_bank_type() function so it can be used in the AMD
MCE decoder module.

Cc: <stable@xxxxxxxxxxxxxxx> # 4.14.x
Signed-off-by: Yazen Ghannam <yazen.ghannam@xxxxxxx>
---
arch/x86/include/asm/mce.h | 1 +
arch/x86/kernel/cpu/mce/amd.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index 22d05e3835f0..605b46fde1ee 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -340,6 +340,7 @@ struct smca_bank {
extern struct smca_bank smca_banks[MAX_NR_BANKS];

extern const char *smca_get_long_name(enum smca_bank_types t);
+extern enum smca_bank_types smca_get_bank_type(unsigned int bank);
extern bool amd_mce_is_memory_error(struct mce *m);

extern int mce_threshold_create_device(unsigned int cpu);
diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c
index e64de5149e50..041bb800cda8 100644
--- a/arch/x86/kernel/cpu/mce/amd.c
+++ b/arch/x86/kernel/cpu/mce/amd.c
@@ -123,7 +123,7 @@ const char *smca_get_long_name(enum smca_bank_types t)
}
EXPORT_SYMBOL_GPL(smca_get_long_name);

-static enum smca_bank_types smca_get_bank_type(unsigned int bank)
+enum smca_bank_types smca_get_bank_type(unsigned int bank)
{
struct smca_bank *b;

@@ -136,6 +136,7 @@ static enum smca_bank_types smca_get_bank_type(unsigned int bank)

return b->hwid->bank_type;
}
+EXPORT_SYMBOL_GPL(smca_get_bank_type);

static struct smca_hwid smca_hwid_mcatypes[] = {
/* { bank_type, hwid_mcatype, xec_bitmap } */
--
2.17.1