Skip to contentSkip to conversation

fix compile error

PATCH In review He Chen 2 participants 2 messages Oct 16, 2015

lore
Share & tools
lore

He Chen

author
#0 lore raw

PATCH v2 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.

---
Changes in v2:
Sorry for mistake in first version of this patch.
This is the correct patch.

---
 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 -EINVAL;
     }
 
     spin_lock(&info->cbm_lock);
Signature · 1 line
1.9.1
#1 lore raw

Hi,

"fix compiler error" is too vast. The commit title should be more meaningful. Something like:

"x86: psr: fix compilation on non-debug build after 44f126d"

Quoted 26 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.

---
Changes in v2:
Sorry for mistake in first version of this patch.
This is the correct patch.

---
 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 -EINVAL;
     }
 
     spin_lock(&info->cbm_lock);
Signature · 1 line
Julien Grall