]>
Commit | Line | Data |
---|---|---|
12eb7899 GKH |
1 | From foo@baz Thu Oct 4 12:38:43 PDT 2018 |
2 | From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | |
3 | Date: Tue, 4 Sep 2018 15:45:48 -0700 | |
4 | Subject: tools/vm/slabinfo.c: fix sign-compare warning | |
5 | ||
6 | From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | |
7 | ||
8 | [ Upstream commit 904506562e0856f2535d876407d087c9459d345b ] | |
9 | ||
10 | Currently we get the following compiler warning: | |
11 | ||
12 | slabinfo.c:854:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] | |
13 | if (s->object_size < min_objsize) | |
14 | ^ | |
15 | ||
16 | due to the mismatch of signed/unsigned comparison. ->object_size and | |
17 | ->slab_size are never expected to be negative, so let's define them as | |
18 | unsigned int. | |
19 | ||
20 | [n-horiguchi@ah.jp.nec.com: convert everything - none of these can be negative] | |
21 | Link: http://lkml.kernel.org/r/20180826234947.GA9787@hori1.linux.bs1.fc.nec.co.jp | |
22 | Link: http://lkml.kernel.org/r/1535103134-20239-1-git-send-email-n-horiguchi@ah.jp.nec.com | |
23 | Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | |
24 | Reviewed-by: Andrew Morton <akpm@linux-foundation.org> | |
25 | Cc: Matthew Wilcox <willy@infradead.org> | |
26 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | |
27 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | |
28 | Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> | |
29 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
30 | --- | |
31 | tools/vm/slabinfo.c | 4 ++-- | |
32 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
33 | ||
34 | --- a/tools/vm/slabinfo.c | |
35 | +++ b/tools/vm/slabinfo.c | |
36 | @@ -29,8 +29,8 @@ struct slabinfo { | |
37 | int alias; | |
38 | int refs; | |
39 | int aliases, align, cache_dma, cpu_slabs, destroy_by_rcu; | |
40 | - int hwcache_align, object_size, objs_per_slab; | |
41 | - int sanity_checks, slab_size, store_user, trace; | |
42 | + unsigned int hwcache_align, object_size, objs_per_slab; | |
43 | + unsigned int sanity_checks, slab_size, store_user, trace; | |
44 | int order, poison, reclaim_account, red_zone; | |
45 | unsigned long partial, objects, slabs, objects_partial, objects_total; | |
46 | unsigned long alloc_fastpath, alloc_slowpath; |