linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members' types
Date: Tue, 10 Nov 2015 22:32:06 +0900	[thread overview]
Message-ID: <1447162326-30626-4-git-send-email-sergey.senozhatsky@gmail.com> (raw)
In-Reply-To: <1447162326-30626-1-git-send-email-sergey.senozhatsky@gmail.com>

Align some of `struct slabinfo' members' types with
`struct kmem_cache' to suppress gcc warnings:

slabinfo.c:847:22: warning: comparison between signed
  and unsigned integer expressions [-Wsign-compare]
slabinfo.c:869:20: warning: comparison between signed
  and unsigned integer expressions [-Wsign-compare]
slabinfo.c:872:22: warning: comparison between signed
  and unsigned integer expressions [-Wsign-compare]
slabinfo.c:894:20: warning: comparison between signed
  and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 tools/vm/slabinfo.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c
index 86e698d0..1813854 100644
--- a/tools/vm/slabinfo.c
+++ b/tools/vm/slabinfo.c
@@ -19,6 +19,7 @@
 #include <getopt.h>
 #include <regex.h>
 #include <errno.h>
+#include <limits.h>
 
 #define MAX_SLABS 500
 #define MAX_ALIASES 500
@@ -28,10 +29,11 @@ struct slabinfo {
 	char *name;
 	int alias;
 	int refs;
-	int aliases, align, cache_dma, cpu_slabs, destroy_by_rcu;
-	int hwcache_align, object_size, objs_per_slab;
-	int sanity_checks, slab_size, store_user, trace;
+	int aliases, cache_dma, cpu_slabs, destroy_by_rcu;
+	int sanity_checks, store_user, trace;
 	int order, poison, reclaim_account, red_zone;
+	unsigned int hwcache_align, align, object_size;
+	unsigned int objs_per_slab, slab_size;
 	unsigned long partial, objects, slabs, objects_partial, objects_total;
 	unsigned long alloc_fastpath, alloc_slowpath;
 	unsigned long free_fastpath, free_slowpath;
@@ -766,10 +768,10 @@ static void totals(void)
 
 	int used_slabs = 0;
 	char b1[20], b2[20], b3[20], b4[20];
-	unsigned long long max = 1ULL << 63;
+	unsigned long long max = ULLONG_MAX;
 
 	/* Object size */
-	unsigned long long min_objsize = max, max_objsize = 0, avg_objsize;
+	unsigned int min_objsize = UINT_MAX, max_objsize = 0, avg_objsize;
 
 	/* Number of partial slabs in a slabcache */
 	unsigned long long min_partial = max, max_partial = 0,
-- 
2.6.2.280.g74301d6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2015-11-10 13:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10 13:32 [PATCH 0/3] tools/vm: trivial fixes Sergey Senozhatsky
2015-11-10 13:32 ` [PATCH 1/3] tools/vm: fix Makefile multi-targets Sergey Senozhatsky
2015-11-10 15:29   ` Christoph Lameter
2015-11-11 12:28   ` Sergey Senozhatsky
2015-11-11 20:34     ` David Rientjes
2015-11-12  0:58       ` Sergey Senozhatsky
2015-11-10 13:32 ` [PATCH 2/3] tools/vm/page-types: suppress gcc warnings Sergey Senozhatsky
2015-11-11 20:44   ` David Rientjes
2015-11-12  0:54     ` Sergey Senozhatsky
2015-11-12  5:46       ` David Rientjes
2015-11-10 13:32 ` Sergey Senozhatsky [this message]
2015-11-10 15:28   ` [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members' types Christoph Lameter
2015-11-11 20:55   ` David Rientjes
2015-11-12  1:13     ` Sergey Senozhatsky
2015-11-12  5:07       ` David Rientjes
2015-11-12  6:17         ` Sergey Senozhatsky
2015-11-12  9:59           ` David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447162326-30626-4-git-send-email-sergey.senozhatsky@gmail.com \
    --to=sergey.senozhatsky@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=sergey.senozhatsky.work@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).