mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-21 14:34:19 +00:00
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>
This commit is contained in:
parent
9295b7a07c
commit
e30d539b3f
1 changed files with 11 additions and 11 deletions
|
@ -300,7 +300,7 @@ static char *page_flag_name(uint64_t flags)
|
||||||
{
|
{
|
||||||
static char buf[65];
|
static char buf[65];
|
||||||
int present;
|
int present;
|
||||||
int i, j;
|
size_t i, j;
|
||||||
|
|
||||||
for (i = 0, j = 0; i < ARRAY_SIZE(page_flag_names); i++) {
|
for (i = 0, j = 0; i < ARRAY_SIZE(page_flag_names); i++) {
|
||||||
present = (flags >> i) & 1;
|
present = (flags >> i) & 1;
|
||||||
|
@ -318,7 +318,7 @@ static char *page_flag_name(uint64_t flags)
|
||||||
static char *page_flag_longname(uint64_t flags)
|
static char *page_flag_longname(uint64_t flags)
|
||||||
{
|
{
|
||||||
static char buf[1024];
|
static char buf[1024];
|
||||||
int i, n;
|
size_t i, n;
|
||||||
|
|
||||||
for (i = 0, n = 0; i < ARRAY_SIZE(page_flag_names); i++) {
|
for (i = 0, n = 0; i < ARRAY_SIZE(page_flag_names); i++) {
|
||||||
if (!page_flag_names[i])
|
if (!page_flag_names[i])
|
||||||
|
@ -376,7 +376,7 @@ static void show_page(unsigned long voffset,
|
||||||
|
|
||||||
static void show_summary(void)
|
static void show_summary(void)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
printf(" flags\tpage-count MB"
|
printf(" flags\tpage-count MB"
|
||||||
" symbolic-flags\t\t\tlong-symbolic-flags\n");
|
" symbolic-flags\t\t\tlong-symbolic-flags\n");
|
||||||
|
@ -474,7 +474,7 @@ static int debugfs_valid_mountpoint(const char *debugfs)
|
||||||
/* find the path to the mounted debugfs */
|
/* find the path to the mounted debugfs */
|
||||||
static const char *debugfs_find_mountpoint(void)
|
static const char *debugfs_find_mountpoint(void)
|
||||||
{
|
{
|
||||||
const char **ptr;
|
const char *const *ptr;
|
||||||
char type[100];
|
char type[100];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
|
@ -511,7 +511,7 @@ static const char *debugfs_find_mountpoint(void)
|
||||||
|
|
||||||
static void debugfs_mount(void)
|
static void debugfs_mount(void)
|
||||||
{
|
{
|
||||||
const char **ptr;
|
const char *const *ptr;
|
||||||
|
|
||||||
/* see if it's already mounted */
|
/* see if it's already mounted */
|
||||||
if (debugfs_find_mountpoint())
|
if (debugfs_find_mountpoint())
|
||||||
|
@ -588,10 +588,10 @@ static int unpoison_page(unsigned long offset)
|
||||||
* page frame walker
|
* page frame walker
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int hash_slot(uint64_t flags)
|
static size_t hash_slot(uint64_t flags)
|
||||||
{
|
{
|
||||||
int k = HASH_KEY(flags);
|
size_t k = HASH_KEY(flags);
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
/* Explicitly reserve slot 0 for flags 0: the following logic
|
/* Explicitly reserve slot 0 for flags 0: the following logic
|
||||||
* cannot distinguish an unoccupied slot from slot (flags==0).
|
* cannot distinguish an unoccupied slot from slot (flags==0).
|
||||||
|
@ -644,7 +644,7 @@ static void walk_pfn(unsigned long voffset,
|
||||||
{
|
{
|
||||||
uint64_t buf[KPAGEFLAGS_BATCH];
|
uint64_t buf[KPAGEFLAGS_BATCH];
|
||||||
unsigned long batch;
|
unsigned long batch;
|
||||||
long pages;
|
unsigned long pages;
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
|
|
||||||
while (count) {
|
while (count) {
|
||||||
|
@ -753,7 +753,7 @@ static const char *page_flag_type(uint64_t flag)
|
||||||
|
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
int i, j;
|
size_t i, j;
|
||||||
|
|
||||||
printf(
|
printf(
|
||||||
"page-types [options]\n"
|
"page-types [options]\n"
|
||||||
|
@ -912,7 +912,7 @@ static void add_bits_filter(uint64_t mask, uint64_t bits)
|
||||||
|
|
||||||
static uint64_t parse_flag_name(const char *str, int len)
|
static uint64_t parse_flag_name(const char *str, int len)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (!*str || !len)
|
if (!*str || !len)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue