diff options
author | Fengguang Wu <fengguang.wu@gmail.com> | 2007-10-17 02:26:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:48 -0400 |
commit | e57aa839cea13852e07ecb495692b602b11136c9 (patch) | |
tree | 5296984f012e1483519f87af55c617fcbf186073 /drivers/char/agp/parisc-agp.c | |
parent | bf020cb7b3918e186309db21d75cb91ebafc9d6f (diff) |
convert ill defined log2() to ilog2()
It's *wrong* to have
#define log2(n) ffz(~(n))
It should be *reversed*:
#define log2(n) flz(~(n))
or
#define log2(n) fls(n)
or just use
ilog2(n) defined in linux/log2.h.
This patch follows the last solution, recommended by Andrew Morton.
Cc: <linux-ext4@vger.kernel.org>
Cc: Mingming Cao <cmm@us.ibm.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Chris Ahna <christopher.j.ahna@intel.com>
Cc: David Mosberger-Tang <davidm@hpl.hp.com>
Cc: Kyle McMartin <kyle@parisc-linux.org>
Cc: Dave Airlie <airlied@linux.ie>
Cc: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/agp/parisc-agp.c')
-rw-r--r-- | drivers/char/agp/parisc-agp.c | 7 |
1 files changed, 2 insertions, 5 deletions
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 | ||