xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 for staging] fix compile error
@ 2015-10-16 10:16 He Chen
  2015-10-16 10:48 ` Julien Grall
  0 siblings, 1 reply; 2+ messages in thread
From: He Chen @ 2015-10-16 10:16 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>
---
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(+)

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 -EINVAL;
     }
 
     spin_lock(&info->cbm_lock);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 for staging] fix compile error
  2015-10-16 10:16 [PATCH v2 for staging] fix compile error He Chen
@ 2015-10-16 10:48 ` Julien Grall
  0 siblings, 0 replies; 2+ messages in thread
From: Julien Grall @ 2015-10-16 10:48 UTC (permalink / raw)
  To: He Chen, xen-devel
  Cc: Olaf Hering, Keir Fraser, Andrew Cooper, Jan Beulich, Chao Peng,
	Wei Liu

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"

On 16/10/15 11:16, 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>
> ---
> 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(+)
> 
> 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 -EINVAL;
>      }
>  
>      spin_lock(&info->cbm_lock);
> 


-- 
Julien Grall

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-16 10:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16 10:16 [PATCH v2 for staging] fix compile error He Chen
2015-10-16 10:48 ` Julien Grall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).