]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.6.5/xen-balloon-fix-declared-but-not-defined-warning.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.6.5 / xen-balloon-fix-declared-but-not-defined-warning.patch
1 From 842775f1509054ea969f1787f38d6a0ec2ccfaba Mon Sep 17 00:00:00 2001
2 From: Ross Lagerwall <ross.lagerwall@citrix.com>
3 Date: Tue, 10 May 2016 10:27:54 +0100
4 Subject: xen/balloon: Fix declared-but-not-defined warning
5
6 From: Ross Lagerwall <ross.lagerwall@citrix.com>
7
8 commit 842775f1509054ea969f1787f38d6a0ec2ccfaba upstream.
9
10 Fix a declared-but-not-defined warning when building with
11 XEN_BALLOON_MEMORY_HOTPLUG=n. This fixes a regression introduced by
12 commit dfd74a1edfab ("xen/balloon: Fix crash when ballooning on x86 32
13 bit PAE").
14
15 Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
16 Acked-by: Juergen Gross <jgross@suse.com>
17 Signed-off-by: David Vrabel <david.vrabel@citrix.com>
18 Cc: Arnd Bergmann <arnd@arndb.de>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21 ---
22 drivers/xen/balloon.c | 28 +++++++++++++---------------
23 1 file changed, 13 insertions(+), 15 deletions(-)
24
25 --- a/drivers/xen/balloon.c
26 +++ b/drivers/xen/balloon.c
27 @@ -151,8 +151,6 @@ static DECLARE_WAIT_QUEUE_HEAD(balloon_w
28 static void balloon_process(struct work_struct *work);
29 static DECLARE_DELAYED_WORK(balloon_worker, balloon_process);
30
31 -static void release_memory_resource(struct resource *resource);
32 -
33 /* When ballooning out (allocating memory to return to Xen) we don't really
34 want the kernel to try too hard since that can trigger the oom killer. */
35 #define GFP_BALLOON \
36 @@ -248,6 +246,19 @@ static enum bp_state update_schedule(enu
37 }
38
39 #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
40 +static void release_memory_resource(struct resource *resource)
41 +{
42 + if (!resource)
43 + return;
44 +
45 + /*
46 + * No need to reset region to identity mapped since we now
47 + * know that no I/O can be in this region
48 + */
49 + release_resource(resource);
50 + kfree(resource);
51 +}
52 +
53 static struct resource *additional_memory_resource(phys_addr_t size)
54 {
55 struct resource *res;
56 @@ -286,19 +297,6 @@ static struct resource *additional_memor
57 return res;
58 }
59
60 -static void release_memory_resource(struct resource *resource)
61 -{
62 - if (!resource)
63 - return;
64 -
65 - /*
66 - * No need to reset region to identity mapped since we now
67 - * know that no I/O can be in this region
68 - */
69 - release_resource(resource);
70 - kfree(resource);
71 -}
72 -
73 static enum bp_state reserve_additional_memory(void)
74 {
75 long credit;