From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932173AbcEKNIa (ORCPT ); Wed, 11 May 2016 09:08:30 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:50707 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751605AbcEKNI3 (ORCPT ); Wed, 11 May 2016 09:08:29 -0400 From: Arnd Bergmann To: David Vrabel Cc: Ross Lagerwall , Arnd Bergmann , stable@vger.kernel.org, Boris Ostrovsky , Juergen Gross , Daniel Kiper , Julien Grall , Stefano Stabellini , Andrew Morton , Vitaly Kuznetsov , Paul Gortmaker , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: [PATCH] xen: remove incorrect forward declaration Date: Wed, 11 May 2016 15:07:42 +0200 Message-Id: <1462972075-918938-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:r6FTNa2w636jhXCm6u5wCUqLbNtCs83Tp1MyzeunhrZcMFKFePo cpSPpBzuKjeOzm5Zcp1OztKxIBv7ykIndd5stj0jM/ZoTTRgx1LXrnzKFBhGnr3OLdNujkJ 4HpSz8JOSxtwZoRJAiJ8RapeOp/UD3sk5iN/mtkD9Ip71X5CaaBi/sX5TQ5m1B5rP5Ns7aK Q5oIwRw3jSVODz+sw4dSg== X-UI-Out-Filterresults: notjunk:1;V01:K0:5Uar6yN0ddQ=:KLXGp3c5GrTxOo1QLmrbya kk8VrEdxnTRYwSVgdgqmMLaD8TPV1BFP3KMCczJjsdT0IuxtpINtvsxuKn7aUKHQInsUwGHZh xEPMJGtBCAb4ZkLsq7oTCl0oY21LEFAcpoMML0DDW3OS61emg+z8rjE3Ql12Pi7xYuUIVdWWc t6zh1hG+p1C1ymNoVj37cUhcQVyydJ4Uo1jhtPKRC11CCn5HeKYoaKIwotNUw3Mkk6UZ8XpeU o/T50RF0cqk8ixF1vSVOKTecJJefTcr6CNdnvR0eK6bRtc6Dsfgv46D/99BUqToeY1aJ18rSw xh4jq9ghtsSdqaulRE492XE9DsKQXfC0W7MNoUm1R5wqOqx1QmXm+mccfTMcjjWyJgnKiAPDP snjCGHMVgQn2PWS8VT8hjwK2BBnXqISFjl7NGioaaINxPUe5H/k5upk5M87GGedTn69jPZEk7 rh4r7R9LRZyKY9/zTMcjOh2rlBNg5xaex3tZGK5SpFWRMt50/JsHGFYvgnnNDU9NwDw9DiXz+ 1HWxx1m4FsFDLPXUvzEe52Jq8DNkzytCFr7FBM05smKK+tlx/QjYngQbD0OUS+uokUn4CPCo9 FJmqxu5FEhit2Nz7XInB3syUnrekQWZV4LL1D/UKzA2VAXtkOSwXMguSzlxn0cnviBRggic69 19NszG2/879dxoY5KjTwzKczqQZYU2Fg0KpLkI0c4m/Dja2qihz92+z6uqzrFOFdnAgM= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A bugfix patch for the xen balloon driver introduced a forward declaration for a static function that is conditionally compiled, causing a warning if only the declaration but not the definition are there: drivers/xen/balloon.c:154:13: error: 'release_memory_resource' declared 'static' but never defined [-Werror=unused-function] static void release_memory_resource(struct resource *resource); This removes the declaration again and instead moves the function definition to the right place, before its first caller and inside of the #ifdef protecting both. The patch that introduced the warning is marked for stable backports, so if that gets applied to 4.4, so should this one. Signed-off-by: Arnd Bergmann Fixes: dfd74a1edfab ("xen/balloon: Fix crash when ballooning on x86 32 bit PAE") Cc: stable@vger.kernel.org --- drivers/xen/balloon.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index d46839f51e73..e4db19e88ab1 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -151,8 +151,6 @@ static DECLARE_WAIT_QUEUE_HEAD(balloon_wq); static void balloon_process(struct work_struct *work); static DECLARE_DELAYED_WORK(balloon_worker, balloon_process); -static void release_memory_resource(struct resource *resource); - /* When ballooning out (allocating memory to return to Xen) we don't really want the kernel to try too hard since that can trigger the oom killer. */ #define GFP_BALLOON \ @@ -248,6 +246,19 @@ static enum bp_state update_schedule(enum bp_state state) } #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG +static void release_memory_resource(struct resource *resource) +{ + if (!resource) + return; + + /* + * No need to reset region to identity mapped since we now + * know that no I/O can be in this region + */ + release_resource(resource); + kfree(resource); +} + static struct resource *additional_memory_resource(phys_addr_t size) { struct resource *res; @@ -286,19 +297,6 @@ static struct resource *additional_memory_resource(phys_addr_t size) return res; } -static void release_memory_resource(struct resource *resource) -{ - if (!resource) - return; - - /* - * No need to reset region to identity mapped since we now - * know that no I/O can be in this region - */ - release_resource(resource); - kfree(resource); -} - static enum bp_state reserve_additional_memory(void) { long credit; -- 2.7.0