Skip to contentSkip to conversation

fix compile error

PATCH Superseded He Chen 3 participants 3 messages Oct 16, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

He Chen

author
#0 lore raw

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.

---
 xen/arch/x86/psr.c | 1 +
 1 file changed, 1 insertion(+)
xen/arch/x86/psr.c +1 -0
index d3dec3a..c5bdfce 100644
@@ -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
#1 lore raw
Quoted 14 lines · He Chen

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.

---
 xen/arch/x86/psr.c | 1 +
 1 file changed, 1 insertion(+)
xen/arch/x86/psr.c +0 -0
index d3dec3a..c5bdfce 100644

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
#2 lore raw

Am 16.10.2015 um 12:15 schrieb Wei Liu:

Quoted 2 lines · He Chen
Quoted 1 line

In non-debug build ASSERT_UNREACHABLE is nop and some compilers will

<friday>Should be "all compilers"</friday>
;-)

Olaf