Julien Grall
2013-Jul-15 14:24 UTC
[PATCH] xen/control: protect functions with CONFIG_HIBERNATE_CALLBACKS to avoid warning
If CONFIG_HIBERNATE_CALLBACKS is not set gcc will issue warnings: drivers/xen/manage.c:46:13: warning: ''xen_hvm_post_suspend'' defined but not used [-Wunused-function] drivers/xen/manage.c:52:13: warning: ''xen_pre_suspend'' defined but not used [-Wunused-function] drivers/xen/manage.c:59:13: warning: ''xen_post_suspend'' defined but not used [-Wunused-function] Signed-off-by: Julien Grall <julien.grall@linaro.org> --- drivers/xen/manage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 412b96c..7680276 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c @@ -36,6 +36,7 @@ enum shutdown_state { /* Ignore multiple shutdown requests. */ static enum shutdown_state shutting_down = SHUTDOWN_INVALID; +#ifdef CONFIG_HIBERNATE_CALLBACKS struct suspend_info { int cancelled; unsigned long arg; /* extra hypercall argument */ @@ -63,7 +64,6 @@ static void xen_post_suspend(int cancelled) xen_mm_unpin_all(); } -#ifdef CONFIG_HIBERNATE_CALLBACKS static int xen_suspend(void *data) { struct suspend_info *si = data; -- 1.7.10.4
Konrad Rzeszutek Wilk
2013-Jul-15 15:27 UTC
Re: [PATCH] xen/control: protect functions with CONFIG_HIBERNATE_CALLBACKS to avoid warning
On Mon, Jul 15, 2013 at 03:24:35PM +0100, Julien Grall wrote:> If CONFIG_HIBERNATE_CALLBACKS is not set gcc will issue warnings: > drivers/xen/manage.c:46:13: warning: 'xen_hvm_post_suspend' defined but not used [-Wunused-function] > drivers/xen/manage.c:52:13: warning: 'xen_pre_suspend' defined but not used [-Wunused-function] > drivers/xen/manage.c:59:13: warning: 'xen_post_suspend' defined but not used [-Wunused-function]Have you checked the upstream kernel? I see this: commit 65e053a7038c608f89272d4fb1f899890c579f0a Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Date: Thu Jun 27 14:28:38 2013 +0100 xen: ifdef CONFIG_HIBERNATE_CALLBACKS xen_*_suspend xen_hvm_post_suspend, xen_pre_suspend, xen_post_suspend are only used if CONFIG_HIBERNATE_CALLBACKS is defined, resulting in: drivers/xen/manage.c:46:13: warning: ‘xen_hvm_post_suspend’ defined but not used [-Wunused-function] drivers/xen/manage.c:52:13: warning: ‘xen_pre_suspend’ defined but not used [-Wunused-function] drivers/xen/manage.c:59:13: warning: ‘xen_post_suspend’ defined but not used [-Wunused-function] If the kernel config is missing CONFIG_HIBERNATE_CALLBACKS. Simply ifdef CONFIG_HIBERNATE_CALLBACKS the three functions. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>> > Signed-off-by: Julien Grall <julien.grall@linaro.org> > --- > drivers/xen/manage.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c > index 412b96c..7680276 100644 > --- a/drivers/xen/manage.c > +++ b/drivers/xen/manage.c > @@ -36,6 +36,7 @@ enum shutdown_state { > /* Ignore multiple shutdown requests. */ > static enum shutdown_state shutting_down = SHUTDOWN_INVALID; > > +#ifdef CONFIG_HIBERNATE_CALLBACKS > struct suspend_info { > int cancelled; > unsigned long arg; /* extra hypercall argument */ > @@ -63,7 +64,6 @@ static void xen_post_suspend(int cancelled) > xen_mm_unpin_all(); > } > > -#ifdef CONFIG_HIBERNATE_CALLBACKS > static int xen_suspend(void *data) > { > struct suspend_info *si = data; > -- > 1.7.10.4 >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Julien Grall
2013-Jul-15 15:47 UTC
Re: [PATCH] xen/control: protect functions with CONFIG_HIBERNATE_CALLBACKS to avoid warning
On 07/15/2013 04:27 PM, Konrad Rzeszutek Wilk wrote:> On Mon, Jul 15, 2013 at 03:24:35PM +0100, Julien Grall wrote: >> If CONFIG_HIBERNATE_CALLBACKS is not set gcc will issue warnings: >> drivers/xen/manage.c:46:13: warning: ''xen_hvm_post_suspend'' defined but not used [-Wunused-function] >> drivers/xen/manage.c:52:13: warning: ''xen_pre_suspend'' defined but not used [-Wunused-function] >> drivers/xen/manage.c:59:13: warning: ''xen_post_suspend'' defined but not used [-Wunused-function] > > Have you checked the upstream kernel?My apologies, I forgot to check upstream for this patch. -- Julien
Julien Grall
2013-Jul-15 15:49 UTC
Re: [PATCH] xen/control: protect functions with CONFIG_HIBERNATE_CALLBACKS to avoid warning
Forgot the different cc. On 07/15/2013 04:47 PM, Julien Grall wrote:> On 07/15/2013 04:27 PM, Konrad Rzeszutek Wilk wrote: >> On Mon, Jul 15, 2013 at 03:24:35PM +0100, Julien Grall wrote: >>> If CONFIG_HIBERNATE_CALLBACKS is not set gcc will issue warnings: >>> drivers/xen/manage.c:46:13: warning: ''xen_hvm_post_suspend'' defined but not used [-Wunused-function] >>> drivers/xen/manage.c:52:13: warning: ''xen_pre_suspend'' defined but not used [-Wunused-function] >>> drivers/xen/manage.c:59:13: warning: ''xen_post_suspend'' defined but not used [-Wunused-function] >> >> Have you checked the upstream kernel? > > My apologies, I forgot to check upstream for this patch. >
Apparently Analagous Threads
- [PATCH 3/4] xen/manage: Guard against user-space initiated poweroff and XenBus.
- [GIT PULL stable-2.6.32.x] PV on HVM fixes
- [PATCH] xen: wrap load_cr3() in manage.c for ia64 support.
- [PATCH] libxc/arm: align to page size the base address of the device tree
- [PATCH] xen/arm: Allow balooning working with 1:1 memory mapping