* [PATCH for staging] fix compile error
@ 2015-10-16 10:03 He Chen
2015-10-16 10:15 ` Wei Liu
0 siblings, 1 reply; 3+ messages in thread
From: He Chen @ 2015-10-16 10:03 UTC (permalink / raw)
To: xen-devel
Cc: Olaf Hering, Keir Fraser, Andrew Cooper, Jan Beulich, Chao Peng,
Wei Liu
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 <he.chen@linux.intel.com>
---
xen/arch/x86/psr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index d3dec3a..c5bdfce 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -477,6 +477,7 @@ int psr_set_l3_cbm(struct domain *d, unsigned int socket,
default:
ASSERT_UNREACHABLE();
+ return;
}
spin_lock(&info->cbm_lock);
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH for staging] fix compile error
2015-10-16 10:03 [PATCH for staging] fix compile error He Chen
@ 2015-10-16 10:15 ` Wei Liu
2015-10-16 10:17 ` Olaf Hering
0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2015-10-16 10:15 UTC (permalink / raw)
To: He Chen
Cc: Wei Liu, Olaf Hering, Keir Fraser, Andrew Cooper, Jan Beulich,
Chao Peng, xen-devel
On Fri, Oct 16, 2015 at 06:03:36PM +0800, He Chen wrote:
> 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 <he.chen@linux.intel.com>
> ---
> xen/arch/x86/psr.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
> index d3dec3a..c5bdfce 100644
> --- a/xen/arch/x86/psr.c
> +++ b/xen/arch/x86/psr.c
> @@ -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.
> }
>
> spin_lock(&info->cbm_lock);
> --
> 1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH for staging] fix compile error
2015-10-16 10:15 ` Wei Liu
@ 2015-10-16 10:17 ` Olaf Hering
0 siblings, 0 replies; 3+ messages in thread
From: Olaf Hering @ 2015-10-16 10:17 UTC (permalink / raw)
To: He Chen; +Cc: xen-devel, Keir Fraser, Chao Peng, Jan Beulich, Andrew Cooper
Am 16.10.2015 um 12:15 schrieb Wei Liu:
> On Fri, Oct 16, 2015 at 06:03:36PM +0800, He Chen wrote:
>> In non-debug build ASSERT_UNREACHABLE is nop and some compilers will
<friday>Should be "all compilers"</friday>
;-)
Olaf
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-16 10:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16 10:03 [PATCH for staging] fix compile error He Chen
2015-10-16 10:15 ` Wei Liu
2015-10-16 10:17 ` Olaf Hering
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.