diff options
-rw-r--r-- | drivers/char/agp/hp-agp.c | 9 | ||||
-rw-r--r-- | drivers/char/agp/i460-agp.c | 5 | ||||
-rw-r--r-- | drivers/char/agp/parisc-agp.c | 7 | ||||
-rw-r--r-- | fs/ext4/super.c | 6 |
4 files changed, 9 insertions, 18 deletions
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c index 313a133a1172..cbb0444467ba 100644 --- a/drivers/char/agp/hp-agp.c +++ b/drivers/char/agp/hp-agp.c | |||
@@ -14,15 +14,12 @@ | |||
14 | #include <linux/pci.h> | 14 | #include <linux/pci.h> |
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/agp_backend.h> | 16 | #include <linux/agp_backend.h> |
17 | #include <linux/log2.h> | ||
17 | 18 | ||
18 | #include <asm/acpi-ext.h> | 19 | #include <asm/acpi-ext.h> |
19 | 20 | ||
20 | #include "agp.h" | 21 | #include "agp.h" |
21 | 22 | ||
22 | #ifndef log2 | ||
23 | #define log2(x) ffz(~(x)) | ||
24 | #endif | ||
25 | |||
26 | #define HP_ZX1_IOC_OFFSET 0x1000 /* ACPI reports SBA, we want IOC */ | 23 | #define HP_ZX1_IOC_OFFSET 0x1000 /* ACPI reports SBA, we want IOC */ |
27 | 24 | ||
28 | /* HP ZX1 IOC registers */ | 25 | /* HP ZX1 IOC registers */ |
@@ -257,7 +254,7 @@ hp_zx1_configure (void) | |||
257 | readl(hp->ioc_regs+HP_ZX1_IMASK); | 254 | readl(hp->ioc_regs+HP_ZX1_IMASK); |
258 | writel(hp->iova_base|1, hp->ioc_regs+HP_ZX1_IBASE); | 255 | writel(hp->iova_base|1, hp->ioc_regs+HP_ZX1_IBASE); |
259 | readl(hp->ioc_regs+HP_ZX1_IBASE); | 256 | readl(hp->ioc_regs+HP_ZX1_IBASE); |
260 | writel(hp->iova_base|log2(HP_ZX1_IOVA_SIZE), hp->ioc_regs+HP_ZX1_PCOM); | 257 | writel(hp->iova_base|ilog2(HP_ZX1_IOVA_SIZE), hp->ioc_regs+HP_ZX1_PCOM); |
261 | readl(hp->ioc_regs+HP_ZX1_PCOM); | 258 | readl(hp->ioc_regs+HP_ZX1_PCOM); |
262 | } | 259 | } |
263 | 260 | ||
@@ -285,7 +282,7 @@ hp_zx1_tlbflush (struct agp_memory *mem) | |||
285 | { | 282 | { |
286 | struct _hp_private *hp = &hp_private; | 283 | struct _hp_private *hp = &hp_private; |
287 | 284 | ||
288 | writeq(hp->gart_base | log2(hp->gart_size), hp->ioc_regs+HP_ZX1_PCOM); | 285 | writeq(hp->gart_base | ilog2(hp->gart_size), hp->ioc_regs+HP_ZX1_PCOM); |
289 | readq(hp->ioc_regs+HP_ZX1_PCOM); | 286 | readq(hp->ioc_regs+HP_ZX1_PCOM); |
290 | } | 287 | } |
291 | 288 | ||
diff --git a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c index 70117df4d067..e72a83e2bad5 100644 --- a/drivers/char/agp/i460-agp.c +++ b/drivers/char/agp/i460-agp.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/string.h> | 13 | #include <linux/string.h> |
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/agp_backend.h> | 15 | #include <linux/agp_backend.h> |
16 | #include <linux/log2.h> | ||
16 | 17 | ||
17 | #include "agp.h" | 18 | #include "agp.h" |
18 | 19 | ||
@@ -59,8 +60,6 @@ | |||
59 | */ | 60 | */ |
60 | #define WR_FLUSH_GATT(index) RD_GATT(index) | 61 | #define WR_FLUSH_GATT(index) RD_GATT(index) |
61 | 62 | ||
62 | #define log2(x) ffz(~(x)) | ||
63 | |||
64 | static struct { | 63 | static struct { |
65 | void *gatt; /* ioremap'd GATT area */ | 64 | void *gatt; /* ioremap'd GATT area */ |
66 | 65 | ||
@@ -148,7 +147,7 @@ static int i460_fetch_size (void) | |||
148 | * values[i].size. | 147 | * values[i].size. |
149 | */ | 148 | */ |
150 | values[i].num_entries = (values[i].size << 8) >> (I460_IO_PAGE_SHIFT - 12); | 149 | values[i].num_entries = (values[i].size << 8) >> (I460_IO_PAGE_SHIFT - 12); |
151 | values[i].page_order = log2((sizeof(u32)*values[i].num_entries) >> PAGE_SHIFT); | 150 | values[i].page_order = ilog2((sizeof(u32)*values[i].num_entries) >> PAGE_SHIFT); |
152 | } | 151 | } |
153 | 152 | ||
154 | for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) { | 153 | for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) { |
diff --git a/drivers/char/agp/parisc-agp.c b/drivers/char/agp/parisc-agp.c index f4562cc22343..2939e3570f9d 100644 --- a/drivers/char/agp/parisc-agp.c +++ b/drivers/char/agp/parisc-agp.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/klist.h> | 19 | #include <linux/klist.h> |
20 | #include <linux/agp_backend.h> | 20 | #include <linux/agp_backend.h> |
21 | #include <linux/log2.h> | ||
21 | 22 | ||
22 | #include <asm-parisc/parisc-device.h> | 23 | #include <asm-parisc/parisc-device.h> |
23 | #include <asm-parisc/ropes.h> | 24 | #include <asm-parisc/ropes.h> |
@@ -27,10 +28,6 @@ | |||
27 | #define DRVNAME "quicksilver" | 28 | #define DRVNAME "quicksilver" |
28 | #define DRVPFX DRVNAME ": " | 29 | #define DRVPFX DRVNAME ": " |
29 | 30 | ||
30 | #ifndef log2 | ||
31 | #define log2(x) ffz(~(x)) | ||
32 | #endif | ||
33 | |||
34 | #define AGP8X_MODE_BIT 3 | 31 | #define AGP8X_MODE_BIT 3 |
35 | #define AGP8X_MODE (1 << AGP8X_MODE_BIT) | 32 | #define AGP8X_MODE (1 << AGP8X_MODE_BIT) |
36 | 33 | ||
@@ -92,7 +89,7 @@ parisc_agp_tlbflush(struct agp_memory *mem) | |||
92 | { | 89 | { |
93 | struct _parisc_agp_info *info = &parisc_agp_info; | 90 | struct _parisc_agp_info *info = &parisc_agp_info; |
94 | 91 | ||
95 | writeq(info->gart_base | log2(info->gart_size), info->ioc_regs+IOC_PCOM); | 92 | writeq(info->gart_base | ilog2(info->gart_size), info->ioc_regs+IOC_PCOM); |
96 | readq(info->ioc_regs+IOC_PCOM); /* flush */ | 93 | readq(info->ioc_regs+IOC_PCOM); /* flush */ |
97 | } | 94 | } |
98 | 95 | ||
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 22158ebfae2a..fc3eb79faa49 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1415,8 +1415,6 @@ static void ext4_orphan_cleanup (struct super_block * sb, | |||
1415 | sb->s_flags = s_flags; /* Restore MS_RDONLY status */ | 1415 | sb->s_flags = s_flags; /* Restore MS_RDONLY status */ |
1416 | } | 1416 | } |
1417 | 1417 | ||
1418 | #define log2(n) ffz(~(n)) | ||
1419 | |||
1420 | /* | 1418 | /* |
1421 | * Maximal file size. There is a direct, and {,double-,triple-}indirect | 1419 | * Maximal file size. There is a direct, and {,double-,triple-}indirect |
1422 | * block limit, and also a limit of (2^32 - 1) 512-byte sectors in i_blocks. | 1420 | * block limit, and also a limit of (2^32 - 1) 512-byte sectors in i_blocks. |
@@ -1689,8 +1687,8 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
1689 | sbi->s_desc_per_block = blocksize / EXT4_DESC_SIZE(sb); | 1687 | sbi->s_desc_per_block = blocksize / EXT4_DESC_SIZE(sb); |
1690 | sbi->s_sbh = bh; | 1688 | sbi->s_sbh = bh; |
1691 | sbi->s_mount_state = le16_to_cpu(es->s_state); | 1689 | sbi->s_mount_state = le16_to_cpu(es->s_state); |
1692 | sbi->s_addr_per_block_bits = log2(EXT4_ADDR_PER_BLOCK(sb)); | 1690 | sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb)); |
1693 | sbi->s_desc_per_block_bits = log2(EXT4_DESC_PER_BLOCK(sb)); | 1691 | sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb)); |
1694 | for (i=0; i < 4; i++) | 1692 | for (i=0; i < 4; i++) |
1695 | sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]); | 1693 | sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]); |
1696 | sbi->s_def_hash_version = es->s_def_hash_version; | 1694 | sbi->s_def_hash_version = es->s_def_hash_version; |