Skip to content

Commit dd0fc66

Browse files
Al ViroLinus Torvalds
authored andcommitted
[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>
1 parent 3b0e77b commit dd0fc66

145 files changed

Lines changed: 340 additions & 360 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/cris/arch-v32/drivers/pci/dma.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct dma_coherent_mem {
2424
};
2525

2626
void *dma_alloc_coherent(struct device *dev, size_t size,
27-
dma_addr_t *dma_handle, unsigned int __nocast gfp)
27+
dma_addr_t *dma_handle, gfp_t gfp)
2828
{
2929
void *ret;
3030
struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;

‎arch/i386/kernel/pci-dma.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct dma_coherent_mem {
2323
};
2424

2525
void *dma_alloc_coherent(struct device *dev, size_t size,
26-
dma_addr_t *dma_handle, unsigned int __nocast gfp)
26+
dma_addr_t *dma_handle, gfp_t gfp)
2727
{
2828
void *ret;
2929
struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;

‎arch/ppc64/kernel/bpa_iommu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ static void bpa_map_iommu(void)
310310

311311

312312
static void *bpa_alloc_coherent(struct device *hwdev, size_t size,
313-
dma_addr_t *dma_handle, unsigned int __nocast flag)
313+
dma_addr_t *dma_handle, gfp_t flag)
314314
{
315315
void *ret;
316316

‎arch/ppc64/kernel/dma.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ int dma_set_mask(struct device *dev, u64 dma_mask)
5353
EXPORT_SYMBOL(dma_set_mask);
5454

5555
void *dma_alloc_coherent(struct device *dev, size_t size,
56-
dma_addr_t *dma_handle, unsigned int __nocast flag)
56+
dma_addr_t *dma_handle, gfp_t flag)
5757
{
5858
struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
5959

‎arch/ppc64/kernel/iommu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
519519
* to the dma address (mapping) of the first page.
520520
*/
521521
void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
522-
dma_addr_t *dma_handle, unsigned int __nocast flag)
522+
dma_addr_t *dma_handle, gfp_t flag)
523523
{
524524
void *ret = NULL;
525525
dma_addr_t mapping;

‎arch/ppc64/kernel/pci_direct_iommu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "pci.h"
3232

3333
static void *pci_direct_alloc_coherent(struct device *hwdev, size_t size,
34-
dma_addr_t *dma_handle, unsigned int __nocast flag)
34+
dma_addr_t *dma_handle, gfp_t flag)
3535
{
3636
void *ret;
3737

‎arch/ppc64/kernel/pci_iommu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static inline struct iommu_table *devnode_table(struct device *dev)
7676
* to the dma address (mapping) of the first page.
7777
*/
7878
static void *pci_iommu_alloc_coherent(struct device *hwdev, size_t size,
79-
dma_addr_t *dma_handle, unsigned int __nocast flag)
79+
dma_addr_t *dma_handle, gfp_t flag)
8080
{
8181
return iommu_alloc_coherent(devnode_table(hwdev), size, dma_handle,
8282
flag);

‎arch/ppc64/kernel/vio.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static void vio_unmap_sg(struct device *dev, struct scatterlist *sglist,
218218
}
219219

220220
static void *vio_alloc_coherent(struct device *dev, size_t size,
221-
dma_addr_t *dma_handle, unsigned int __nocast flag)
221+
dma_addr_t *dma_handle, gfp_t flag)
222222
{
223223
return iommu_alloc_coherent(to_vio_dev(dev)->iommu_table, size,
224224
dma_handle, flag);

‎drivers/atm/ambassador.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ static void drain_rx_pools (amb_dev * dev) {
795795
}
796796

797797
static inline void fill_rx_pool (amb_dev * dev, unsigned char pool,
798-
unsigned int __nocast priority)
798+
gfp_t priority)
799799
{
800800
rx_in rx;
801801
amb_rxq * rxq;

‎drivers/atm/firestream.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,8 +1374,7 @@ static void reset_chip (struct fs_dev *dev)
13741374
}
13751375
}
13761376

1377-
static void __devinit *aligned_kmalloc (int size, unsigned int __nocast flags,
1378-
int alignment)
1377+
static void __devinit *aligned_kmalloc (int size, gfp_t flags, int alignment)
13791378
{
13801379
void *t;
13811380

@@ -1466,7 +1465,7 @@ static inline int nr_buffers_in_freepool (struct fs_dev *dev, struct freepool *f
14661465
working again after that... -- REW */
14671466

14681467
static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
1469-
unsigned int __nocast gfp_flags)
1468+
gfp_t gfp_flags)
14701469
{
14711470
struct FS_BPENTRY *qe, *ne;
14721471
struct sk_buff *skb;

0 commit comments

Comments
 (0)