Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1267448

Re: [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members' types

From David Rientjes <rientjes@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members' types
Date 2015-11-11 22:00 +0100
Message-ID <qtKEN-7L5-3@gated-at.bofh.it> (permalink)
References <qthjr-5Fv-3@gated-at.bofh.it> <qthjs-5Fv-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 10 Nov 2015, Sergey Senozhatsky wrote:

> 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,

avg_objsize should not be unsigned int.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] tools/vm: trivial fixes Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-11-10 14:40 +0100
  [PATCH 2/3] tools/vm/page-types: suppress gcc warnings Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-11-10 14:40 +0100
    Re: [PATCH 2/3] tools/vm/page-types: suppress gcc warnings David Rientjes <rientjes@google.com> - 2015-11-11 21:50 +0100
      Re: [PATCH 2/3] tools/vm/page-types: suppress gcc warnings Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-11-12 02:00 +0100
        Re: [PATCH 2/3] tools/vm/page-types: suppress gcc warnings David Rientjes <rientjes@google.com> - 2015-11-12 06:50 +0100
  [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members' types Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-11-10 14:40 +0100
    Re: [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members'  types Christoph Lameter <cl@linux.com> - 2015-11-10 16:30 +0100
    Re: [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members'  types David Rientjes <rientjes@google.com> - 2015-11-11 22:00 +0100
      Re: [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members'  types Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-11-12 02:20 +0100
        Re: [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members'  types David Rientjes <rientjes@google.com> - 2015-11-12 06:10 +0100
          Re: [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members'  types Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-11-12 07:20 +0100
            Re: [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members'  types David Rientjes <rientjes@google.com> - 2015-11-12 11:00 +0100
  [PATCH 1/3] tools/vm: fix Makefile multi-targets Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-11-10 14:40 +0100
    Re: [PATCH 1/3] tools/vm: fix Makefile multi-targets Christoph Lameter <cl@linux.com> - 2015-11-10 16:30 +0100
    Re: [PATCH 1/3] tools/vm: fix Makefile multi-targets Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-11-11 13:30 +0100
      Re: [PATCH 1/3] tools/vm: fix Makefile multi-targets David Rientjes <rientjes@google.com> - 2015-11-11 21:40 +0100
        Re: [PATCH 1/3] tools/vm: fix Makefile multi-targets Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-11-12 02:00 +0100

csiph-web