From patchwork Wed May 11 13:07:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102361 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp215787qge; Wed, 11 May 2016 06:08:30 -0700 (PDT) X-Received: by 10.66.41.43 with SMTP id c11mr4818574pal.96.1462972110853; Wed, 11 May 2016 06:08:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o126si9601653pfo.30.2016.05.11.06.08.30; Wed, 11 May 2016 06:08:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751670AbcEKNI3 (ORCPT + 3 others); Wed, 11 May 2016 09:08:29 -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 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0MPGpE-1aw69e27rk-004UY4; Wed, 11 May 2016 15:07:58 +0200 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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;