Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] mm/slab: fix sparse warnings

Fix the sparse warning "implicit cast to nocast type"

Signed-off-by: Victor Fusco <victor@cetuc.puc-rio.br>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Victor Fusco and committed by
Linus Torvalds
b2d55073 dfc866e5

+4 -3
+2 -1
include/linux/slab.h
··· 118 118 extern unsigned int ksize(const void *); 119 119 120 120 #ifdef CONFIG_NUMA 121 - extern void *kmem_cache_alloc_node(kmem_cache_t *, int flags, int node); 121 + extern void *kmem_cache_alloc_node(kmem_cache_t *, 122 + unsigned int __nocast flags, int node); 122 123 extern void *kmalloc_node(size_t size, unsigned int __nocast flags, int node); 123 124 #else 124 125 static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node)
+2 -2
mm/slab.c
··· 1720 1720 cachep->objsize = size; 1721 1721 1722 1722 if (flags & CFLGS_OFF_SLAB) 1723 - cachep->slabp_cache = kmem_find_general_cachep(slab_size,0); 1723 + cachep->slabp_cache = kmem_find_general_cachep(slab_size, 0u); 1724 1724 cachep->ctor = ctor; 1725 1725 cachep->dtor = dtor; 1726 1726 cachep->name = name; ··· 2839 2839 * New and improved: it will now make sure that the object gets 2840 2840 * put on the correct node list so that there is no false sharing. 2841 2841 */ 2842 - void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int nodeid) 2842 + void *kmem_cache_alloc_node(kmem_cache_t *cachep, unsigned int __nocast flags, int nodeid) 2843 2843 { 2844 2844 unsigned long save_flags; 2845 2845 void *ptr;