]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/agp/i460-agp.c
fix historic ioremap() abuse in AGP
[linux-2.6-omap-h63xx.git] / drivers / char / agp / i460-agp.c
index 70117df4d06779c490e88db53b1361a752a2d742..76f581c85a7d5697120668c3bfcea4a5b1b445ce 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/agp_backend.h>
+#include <linux/log2.h>
 
 #include "agp.h"
 
@@ -59,8 +60,6 @@
  */
 #define WR_FLUSH_GATT(index)   RD_GATT(index)
 
-#define log2(x)                        ffz(~(x))
-
 static struct {
        void *gatt;                             /* ioremap'd GATT area */
 
@@ -148,7 +147,7 @@ static int i460_fetch_size (void)
                 * values[i].size.
                 */
                values[i].num_entries = (values[i].size << 8) >> (I460_IO_PAGE_SHIFT - 12);
-               values[i].page_order = log2((sizeof(u32)*values[i].num_entries) >> PAGE_SHIFT);
+               values[i].page_order = ilog2((sizeof(u32)*values[i].num_entries) >> PAGE_SHIFT);
        }
 
        for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) {
@@ -528,7 +527,6 @@ static void *i460_alloc_page (struct agp_bridge_data *bridge)
 
        if (I460_IO_PAGE_SHIFT <= PAGE_SHIFT) {
                page = agp_generic_alloc_page(agp_bridge);
-               global_flush_tlb();
        } else
                /* Returning NULL would cause problems */
                /* AK: really dubious code. */
@@ -540,7 +538,6 @@ static void i460_destroy_page (void *page, int flags)
 {
        if (I460_IO_PAGE_SHIFT <= PAGE_SHIFT) {
                agp_generic_destroy_page(page, flags);
-               global_flush_tlb();
        }
 }