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

[PATCH] propagate __nocast annotations

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Alexey Dobriyan and committed by
Linus Torvalds
0db925af b84c2157

+13 -11
+2 -2
include/linux/gfp.h
··· 12 12 * GFP bitmasks.. 13 13 */ 14 14 /* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ 15 - #define __GFP_DMA 0x01 16 - #define __GFP_HIGHMEM 0x02 15 + #define __GFP_DMA 0x01u 16 + #define __GFP_HIGHMEM 0x02u 17 17 18 18 /* 19 19 * Action modifiers - doesn't change the zoning
+2 -2
include/linux/slab.h
··· 65 65 extern void kmem_cache_free(kmem_cache_t *, void *); 66 66 extern unsigned int kmem_cache_size(kmem_cache_t *); 67 67 extern const char *kmem_cache_name(kmem_cache_t *); 68 - extern kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags); 68 + extern kmem_cache_t *kmem_find_general_cachep(size_t size, unsigned int __nocast gfpflags); 69 69 70 70 /* Size description struct for general caches. */ 71 71 struct cache_sizes { ··· 105 105 106 106 #ifdef CONFIG_NUMA 107 107 extern void *kmem_cache_alloc_node(kmem_cache_t *, int flags, int node); 108 - extern void *kmalloc_node(size_t size, int flags, int node); 108 + extern void *kmalloc_node(size_t size, unsigned int __nocast flags, int node); 109 109 #else 110 110 static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node) 111 111 {
+1 -1
include/linux/string.h
··· 88 88 extern void * memchr(const void *,int,__kernel_size_t); 89 89 #endif 90 90 91 - extern char *kstrdup(const char *s, int gfp); 91 + extern char *kstrdup(const char *s, unsigned int __nocast gfp); 92 92 93 93 #ifdef __cplusplus 94 94 }
+1 -1
mm/mempool.c
··· 205 205 void *element; 206 206 unsigned long flags; 207 207 wait_queue_t wait; 208 - int gfp_temp; 208 + unsigned int gfp_temp; 209 209 210 210 might_sleep_if(gfp_mask & __GFP_WAIT); 211 211
+7 -5
mm/slab.c
··· 584 584 return cachep->array[smp_processor_id()]; 585 585 } 586 586 587 - static inline kmem_cache_t *__find_general_cachep(size_t size, int gfpflags) 587 + static inline kmem_cache_t *__find_general_cachep(size_t size, 588 + unsigned int __nocast gfpflags) 588 589 { 589 590 struct cache_sizes *csizep = malloc_sizes; 590 591 ··· 609 608 return csizep->cs_cachep; 610 609 } 611 610 612 - kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags) 611 + kmem_cache_t *kmem_find_general_cachep(size_t size, 612 + unsigned int __nocast gfpflags) 613 613 { 614 614 return __find_general_cachep(size, gfpflags); 615 615 } ··· 2102 2100 #if DEBUG 2103 2101 static void * 2104 2102 cache_alloc_debugcheck_after(kmem_cache_t *cachep, 2105 - unsigned long flags, void *objp, void *caller) 2103 + unsigned int __nocast flags, void *objp, void *caller) 2106 2104 { 2107 2105 if (!objp) 2108 2106 return objp; ··· 2444 2442 } 2445 2443 EXPORT_SYMBOL(kmem_cache_alloc_node); 2446 2444 2447 - void *kmalloc_node(size_t size, int flags, int node) 2445 + void *kmalloc_node(size_t size, unsigned int __nocast flags, int node) 2448 2446 { 2449 2447 kmem_cache_t *cachep; 2450 2448 ··· 3096 3094 * @s: the string to duplicate 3097 3095 * @gfp: the GFP mask used in the kmalloc() call when allocating memory 3098 3096 */ 3099 - char *kstrdup(const char *s, int gfp) 3097 + char *kstrdup(const char *s, unsigned int __nocast gfp) 3100 3098 { 3101 3099 size_t len; 3102 3100 char *buf;