mm: move page-types.c from Documentation to tools/vm
Dave Young [Wed, 28 Mar 2012 21:42:55 +0000 (14:42 -0700)]
tools/ is the better place for vm tools which are used by many people.
Moving them to tools also make them open to more users instead of hide in
Documentation folder.

This patch moves page-types.c to tools/vm/page-types.c.  Also add a
Makefile in tools/vm and fix two coding style problems: a) change const
arrary to 'const char * const', b) change a space to tab for indent.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Documentation/vm/Makefile
tools/vm/Makefile [new file with mode: 0644]
tools/vm/page-types.c [moved from Documentation/vm/page-types.c with 99% similarity]

index 3fa4d06..e538864 100644 (file)
@@ -2,7 +2,7 @@
 obj- := dummy.o
 
 # List of programs to build
-hostprogs-y := page-types hugepage-mmap hugepage-shm map_hugetlb
+hostprogs-y := hugepage-mmap hugepage-shm map_hugetlb
 
 # Tell kbuild to always build the programs
 always := $(hostprogs-y)
diff --git a/tools/vm/Makefile b/tools/vm/Makefile
new file mode 100644 (file)
index 0000000..3823d4b
--- /dev/null
@@ -0,0 +1,11 @@
+# Makefile for vm tools
+
+CC = $(CROSS_COMPILE)gcc
+CFLAGS = -Wall -Wextra
+
+all: page-types
+%: %.c
+       $(CC) $(CFLAGS) -o $@ $^
+
+clean:
+       $(RM) page-types
similarity index 99%
rename from Documentation/vm/page-types.c
rename to tools/vm/page-types.c
index 0b13f02..7dab7b2 100644 (file)
 #define BIT(name)              (1ULL << KPF_##name)
 #define BITS_COMPOUND          (BIT(COMPOUND_HEAD) | BIT(COMPOUND_TAIL))
 
-static const char *page_flag_names[] = {
+static const char * const page_flag_names[] = {
        [KPF_LOCKED]            = "L:locked",
        [KPF_ERROR]             = "E:error",
        [KPF_REFERENCED]        = "R:referenced",
@@ -166,7 +166,7 @@ static const char *page_flag_names[] = {
 };
 
 
-static const char *debugfs_known_mountpoints[] = {
+static const char * const debugfs_known_mountpoints[] = {
        "/sys/kernel/debug",
        "/debug",
        0,
@@ -215,7 +215,7 @@ static int          hwpoison_forget_fd;
 
 static unsigned long   total_pages;
 static unsigned long   nr_pages[HASH_SIZE];
-static uint64_t        page_flags[HASH_SIZE];
+static uint64_t                page_flags[HASH_SIZE];
 
 
 /*