Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

agp: change agp_free_page_array to use kvfree

Change agp_free_page_array to use kvfree function,
remove the duplicated code.

Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Wang, Yalin and committed by
Dave Airlie
e4100553 b3869b17

+4 -12
+4 -1
drivers/char/agp/agp.h
··· 219 219 /* generic functions for user-populated AGP memory types */ 220 220 struct agp_memory *agp_generic_alloc_user(size_t page_count, int type); 221 221 void agp_alloc_page_array(size_t size, struct agp_memory *mem); 222 - void agp_free_page_array(struct agp_memory *mem); 222 + static inline void agp_free_page_array(struct agp_memory *mem) 223 + { 224 + kvfree(mem->pages); 225 + } 223 226 224 227 225 228 /* generic routines for agp>=3 */
-11
drivers/char/agp/generic.c
··· 98 98 } 99 99 EXPORT_SYMBOL(agp_alloc_page_array); 100 100 101 - void agp_free_page_array(struct agp_memory *mem) 102 - { 103 - if (is_vmalloc_addr(mem->pages)) { 104 - vfree(mem->pages); 105 - } else { 106 - kfree(mem->pages); 107 - } 108 - } 109 - EXPORT_SYMBOL(agp_free_page_array); 110 - 111 - 112 101 static struct agp_memory *agp_create_user_memory(unsigned long num_agp_pages) 113 102 { 114 103 struct agp_memory *new;