Skip to content

Commit 0e4f2c4

Browse files
rpptarndb
authored andcommitted
char/agp: consolidate {alloc,free}_gatt_pages()
There is a copy of alloc_gatt_pages() and free_gatt_pages in several architectures in arch/$ARCH/include/asm/agp.h. All the copies do exactly the same: alias alloc_gatt_pages() to __get_free_pages(GFP_KERNEL) and alias free_gatt_pages() to free_pages(). Define alloc_gatt_pages() and free_gatt_pages() in drivers/char/agp/agp.h and drop per-architecture definitions. Signed-off-by: Mike Rapoport (IBM) <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 6246541 commit 0e4f2c4

File tree

7 files changed

+6
-36
lines changed

7 files changed

+6
-36
lines changed

arch/alpha/include/asm/agp.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,4 @@
1010
#define unmap_page_from_agp(page) do { } while (0)
1111
#define flush_agp_cache() mb()
1212

13-
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
14-
#define alloc_gatt_pages(order) \
15-
((char *)__get_free_pages(GFP_KERNEL, (order)))
16-
#define free_gatt_pages(table, order) \
17-
free_pages((unsigned long)(table), (order))
18-
1913
#endif

arch/ia64/include/asm/agp.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,4 @@
1818
#define unmap_page_from_agp(page) do { } while (0)
1919
#define flush_agp_cache() mb()
2020

21-
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
22-
#define alloc_gatt_pages(order) \
23-
((char *)__get_free_pages(GFP_KERNEL, (order)))
24-
#define free_gatt_pages(table, order) \
25-
free_pages((unsigned long)(table), (order))
26-
2721
#endif /* _ASM_IA64_AGP_H */

arch/parisc/include/asm/agp.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,4 @@
1212
#define unmap_page_from_agp(page) do { } while (0)
1313
#define flush_agp_cache() mb()
1414

15-
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
16-
#define alloc_gatt_pages(order) \
17-
((char *)__get_free_pages(GFP_KERNEL, (order)))
18-
#define free_gatt_pages(table, order) \
19-
free_pages((unsigned long)(table), (order))
20-
2115
#endif /* _ASM_PARISC_AGP_H */

arch/powerpc/include/asm/agp.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,5 @@
99
#define unmap_page_from_agp(page) do {} while (0)
1010
#define flush_agp_cache() mb()
1111

12-
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
13-
#define alloc_gatt_pages(order) \
14-
((char *)__get_free_pages(GFP_KERNEL, (order)))
15-
#define free_gatt_pages(table, order) \
16-
free_pages((unsigned long)(table), (order))
17-
1812
#endif /* __KERNEL__ */
1913
#endif /* _ASM_POWERPC_AGP_H */

arch/sparc/include/asm/agp.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,4 @@
88
#define unmap_page_from_agp(page) do { } while (0)
99
#define flush_agp_cache() mb()
1010

11-
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
12-
#define alloc_gatt_pages(order) \
13-
((char *)__get_free_pages(GFP_KERNEL, (order)))
14-
#define free_gatt_pages(table, order) \
15-
free_pages((unsigned long)(table), (order))
16-
1711
#endif

arch/x86/include/asm/agp.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,4 @@
2323
*/
2424
#define flush_agp_cache() wbinvd()
2525

26-
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
27-
#define alloc_gatt_pages(order) \
28-
((char *)__get_free_pages(GFP_KERNEL, (order)))
29-
#define free_gatt_pages(table, order) \
30-
free_pages((unsigned long)(table), (order))
31-
3226
#endif /* _ASM_X86_AGP_H */

drivers/char/agp/agp.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,12 @@ void agp3_generic_tlbflush(struct agp_memory *mem);
236236
int agp3_generic_configure(void);
237237
void agp3_generic_cleanup(void);
238238

239+
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
240+
#define alloc_gatt_pages(order) \
241+
((char *)__get_free_pages(GFP_KERNEL, (order)))
242+
#define free_gatt_pages(table, order) \
243+
free_pages((unsigned long)(table), (order))
244+
239245
/* aperture sizes have been standardised since v3 */
240246
#define AGP_GENERIC_SIZES_ENTRIES 11
241247
extern const struct aper_size_info_16 agp3_generic_sizes[];

0 commit comments

Comments
 (0)