]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.132/tools-vm-slabinfo.c-fix-sign-compare-warning.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 4.9.132 / tools-vm-slabinfo.c-fix-sign-compare-warning.patch
CommitLineData
12eb7899
GKH
1From foo@baz Thu Oct 4 12:38:43 PDT 2018
2From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
3Date: Tue, 4 Sep 2018 15:45:48 -0700
4Subject: tools/vm/slabinfo.c: fix sign-compare warning
5
6From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
7
8[ Upstream commit 904506562e0856f2535d876407d087c9459d345b ]
9
10Currently 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
16due 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
18unsigned 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
22Link: http://lkml.kernel.org/r/1535103134-20239-1-git-send-email-n-horiguchi@ah.jp.nec.com
23Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
24Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
25Cc: Matthew Wilcox <willy@infradead.org>
26Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
27Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
28Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
29Signed-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;