[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20101005142748.37f186da.akpm@linux-foundation.org>
Date: Tue, 5 Oct 2010 14:27:48 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Namhyung Kim <namhyung@...il.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 12/12] vmstat: include compaction.h when
CONFIG_COMPACTION
Some of these patches do make the code significantly more complex to
read and follow. Boy, I hope it's all useful!
On Thu, 30 Sep 2010 12:50:21 +0900
Namhyung Kim <namhyung@...il.com> wrote:
> This removes following warning from sparse:
>
> mm/vmstat.c:466:5: warning: symbol 'fragmentation_index' was not declared. Should it be static?
>
> Signed-off-by: Namhyung Kim <namhyung@...il.com>
> ---
> mm/vmstat.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index 355a9e6..30054ea 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -394,6 +394,8 @@ void zone_statistics(struct zone *preferred_zone, struct zone *z)
> #endif
>
> #ifdef CONFIG_COMPACTION
> +#include <linux/compaction.h>
> +
> struct contig_page_info {
> unsigned long free_pages;
> unsigned long free_blocks_total;
This isn't a good idea: there's a good chance that someone will later
add a #include <linux/compaction.h> at the top of the file to support
future changes. So we end up including it twice.
So I assume the below will work OK??
--- a/mm/vmstat.c~vmstat-include-compactionh-when-config_compaction-fix
+++ a/mm/vmstat.c
@@ -18,6 +18,7 @@
#include <linux/sched.h>
#include <linux/math64.h>
#include <linux/writeback.h>
+#include <linux/compaction.h>
#ifdef CONFIG_VM_EVENT_COUNTERS
DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}};
@@ -395,7 +396,6 @@ void zone_statistics(struct zone *prefer
#endif
#ifdef CONFIG_COMPACTION
-#include <linux/compaction.h>
struct contig_page_info {
unsigned long free_pages;
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists