@@ -351,7 +351,7 @@ extern int mce_threshold_create_device(unsigned int cpu);
extern int mce_threshold_remove_device(unsigned int cpu);
void mce_amd_feature_init(struct cpuinfo_x86 *c);
-int umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr);
+int umc_normaddr_to_sysaddr(u64 *addr, u16 nid, u8 umc);
#else
@@ -359,8 +359,7 @@ static inline int mce_threshold_create_device(unsigned int cpu) { return 0; };
static inline int mce_threshold_remove_device(unsigned int cpu) { return 0; };
static inline bool amd_mce_is_memory_error(struct mce *m) { return false; };
static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { }
-static inline int
-umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr) { return -EINVAL; };
+static inline int umc_normaddr_to_sysaddr(u64 *addr, u16 nid, u8 umc) { return -EINVAL; };
#endif
static inline void mce_hygon_feature_init(struct cpuinfo_x86 *c) { return mce_amd_feature_init(c); }
@@ -997,14 +997,14 @@ static int addr_over_limit(struct addr_ctx *ctx)
return 0;
}
-int umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr)
+int umc_normaddr_to_sysaddr(u64 *addr, u16 nid, u8 umc)
{
struct addr_ctx ctx;
memset(&ctx, 0, sizeof(ctx));
/* We start from the normalized address */
- ctx.ret_addr = norm_addr;
+ ctx.ret_addr = *addr;
ctx.nid = nid;
ctx.umc = umc;
@@ -1032,7 +1032,7 @@ int umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr)
if (addr_over_limit(&ctx))
return -EINVAL;
- *sys_addr = ctx.ret_addr;
+ *addr = ctx.ret_addr;
return 0;
}
EXPORT_SYMBOL_GPL(umc_normaddr_to_sysaddr);
@@ -2896,7 +2896,7 @@ static void decode_umc_error(int node_id, struct mce *m)
struct mem_ctl_info *mci;
struct amd64_pvt *pvt;
struct err_info err;
- u64 sys_addr;
+ u64 sys_addr = m->addr;
mci = edac_mc_find(node_id);
if (!mci)
@@ -2927,7 +2927,7 @@ static void decode_umc_error(int node_id, struct mce *m)
err.csrow = m->synd & 0x7;
- if (umc_normaddr_to_sysaddr(m->addr, pvt->mc_node_id, err.channel, &sys_addr)) {
+ if (umc_normaddr_to_sysaddr(&sys_addr, pvt->mc_node_id, err.channel)) {
err.err_code = ERR_NORM_ADDR;
goto log_error;
}