* [2.6 patch] kernel/power/: move function prototypes to header
@ 2007-11-02 15:44 Adrian Bunk
2007-11-02 20:35 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2007-11-02 15:44 UTC (permalink / raw)
To: pavel, rjw; +Cc: linux-pm, linux-kernel
This patch moves the prototypes of count_highmem_pages() and
restore_highmem() to kernel/power/power.h
Signed-off-by: Adrian Bunk <bunk@kernel.org>
---
kernel/power/power.h | 8 ++++++++
kernel/power/snapshot.c | 1 -
kernel/power/swsusp.c | 8 --------
3 files changed, 8 insertions(+), 9 deletions(-)
20af06052a0203d9e60b4937282793900c756182
diff --git a/kernel/power/power.h b/kernel/power/power.h
index 195dc46..3fe1e7f 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -211,3 +211,11 @@ static inline int pm_notifier_call_chain(unsigned long val)
return (blocking_notifier_call_chain(&pm_chain_head, val, NULL)
== NOTIFY_BAD) ? -EINVAL : 0;
}
+
+#ifdef CONFIG_HIGHMEM
+unsigned int count_highmem_pages(void);
+int restore_highmem(void);
+#else
+static inline unsigned int count_highmem_pages(void) { return 0; }
+static inline int restore_highmem(void) { return 0; }
+#endif
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 78039b4..d9ed1ff 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -872,7 +872,6 @@ unsigned int count_highmem_pages(void)
}
#else
static inline void *saveable_highmem_page(unsigned long pfn) { return NULL; }
-static inline unsigned int count_highmem_pages(void) { return 0; }
#endif /* CONFIG_HIGHMEM */
/**
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index e1722d3..605c536 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -64,14 +64,6 @@ unsigned long image_size = 500 * 1024 * 1024;
int in_suspend __nosavedata = 0;
-#ifdef CONFIG_HIGHMEM
-unsigned int count_highmem_pages(void);
-int restore_highmem(void);
-#else
-static inline int restore_highmem(void) { return 0; }
-static inline unsigned int count_highmem_pages(void) { return 0; }
-#endif
-
/**
* The following functions are used for tracing the allocated
* swap pages, so that they can be freed in case of an error.
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [2.6 patch] kernel/power/: move function prototypes to header
2007-11-02 15:44 [2.6 patch] kernel/power/: move function prototypes to header Adrian Bunk
@ 2007-11-02 20:35 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2007-11-02 20:35 UTC (permalink / raw)
To: Adrian Bunk; +Cc: pavel, linux-pm, Andrew Morton, linux-kernel
On Friday, 2 November 2007 16:44, Adrian Bunk wrote:
> This patch moves the prototypes of count_highmem_pages() and
> restore_highmem() to kernel/power/power.h
>
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Rafael J. Wysocki <rjw@sisk.p>
> ---
>
> kernel/power/power.h | 8 ++++++++
> kernel/power/snapshot.c | 1 -
> kernel/power/swsusp.c | 8 --------
> 3 files changed, 8 insertions(+), 9 deletions(-)
>
> 20af06052a0203d9e60b4937282793900c756182
> diff --git a/kernel/power/power.h b/kernel/power/power.h
> index 195dc46..3fe1e7f 100644
> --- a/kernel/power/power.h
> +++ b/kernel/power/power.h
> @@ -211,3 +211,11 @@ static inline int pm_notifier_call_chain(unsigned long val)
> return (blocking_notifier_call_chain(&pm_chain_head, val, NULL)
> == NOTIFY_BAD) ? -EINVAL : 0;
> }
> +
> +#ifdef CONFIG_HIGHMEM
> +unsigned int count_highmem_pages(void);
> +int restore_highmem(void);
> +#else
> +static inline unsigned int count_highmem_pages(void) { return 0; }
> +static inline int restore_highmem(void) { return 0; }
> +#endif
> diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
> index 78039b4..d9ed1ff 100644
> --- a/kernel/power/snapshot.c
> +++ b/kernel/power/snapshot.c
> @@ -872,7 +872,6 @@ unsigned int count_highmem_pages(void)
> }
> #else
> static inline void *saveable_highmem_page(unsigned long pfn) { return NULL; }
> -static inline unsigned int count_highmem_pages(void) { return 0; }
> #endif /* CONFIG_HIGHMEM */
>
> /**
> diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
> index e1722d3..605c536 100644
> --- a/kernel/power/swsusp.c
> +++ b/kernel/power/swsusp.c
> @@ -64,14 +64,6 @@ unsigned long image_size = 500 * 1024 * 1024;
>
> int in_suspend __nosavedata = 0;
>
> -#ifdef CONFIG_HIGHMEM
> -unsigned int count_highmem_pages(void);
> -int restore_highmem(void);
> -#else
> -static inline int restore_highmem(void) { return 0; }
> -static inline unsigned int count_highmem_pages(void) { return 0; }
> -#endif
> -
> /**
> * The following functions are used for tracing the allocated
> * swap pages, so that they can be freed in case of an error.
>
>
>
--
"Premature optimization is the root of all evil." - Donald Knuth
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-02 20:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-02 15:44 [2.6 patch] kernel/power/: move function prototypes to header Adrian Bunk
2007-11-02 20:35 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox