apic, x86: Need to set offset before using it
PATCH 1/1 apic, x86: Need to set offset before using it
--- arch/x86/oprofile/op_model_amd.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
arch/x86/oprofile/op_model_amd.c +1 -2
@@ -285,6 +285,7 @@ static inline int ibs_eilvt_valid(void)int offset;rdmsrl (MSR_AMD64_IBSCTL , val); + offset = val &IBSCTL_LVT_OFFSET_MASK ;if (!(val &IBSCTL_LVT_OFFSET_VALID )) { pr_err(FW_BUG "cpu %d, invalid IBS " "interrupt offset %d (MSR%08X=0x%016llx)",
@@ -293,8 +294,6 @@ static inline int ibs_eilvt_valid(void)return 0 ; } - offset = val &IBSCTL_LVT_OFFSET_MASK ; -if (eilvt_is_available (offset))return !0 ;
Signature · 1 line
1.7.2.3
PATCH v2 1/1 apic, x86: Need to set offset before using it
Fix the issue pointed by Stephen.
Stephen Rothwell wrote :
In building Linus' tree, today's linux-next build (x86_64 allmodconfig) produced this warning:
arch/x86/oprofile/op_model_amd.c: In function 'ibs_eilvt_valid':arch/x86/oprofile/op_model_amd.c:289: warning: 'offset' may be used uninitialized in this function
--- arch/x86/oprofile/op_model_amd.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
arch/x86/oprofile/op_model_amd.c +1 -2
@@ -285,6 +285,7 @@ static inline int ibs_eilvt_valid(void)int offset;rdmsrl (MSR_AMD64_IBSCTL , val); + offset = val &IBSCTL_LVT_OFFSET_MASK ;if (!(val &IBSCTL_LVT_OFFSET_VALID )) { pr_err(FW_BUG "cpu %d, invalid IBS " "interrupt offset %d (MSR%08X=0x%016llx)",
@@ -293,8 +294,6 @@ static inline int ibs_eilvt_valid(void)return 0 ; } - offset = val &IBSCTL_LVT_OFFSET_MASK ; -if (eilvt_is_available (offset))return !0 ;
Signature · 1 line
1.7.2.3
Quoted 30 lines · Jaswinder Singh
Fix the issue pointed by Stephen.
Stephen Rothwell wrote :
In building Linus' tree, today's linux-next build (x86_64allmodconfig) produced this warning:
arch/x86/oprofile/op_model_amd.c: In function 'ibs_eilvt_valid':arch/x86/oprofile/op_model_amd.c:289: warning: 'offset' may be used uninitialized in this functionSigned-off-by Jaswinder Singh Rajput <[email protected]>Reported-by Stephen Rothwell <[email protected]>Cc Robert Richter <[email protected]>Cc Ingo Molnar <[email protected]>--- arch/x86/oprofile/op_model_amd.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)arch/x86/oprofile/op_model_amd.c +1
-0@@ -285,6 +285,7 @@ static inline int ibs_eilvt_valid(void)int offset;rdmsrl (MSR_AMD64_IBSCTL , val); + offset = val &IBSCTL_LVT_OFFSET_MASK ;if (!(val &IBSCTL_LVT_OFFSET_VALID )) { pr_err(FW_BUG "cpu %d, invalid IBS " "interrupt offset %d (MSR%08X=0x%016llx)",
arch/x86/oprofile/op_model_amd.c static inline int ibs_eilvt_valid(void) · line 298
Quoted 7 lines
arch/x86/oprofile/op_model_amd.c +0
-2@@ -293,8 +294,6 @@ static inline int ibs_eilvt_valid(void)return 0 ; } - offset = val &IBSCTL_LVT_OFFSET_MASK ; -if (eilvt_is_available (offset))return !0 ;
I queued up a different fix, one which also address some of the structural details in this function.
Thanks,
Ingo