From: Alexey Dobriyan Date: Thu, 5 Apr 2018 23:21:43 +0000 (-0700) Subject: slub: make size_from_object() return unsigned int X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=870b1fbb036c0e115aeb8a48478643c16b73d204;p=linux.git slub: make size_from_object() return unsigned int Function returns size of the object without red zone which can't be negative. Link: http://lkml.kernel.org/r/20180305200730.15812-24-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/mm/slub.c b/mm/slub.c index 21e9de8f8d3a9..f48d942a487e3 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -466,7 +466,7 @@ static void get_map(struct kmem_cache *s, struct page *page, unsigned long *map) set_bit(slab_index(p, s, addr), map); } -static inline int size_from_object(struct kmem_cache *s) +static inline unsigned int size_from_object(struct kmem_cache *s) { if (s->flags & SLAB_RED_ZONE) return s->size - s->red_left_pad;