diff options
| author | Ulrich Drepper <drepper@akkadia.org> | 2012-05-29 18:06:30 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 19:22:21 -0400 |
| commit | e30d539b3fe76f5bb71e069dcbfa47a1c2e6da3b (patch) | |
| tree | a3160bcaca4a00ece4c873521cf678767924b945 /tools/vm | |
| parent | 9295b7a07c859a42346221b5839be0ae612333b0 (diff) | |
tools/vm/page-types.c: cleanups
Compiling page-type.c with a recent compiler produces many warnings,
mostly related to signed/unsigned comparisons. This patch cleans up most
of them.
One remaining warning is about an unused parameter. The <compiler.h> file
doesn't define a __unused macro (or the like) yet. This can be addressed
later.
Signed-off-by: Ulrich Drepper <drepper@gmail.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/vm')
| -rw-r--r-- | tools/vm/page-types.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/vm/page-types.c b/tools/vm/page-types.c index f77c96bec7eb..f576971f6556 100644 --- a/tools/vm/page-types.c +++ b/tools/vm/page-types.c | |||
| @@ -300,7 +300,7 @@ static char *page_flag_name(uint64_t flags) | |||
| 300 | { | 300 | { |
| 301 | static char buf[65]; | 301 | static char buf[65]; |
| 302 | int present; | 302 | int present; |
| 303 | int i, j; | 303 | size_t i, j; |
| 304 | 304 | ||
| 305 | for (i = 0, j = 0; i < ARRAY_SIZE(page_flag_names); i++) { | 305 | for (i = 0, j = 0; i < ARRAY_SIZE(page_flag_names); i++) { |
| 306 | present = (flags >> i) & 1; | 306 | present = (flags >> i) & 1; |
| @@ -318,7 +318,7 @@ static char *page_flag_name(uint64_t flags) | |||
| 318 | static char *page_flag_longname(uint64_t flags) | 318 | static char *page_flag_longname(uint64_t flags) |
| 319 | { | 319 | { |
| 320 | static char buf[1024]; | 320 | static char buf[1024]; |
| 321 | int i, n; | 321 | size_t i, n; |
| 322 | 322 | ||
| 323 | for (i = 0, n = 0; i < ARRAY_SIZE(page_flag_names); i++) { | 323 | for (i = 0, n = 0; i < ARRAY_SIZE(page_flag_names); i++) { |
| 324 | if (!page_flag_names[i]) | 324 | if (!page_flag_names[i]) |
| @@ -376,7 +376,7 @@ static void show_page(unsigned long voffset, | |||
| 376 | 376 | ||
| 377 | static void show_summary(void) | 377 | static void show_summary(void) |
| 378 | { | 378 | { |
| 379 | int i; | 379 | size_t i; |
| 380 | 380 | ||
| 381 | printf(" flags\tpage-count MB" | 381 | printf(" flags\tpage-count MB" |
| 382 | " symbolic-flags\t\t\tlong-symbolic-flags\n"); | 382 | " symbolic-flags\t\t\tlong-symbolic-flags\n"); |
| @@ -474,7 +474,7 @@ static int debugfs_valid_mountpoint(const char *debugfs) | |||
| 474 | /* find the path to the mounted debugfs */ | 474 | /* find the path to the mounted debugfs */ |
| 475 | static const char *debugfs_find_mountpoint(void) | 475 | static const char *debugfs_find_mountpoint(void) |
| 476 | { | 476 | { |
| 477 | const char **ptr; | 477 | const char *const *ptr; |
| 478 | char type[100]; | 478 | char type[100]; |
| 479 | FILE *fp; | 479 | FILE *fp; |
| 480 | 480 | ||
| @@ -511,7 +511,7 @@ static const char *debugfs_find_mountpoint(void) | |||
| 511 | 511 | ||
| 512 | static void debugfs_mount(void) | 512 | static void debugfs_mount(void) |
| 513 | { | 513 | { |
| 514 | const char **ptr; | 514 | const char *const *ptr; |
| 515 | 515 | ||
| 516 | /* see if it's already mounted */ | 516 | /* see if it's already mounted */ |
| 517 | if (debugfs_find_mountpoint()) | 517 | if (debugfs_find_mountpoint()) |
| @@ -588,10 +588,10 @@ static int unpoison_page(unsigned long offset) | |||
| 588 | * page frame walker | 588 | * page frame walker |
| 589 | */ | 589 | */ |
| 590 | 590 | ||
| 591 | static int hash_slot(uint64_t flags) | 591 | static size_t hash_slot(uint64_t flags) |
| 592 | { | 592 | { |
| 593 | int k = HASH_KEY(flags); | 593 | size_t k = HASH_KEY(flags); |
| 594 | int i; | 594 | size_t i; |
| 595 | 595 | ||
| 596 | /* Explicitly reserve slot 0 for flags 0: the following logic | 596 | /* Explicitly reserve slot 0 for flags 0: the following logic |
| 597 | * cannot distinguish an unoccupied slot from slot (flags==0). | 597 | * cannot distinguish an unoccupied slot from slot (flags==0). |
| @@ -644,7 +644,7 @@ static void walk_pfn(unsigned long voffset, | |||
| 644 | { | 644 | { |
| 645 | uint64_t buf[KPAGEFLAGS_BATCH]; | 645 | uint64_t buf[KPAGEFLAGS_BATCH]; |
| 646 | unsigned long batch; | 646 | unsigned long batch; |
| 647 | long pages; | 647 | unsigned long pages; |
| 648 | unsigned long i; | 648 | unsigned long i; |
| 649 | 649 | ||
| 650 | while (count) { | 650 | while (count) { |
| @@ -753,7 +753,7 @@ static const char *page_flag_type(uint64_t flag) | |||
| 753 | 753 | ||
| 754 | static void usage(void) | 754 | static void usage(void) |
| 755 | { | 755 | { |
| 756 | int i, j; | 756 | size_t i, j; |
| 757 | 757 | ||
| 758 | printf( | 758 | printf( |
| 759 | "page-types [options]\n" | 759 | "page-types [options]\n" |
| @@ -912,7 +912,7 @@ static void add_bits_filter(uint64_t mask, uint64_t bits) | |||
| 912 | 912 | ||
| 913 | static uint64_t parse_flag_name(const char *str, int len) | 913 | static uint64_t parse_flag_name(const char *str, int len) |
| 914 | { | 914 | { |
| 915 | int i; | 915 | size_t i; |
| 916 | 916 | ||
| 917 | if (!*str || !len) | 917 | if (!*str || !len) |
| 918 | return 0; | 918 | return 0; |
