From: Alexey Dobriyan Date: Thu, 5 Apr 2018 23:21:02 +0000 (-0700) Subject: slub: make ->align unsigned int X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3a3791ec2ecd5db8d903b66faa340b0dfa72e64b;p=linux.git slub: make ->align unsigned int Kmem cache alignment can't be negative. Link: http://lkml.kernel.org/r/20180305200730.15812-13-adobriyan@gmail.com Signed-off-by: Alexey Dobriyan Acked-by: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 2b4417aa15d86..2a0eabeff78f0 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@ -99,7 +99,7 @@ struct kmem_cache { int refcount; /* Refcount for slab cache destroy */ void (*ctor)(void *); int inuse; /* Offset to metadata */ - int align; /* Alignment */ + unsigned int align; /* Alignment */ unsigned int reserved; /* Reserved bytes at the end of slabs */ unsigned int red_left_pad; /* Left redzone padding size */ const char *name; /* Name (only for display!) */ diff --git a/mm/slub.c b/mm/slub.c index e38221c13b073..7b081b4d2760e 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -4896,7 +4896,7 @@ SLAB_ATTR_RO(slab_size); static ssize_t align_show(struct kmem_cache *s, char *buf) { - return sprintf(buf, "%d\n", s->align); + return sprintf(buf, "%u\n", s->align); } SLAB_ATTR_RO(align);