Skip to content

Commit 9045065

Browse files
Naoya Horiguchitorvalds
authored andcommitted
tools/vm/slabinfo.c: fix sign-compare warning
Currently we get the following compiler warning: slabinfo.c:854:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (s->object_size < min_objsize) ^ due to the mismatch of signed/unsigned comparison. ->object_size and ->slab_size are never expected to be negative, so let's define them as unsigned int. [[email protected]: convert everything - none of these can be negative] Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Naoya Horiguchi <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent b353756 commit 9045065

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/vm/slabinfo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ struct slabinfo {
3030
int alias;
3131
int refs;
3232
int aliases, align, cache_dma, cpu_slabs, destroy_by_rcu;
33-
int hwcache_align, object_size, objs_per_slab;
34-
int sanity_checks, slab_size, store_user, trace;
33+
unsigned int hwcache_align, object_size, objs_per_slab;
34+
unsigned int sanity_checks, slab_size, store_user, trace;
3535
int order, poison, reclaim_account, red_zone;
3636
unsigned long partial, objects, slabs, objects_partial, objects_total;
3737
unsigned long alloc_fastpath, alloc_slowpath;

0 commit comments

Comments
 (0)