[PATCH] gfp flags annotations - part 1

- added typedef unsigned int __nocast gfp_t;

 - replaced __nocast uses for gfp flags with gfp_t - it gives exactly
   the same warnings as far as sparse is concerned, doesn't change
   generated code (from gcc point of view we replaced unsigned int with
   typedef) and documents what's going on far better.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Al Viro
2005-10-07 07:46:04 +01:00
committed by Linus Torvalds
parent 3b0e77bd14
commit dd0fc66fb3
145 changed files with 340 additions and 360 deletions

View File

@ -81,7 +81,7 @@ typedef unsigned long xfs_pflags_t;
*(NSTATEP) = *(OSTATEP); \
} while (0)
static __inline unsigned int kmem_flags_convert(unsigned int __nocast flags)
static __inline unsigned int kmem_flags_convert(gfp_t flags)
{
unsigned int lflags = __GFP_NOWARN; /* we'll report problems, if need be */
@ -125,13 +125,12 @@ kmem_zone_destroy(kmem_zone_t *zone)
BUG();
}
extern void *kmem_zone_zalloc(kmem_zone_t *, unsigned int __nocast);
extern void *kmem_zone_alloc(kmem_zone_t *, unsigned int __nocast);
extern void *kmem_zone_zalloc(kmem_zone_t *, gfp_t);
extern void *kmem_zone_alloc(kmem_zone_t *, gfp_t);
extern void *kmem_alloc(size_t, unsigned int __nocast);
extern void *kmem_realloc(void *, size_t, size_t,
unsigned int __nocast);
extern void *kmem_zalloc(size_t, unsigned int __nocast);
extern void *kmem_alloc(size_t, gfp_t);
extern void *kmem_realloc(void *, size_t, size_t, gfp_t);
extern void *kmem_zalloc(size_t, gfp_t);
extern void kmem_free(void *, size_t);
typedef struct shrinker *kmem_shaker_t;