From: Alexey Dobriyan <adobriyan@xxxxxxxxx> Subject: slub: make ->align unsigned int Kmem cache alignment can't be negative. Link: http://lkml.kernel.org/r/20180305200730.15812-13-adobriyan@xxxxxxxxx Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx> Acked-by: Christoph Lameter <cl@xxxxxxxxx> Cc: Pekka Enberg <penberg@xxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/slub_def.h | 2 +- mm/slub.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff -puN include/linux/slub_def.h~slub-make-align-unsigned-int include/linux/slub_def.h --- a/include/linux/slub_def.h~slub-make-align-unsigned-int +++ a/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 -puN mm/slub.c~slub-make-align-unsigned-int mm/slub.c --- a/mm/slub.c~slub-make-align-unsigned-int +++ a/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); _ -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html