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>
{
static char buf[65];
int present;
{
static char buf[65];
int present;
for (i = 0, j = 0; i < ARRAY_SIZE(page_flag_names); i++) {
present = (flags >> i) & 1;
for (i = 0, j = 0; i < ARRAY_SIZE(page_flag_names); i++) {
present = (flags >> i) & 1;
static char *page_flag_longname(uint64_t flags)
{
static char buf[1024];
static char *page_flag_longname(uint64_t flags)
{
static char buf[1024];
for (i = 0, n = 0; i < ARRAY_SIZE(page_flag_names); i++) {
if (!page_flag_names[i])
for (i = 0, n = 0; i < ARRAY_SIZE(page_flag_names); i++) {
if (!page_flag_names[i])
static void show_summary(void)
{
static void show_summary(void)
{
printf(" flags\tpage-count MB"
" symbolic-flags\t\t\tlong-symbolic-flags\n");
printf(" flags\tpage-count MB"
" symbolic-flags\t\t\tlong-symbolic-flags\n");
/* find the path to the mounted debugfs */
static const char *debugfs_find_mountpoint(void)
{
/* find the path to the mounted debugfs */
static const char *debugfs_find_mountpoint(void)
{
+ const char *const *ptr;
char type[100];
FILE *fp;
char type[100];
FILE *fp;
static void debugfs_mount(void)
{
static void debugfs_mount(void)
{
+ const char *const *ptr;
/* see if it's already mounted */
if (debugfs_find_mountpoint())
/* see if it's already mounted */
if (debugfs_find_mountpoint())
-static int hash_slot(uint64_t flags)
+static size_t hash_slot(uint64_t flags)
- int k = HASH_KEY(flags);
- int i;
+ size_t k = HASH_KEY(flags);
+ size_t i;
/* Explicitly reserve slot 0 for flags 0: the following logic
* cannot distinguish an unoccupied slot from slot (flags==0).
/* Explicitly reserve slot 0 for flags 0: the following logic
* cannot distinguish an unoccupied slot from slot (flags==0).
{
uint64_t buf[KPAGEFLAGS_BATCH];
unsigned long batch;
{
uint64_t buf[KPAGEFLAGS_BATCH];
unsigned long batch;
unsigned long i;
while (count) {
unsigned long i;
while (count) {
static void usage(void)
{
static void usage(void)
{
printf(
"page-types [options]\n"
printf(
"page-types [options]\n"
static uint64_t parse_flag_name(const char *str, int len)
{
static uint64_t parse_flag_name(const char *str, int len)
{
if (!*str || !len)
return 0;
if (!*str || !len)
return 0;