agp: drop vmalloc flag.
authorDave Airlie <airlied@redhat.com>
Mon, 14 Jun 2010 23:52:37 +0000 (09:52 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 14 Jun 2010 23:56:01 +0000 (09:56 +1000)
Since the code that was too ugly to live is upstream, we can use it now,
instead of rolling our own.

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/char/agp/generic.c
include/linux/agp_backend.h

index 4b51982fd23a23a2c2683bfc3dd87dd1abe6af24..4e414417730b3f91ee616831773fbb522da109bf 100644 (file)
@@ -97,20 +97,18 @@ EXPORT_SYMBOL(agp_flush_chipset);
 void agp_alloc_page_array(size_t size, struct agp_memory *mem)
 {
        mem->pages = NULL;
-       mem->vmalloc_flag = false;
 
        if (size <= 2*PAGE_SIZE)
                mem->pages = kmalloc(size, GFP_KERNEL | __GFP_NORETRY);
        if (mem->pages == NULL) {
                mem->pages = vmalloc(size);
-               mem->vmalloc_flag = true;
        }
 }
 EXPORT_SYMBOL(agp_alloc_page_array);
 
 void agp_free_page_array(struct agp_memory *mem)
 {
-       if (mem->vmalloc_flag) {
+       if (is_vmalloc_addr(mem->pages)) {
                vfree(mem->pages);
        } else {
                kfree(mem->pages);
index 9101ed64f803c64d3158df9aa134d8d4ffd26789..09ea4a1e95058ec4c73a20204c2bdbd8e1895388 100644 (file)
@@ -79,7 +79,6 @@ struct agp_memory {
        u32 physical;
        bool is_bound;
        bool is_flushed;
-       bool vmalloc_flag;
        /* list of agp_memory mapped to the aperture */
        struct list_head mapped_list;
        /* DMA-mapped addresses */