Skip to content

Commit 0db925a

Browse files
Alexey DobriyanLinus Torvalds
authored andcommitted
[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>
1 parent b84c215 commit 0db925a

5 files changed

Lines changed: 13 additions & 11 deletions

File tree

‎include/linux/gfp.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ struct vm_area_struct;
1212
* GFP bitmasks..
1313
*/
1414
/* 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
1717

1818
/*
1919
* Action modifiers - doesn't change the zoning

‎include/linux/slab.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast);
6565
extern void kmem_cache_free(kmem_cache_t *, void *);
6666
extern unsigned int kmem_cache_size(kmem_cache_t *);
6767
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);
6969

7070
/* Size description struct for general caches. */
7171
struct cache_sizes {
@@ -105,7 +105,7 @@ extern unsigned int ksize(const void *);
105105

106106
#ifdef CONFIG_NUMA
107107
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);
109109
#else
110110
static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node)
111111
{

‎include/linux/string.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ extern int memcmp(const void *,const void *,__kernel_size_t);
8888
extern void * memchr(const void *,int,__kernel_size_t);
8989
#endif
9090

91-
extern char *kstrdup(const char *s, int gfp);
91+
extern char *kstrdup(const char *s, unsigned int __nocast gfp);
9292

9393
#ifdef __cplusplus
9494
}

‎mm/mempool.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void * mempool_alloc(mempool_t *pool, unsigned int __nocast gfp_mask)
205205
void *element;
206206
unsigned long flags;
207207
wait_queue_t wait;
208-
int gfp_temp;
208+
unsigned int gfp_temp;
209209

210210
might_sleep_if(gfp_mask & __GFP_WAIT);
211211

‎mm/slab.c‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,8 @@ static inline struct array_cache *ac_data(kmem_cache_t *cachep)
584584
return cachep->array[smp_processor_id()];
585585
}
586586

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)
588589
{
589590
struct cache_sizes *csizep = malloc_sizes;
590591

@@ -608,7 +609,8 @@ static inline kmem_cache_t *__find_general_cachep(size_t size, int gfpflags)
608609
return csizep->cs_cachep;
609610
}
610611

611-
kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags)
612+
kmem_cache_t *kmem_find_general_cachep(size_t size,
613+
unsigned int __nocast gfpflags)
612614
{
613615
return __find_general_cachep(size, gfpflags);
614616
}
@@ -2100,7 +2102,7 @@ cache_alloc_debugcheck_before(kmem_cache_t *cachep, unsigned int __nocast flags)
21002102
#if DEBUG
21012103
static void *
21022104
cache_alloc_debugcheck_after(kmem_cache_t *cachep,
2103-
unsigned long flags, void *objp, void *caller)
2105+
unsigned int __nocast flags, void *objp, void *caller)
21042106
{
21052107
if (!objp)
21062108
return objp;
@@ -2442,7 +2444,7 @@ void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int nodeid)
24422444
}
24432445
EXPORT_SYMBOL(kmem_cache_alloc_node);
24442446

2445-
void *kmalloc_node(size_t size, int flags, int node)
2447+
void *kmalloc_node(size_t size, unsigned int __nocast flags, int node)
24462448
{
24472449
kmem_cache_t *cachep;
24482450

@@ -3094,7 +3096,7 @@ unsigned int ksize(const void *objp)
30943096
* @s: the string to duplicate
30953097
* @gfp: the GFP mask used in the kmalloc() call when allocating memory
30963098
*/
3097-
char *kstrdup(const char *s, int gfp)
3099+
char *kstrdup(const char *s, unsigned int __nocast gfp)
30983100
{
30993101
size_t len;
31003102
char *buf;

0 commit comments

Comments
 (0)