fix compile error
PATCH 1/1 fix compile error
In non-debug build ASSERT_UNREACHABLE is nop and some compilers will complain that cbm_code/cbm_data may be used uninitialized in function psr_set_l3_cbm. Add return after ASSERT_UNREACHABLE to fix it.
Signed-off-by He Chen <[email protected]>
--- xen/arch/x86/psr.c | 1 + 1 file changed, 1 insertion(+)
xen/arch/x86/psr.c +1 -0
@@ -477,6 +477,7 @@ int psr_set_l3_cbm(struct domain *d, unsigned int socket,default :ASSERT_UNREACHABLE (); +return ; }spin_lock (&info->cbm_lock);
Signature · 1 line
1.9.1
Quoted 14 lines · He Chen
In non-debug build
ASSERT_UNREACHABLEis nop and some compilers will complain that cbm_code/cbm_data may be used uninitialized in functionpsr_set_l3_cbm. Add return afterASSERT_UNREACHABLEto fix it.Signed-off-by He Chen <[email protected]>--- xen/arch/x86/psr.c | 1 + 1 file changed, 1 insertion(+)xen/arch/x86/psr.c +0
-0
xen/arch/x86/psr.c int psr_set_l3_cbm(struct domain *d, unsigned int socket, · line 480
Quoted 4 lines
xen/arch/x86/psr.c +1
-0@@ -477,6 +477,7 @@ int psr_set_l3_cbm(struct domain *d, unsigned int socket,default :ASSERT_UNREACHABLE (); +return ;
This won't work because this function should return an int.
Wei.
Quoted 5 lines
xen/arch/x86/psr.c +0
-0}spin_lock (&info->cbm_lock);Signature · 1 line
1.9.1
Am 16.10.2015 um 12:15 schrieb Wei Liu:
Quoted 2 lines · He Chen
Quoted 1 line
In non-debug build
ASSERT_UNREACHABLEis nop and some compilers will
<friday>Should be "all compilers"</friday>
;-)
Olaf