Merge branch 'linus' into x86/i8259
[sfrench/cifs-2.6.git] / drivers / char / agp / i460-agp.c
index 70117df4d06779c490e88db53b1361a752a2d742..e587eebebc67c29d6a09085d873701ec566b4538 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();
        }
 }
 
@@ -583,7 +580,7 @@ const struct agp_bridge_driver intel_i460_driver = {
        .alloc_by_type          = agp_generic_alloc_by_type,
        .free_by_type           = agp_generic_free_by_type,
        .agp_type_to_mask_type  = agp_generic_type_to_mask_type,
-       .cant_use_aperture      = 1,
+       .cant_use_aperture      = true,
 };
 
 static int __devinit agp_intel_i460_probe(struct pci_dev *pdev,