summaryrefslogtreecommitdiffstats
path: root/mm/slab_common.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2018-04-06 01:20:26 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-06 06:36:23 +0200
commit0be70327ec8cf6dd6847cbd8b75ca51be864a6ea (patch)
treed0e66c101f169a234ce233806d376ed5da400a18 /mm/slab_common.c
parentslab: make kmalloc_index() return "unsigned int" (diff)
downloadlinux-0be70327ec8cf6dd6847cbd8b75ca51be864a6ea.tar.xz
linux-0be70327ec8cf6dd6847cbd8b75ca51be864a6ea.zip
slab: make kmalloc_size() return "unsigned int"
kmalloc_size() derives size of kmalloc cache from internal index, which can't be negative. Propagate unsignedness a bit. Link: http://lkml.kernel.org/r/20180305200730.15812-3-adobriyan@gmail.com Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--mm/slab_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 7626a64b8f14..d3f4209c297d 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -1138,9 +1138,9 @@ void __init create_kmalloc_caches(slab_flags_t flags)
struct kmem_cache *s = kmalloc_caches[i];
if (s) {
- int size = kmalloc_size(i);
+ unsigned int size = kmalloc_size(i);
char *n = kasprintf(GFP_NOWAIT,
- "dma-kmalloc-%d", size);
+ "dma-kmalloc-%u", size);
BUG_ON(!n);
kmalloc_dma_caches[i] = create_kmalloc_cache(n,