Skip to content

Commit

Permalink
mm: move page-types.c from Documentation to tools/vm
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Wu Fengguang <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
daveyoung authored and torvalds committed Mar 29, 2012
1 parent cab6b05 commit c6dd897
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Documentation/vm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 11 additions & 0 deletions tools/vm/Makefile
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions Documentation/vm/page-types.c → tools/vm/page-types.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
#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",
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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];


/*
Expand Down

0 comments on commit c6dd897

Please sign in to comment.