summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@crashcourse.ca>2008-02-06 01:36:51 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 10:41:03 -0800
commit67a3b2b6ce09809b21f60401e81663f2c8131640 (patch)
tree59005e55d1292762dca1bf58da81c3661982a905 /drivers/block
parent2118116e5ed2432a054d52f9925dbf92d2cb7279 (diff)
downloadop-kernel-dev-67a3b2b6ce09809b21f60401e81663f2c8131640.zip
op-kernel-dev-67a3b2b6ce09809b21f60401e81663f2c8131640.tar.gz
rd: use is_power_of_2() in drivers/block/rd.c.
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/rd.c b/drivers/block/rd.c
index 82f4eec..06e23be 100644
--- a/drivers/block/rd.c
+++ b/drivers/block/rd.c
@@ -56,6 +56,7 @@
#include <linux/backing-dev.h>
#include <linux/blkpg.h>
#include <linux/writeback.h>
+#include <linux/log2.h>
#include <asm/uaccess.h>
@@ -450,7 +451,7 @@ static int __init rd_init(void)
err = -ENOMEM;
if (rd_blocksize > PAGE_SIZE || rd_blocksize < 512 ||
- (rd_blocksize & (rd_blocksize-1))) {
+ !is_power_of_2(rd_blocksize)) {
printk("RAMDISK: wrong blocksize %d, reverting to defaults\n",
rd_blocksize);
rd_blocksize = BLOCK_SIZE;
OpenPOWER on IntegriCloud