Skip to content

Commit 842775f

Browse files
rosslagerwallDavid Vrabel
authored andcommitted
xen/balloon: Fix declared-but-not-defined warning
Fix a declared-but-not-defined warning when building with XEN_BALLOON_MEMORY_HOTPLUG=n. This fixes a regression introduced by commit dfd74a1 ("xen/balloon: Fix crash when ballooning on x86 32 bit PAE"). Signed-off-by: Ross Lagerwall <[email protected]> Acked-by: Juergen Gross <[email protected]> Signed-off-by: David Vrabel <[email protected]>
1 parent 33688ab commit 842775f

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

drivers/xen/balloon.c

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ static DECLARE_WAIT_QUEUE_HEAD(balloon_wq);
151151
static void balloon_process(struct work_struct *work);
152152
static DECLARE_DELAYED_WORK(balloon_worker, balloon_process);
153153

154-
static void release_memory_resource(struct resource *resource);
155-
156154
/* When ballooning out (allocating memory to return to Xen) we don't really
157155
want the kernel to try too hard since that can trigger the oom killer. */
158156
#define GFP_BALLOON \
@@ -248,6 +246,19 @@ static enum bp_state update_schedule(enum bp_state state)
248246
}
249247

250248
#ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
249+
static void release_memory_resource(struct resource *resource)
250+
{
251+
if (!resource)
252+
return;
253+
254+
/*
255+
* No need to reset region to identity mapped since we now
256+
* know that no I/O can be in this region
257+
*/
258+
release_resource(resource);
259+
kfree(resource);
260+
}
261+
251262
static struct resource *additional_memory_resource(phys_addr_t size)
252263
{
253264
struct resource *res;
@@ -286,19 +297,6 @@ static struct resource *additional_memory_resource(phys_addr_t size)
286297
return res;
287298
}
288299

289-
static void release_memory_resource(struct resource *resource)
290-
{
291-
if (!resource)
292-
return;
293-
294-
/*
295-
* No need to reset region to identity mapped since we now
296-
* know that no I/O can be in this region
297-
*/
298-
release_resource(resource);
299-
kfree(resource);
300-
}
301-
302300
static enum bp_state reserve_additional_memory(void)
303301
{
304302
long credit;

0 commit comments

Comments
 (0)