diff options
| author | Al Viro <viro@ftp.linux.org.uk> | 2005-10-07 02:46:04 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-08 18:00:57 -0400 |
| commit | dd0fc66fb33cd610bc1a5db8a5e232d34879b4d7 (patch) | |
| tree | 51f96a9db96293b352e358f66032e1f4ff79fafb /include | |
| parent | 3b0e77bd144203a507eb191f7117d2c5004ea1de (diff) | |
[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>
Diffstat (limited to 'include')
48 files changed, 133 insertions, 138 deletions
diff --git a/include/asm-generic/dma-mapping.h b/include/asm-generic/dma-mapping.h index 8cef663c5c..747d790295 100644 --- a/include/asm-generic/dma-mapping.h +++ b/include/asm-generic/dma-mapping.h | |||
| @@ -35,7 +35,7 @@ dma_set_mask(struct device *dev, u64 dma_mask) | |||
| 35 | 35 | ||
| 36 | static inline void * | 36 | static inline void * |
| 37 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | 37 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, |
| 38 | unsigned int __nocast flag) | 38 | gfp_t flag) |
| 39 | { | 39 | { |
| 40 | BUG_ON(dev->bus != &pci_bus_type); | 40 | BUG_ON(dev->bus != &pci_bus_type); |
| 41 | 41 | ||
| @@ -168,7 +168,7 @@ dma_set_mask(struct device *dev, u64 dma_mask) | |||
| 168 | 168 | ||
| 169 | static inline void * | 169 | static inline void * |
| 170 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | 170 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, |
| 171 | unsigned int __nocast flag) | 171 | gfp_t flag) |
| 172 | { | 172 | { |
| 173 | BUG(); | 173 | BUG(); |
| 174 | return NULL; | 174 | return NULL; |
diff --git a/include/asm-i386/dma-mapping.h b/include/asm-i386/dma-mapping.h index 563964b299..e56c335f8e 100644 --- a/include/asm-i386/dma-mapping.h +++ b/include/asm-i386/dma-mapping.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 11 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
| 12 | 12 | ||
| 13 | void *dma_alloc_coherent(struct device *dev, size_t size, | 13 | void *dma_alloc_coherent(struct device *dev, size_t size, |
| 14 | dma_addr_t *dma_handle, unsigned int __nocast flag); | 14 | dma_addr_t *dma_handle, gfp_t flag); |
| 15 | 15 | ||
| 16 | void dma_free_coherent(struct device *dev, size_t size, | 16 | void dma_free_coherent(struct device *dev, size_t size, |
| 17 | void *vaddr, dma_addr_t dma_handle); | 17 | void *vaddr, dma_addr_t dma_handle); |
diff --git a/include/asm-ppc/dma-mapping.h b/include/asm-ppc/dma-mapping.h index 92b8ee78dc..061bfcac1b 100644 --- a/include/asm-ppc/dma-mapping.h +++ b/include/asm-ppc/dma-mapping.h | |||
| @@ -61,7 +61,7 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask) | |||
| 61 | 61 | ||
| 62 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 62 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, |
| 63 | dma_addr_t * dma_handle, | 63 | dma_addr_t * dma_handle, |
| 64 | unsigned int __nocast gfp) | 64 | gfp_t gfp) |
| 65 | { | 65 | { |
| 66 | #ifdef CONFIG_NOT_COHERENT_CACHE | 66 | #ifdef CONFIG_NOT_COHERENT_CACHE |
| 67 | return __dma_alloc_coherent(size, dma_handle, gfp); | 67 | return __dma_alloc_coherent(size, dma_handle, gfp); |
diff --git a/include/asm-ppc64/dma-mapping.h b/include/asm-ppc64/dma-mapping.h index 9ad8adee00..fb68fa23be 100644 --- a/include/asm-ppc64/dma-mapping.h +++ b/include/asm-ppc64/dma-mapping.h | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | extern int dma_supported(struct device *dev, u64 mask); | 19 | extern int dma_supported(struct device *dev, u64 mask); |
| 20 | extern int dma_set_mask(struct device *dev, u64 dma_mask); | 20 | extern int dma_set_mask(struct device *dev, u64 dma_mask); |
| 21 | extern void *dma_alloc_coherent(struct device *dev, size_t size, | 21 | extern void *dma_alloc_coherent(struct device *dev, size_t size, |
| 22 | dma_addr_t *dma_handle, unsigned int __nocast flag); | 22 | dma_addr_t *dma_handle, gfp_t flag); |
| 23 | extern void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, | 23 | extern void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, |
| 24 | dma_addr_t dma_handle); | 24 | dma_addr_t dma_handle); |
| 25 | extern dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, | 25 | extern dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, |
| @@ -118,7 +118,7 @@ dma_cache_sync(void *vaddr, size_t size, | |||
| 118 | */ | 118 | */ |
| 119 | struct dma_mapping_ops { | 119 | struct dma_mapping_ops { |
| 120 | void * (*alloc_coherent)(struct device *dev, size_t size, | 120 | void * (*alloc_coherent)(struct device *dev, size_t size, |
| 121 | dma_addr_t *dma_handle, unsigned int __nocast flag); | 121 | dma_addr_t *dma_handle, gfp_t flag); |
| 122 | void (*free_coherent)(struct device *dev, size_t size, | 122 | void (*free_coherent)(struct device *dev, size_t size, |
| 123 | void *vaddr, dma_addr_t dma_handle); | 123 | void *vaddr, dma_addr_t dma_handle); |
| 124 | dma_addr_t (*map_single)(struct device *dev, void *ptr, | 124 | dma_addr_t (*map_single)(struct device *dev, void *ptr, |
diff --git a/include/asm-ppc64/iommu.h b/include/asm-ppc64/iommu.h index 72dcf8116b..c2f3b6e8a4 100644 --- a/include/asm-ppc64/iommu.h +++ b/include/asm-ppc64/iommu.h | |||
| @@ -122,7 +122,7 @@ extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
| 122 | int nelems, enum dma_data_direction direction); | 122 | int nelems, enum dma_data_direction direction); |
| 123 | 123 | ||
| 124 | extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, | 124 | extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, |
| 125 | dma_addr_t *dma_handle, unsigned int __nocast flag); | 125 | dma_addr_t *dma_handle, gfp_t flag); |
| 126 | extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, | 126 | extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, |
| 127 | void *vaddr, dma_addr_t dma_handle); | 127 | void *vaddr, dma_addr_t dma_handle); |
| 128 | extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, | 128 | extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, |
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index aca9b344bd..e7d0593bb5 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
| @@ -467,7 +467,7 @@ static inline void atm_dev_put(struct atm_dev *dev) | |||
| 467 | 467 | ||
| 468 | int atm_charge(struct atm_vcc *vcc,int truesize); | 468 | int atm_charge(struct atm_vcc *vcc,int truesize); |
| 469 | struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, | 469 | struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, |
| 470 | unsigned int __nocast gfp_flags); | 470 | gfp_t gfp_flags); |
| 471 | int atm_pcr_goal(struct atm_trafprm *tp); | 471 | int atm_pcr_goal(struct atm_trafprm *tp); |
| 472 | 472 | ||
| 473 | void vcc_release_async(struct atm_vcc *vcc, int reply); | 473 | void vcc_release_async(struct atm_vcc *vcc, int reply); |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 6e1c79c8b6..3344b4e8e4 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
| @@ -276,8 +276,8 @@ extern void bio_pair_release(struct bio_pair *dbio); | |||
| 276 | extern struct bio_set *bioset_create(int, int, int); | 276 | extern struct bio_set *bioset_create(int, int, int); |
| 277 | extern void bioset_free(struct bio_set *); | 277 | extern void bioset_free(struct bio_set *); |
| 278 | 278 | ||
| 279 | extern struct bio *bio_alloc(unsigned int __nocast, int); | 279 | extern struct bio *bio_alloc(gfp_t, int); |
| 280 | extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *); | 280 | extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); |
| 281 | extern void bio_put(struct bio *); | 281 | extern void bio_put(struct bio *); |
| 282 | extern void bio_free(struct bio *, struct bio_set *); | 282 | extern void bio_free(struct bio *, struct bio_set *); |
| 283 | 283 | ||
| @@ -287,7 +287,7 @@ extern int bio_phys_segments(struct request_queue *, struct bio *); | |||
| 287 | extern int bio_hw_segments(struct request_queue *, struct bio *); | 287 | extern int bio_hw_segments(struct request_queue *, struct bio *); |
| 288 | 288 | ||
| 289 | extern void __bio_clone(struct bio *, struct bio *); | 289 | extern void __bio_clone(struct bio *, struct bio *); |
| 290 | extern struct bio *bio_clone(struct bio *, unsigned int __nocast); | 290 | extern struct bio *bio_clone(struct bio *, gfp_t); |
| 291 | 291 | ||
| 292 | extern void bio_init(struct bio *); | 292 | extern void bio_init(struct bio *); |
| 293 | 293 | ||
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 9082849379..6a1d154c08 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
| @@ -172,7 +172,7 @@ void __brelse(struct buffer_head *); | |||
