mirror of
https://github.com/torvalds/linux.git
synced 2024-11-12 15:11:50 +00:00
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>
This commit is contained in:
parent
2118116e5e
commit
67a3b2b6ce
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user