From e4d01ea57263db1df08eaec2dc74be83178d312e Mon Sep 17 00:00:00 2001 From: Vignesh Babu BM Date: Tue, 8 May 2007 00:24:32 -0700 Subject: [PATCH] --- yaml --- r: 54553 b: refs/heads/master c: 1368c4f2482c9e06bcb297217433818b171cc9e3 h: refs/heads/master i: 54551: d582bf966b7ebfa3a769b5a4c54c954ee3aa5ac2 v: v3 --- [refs] | 2 +- trunk/fs/block_dev.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index a545ca408c11..fe46e6725d4d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e1b5c1d3da05c91129120d045dfcdfc7761f44f1 +refs/heads/master: 1368c4f2482c9e06bcb297217433818b171cc9e3 diff --git a/trunk/fs/block_dev.c b/trunk/fs/block_dev.c index f02b7bdd9864..742899240872 100644 --- a/trunk/fs/block_dev.c +++ b/trunk/fs/block_dev.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "internal.h" @@ -67,7 +68,7 @@ static void kill_bdev(struct block_device *bdev) int set_blocksize(struct block_device *bdev, int size) { /* Size must be a power of two, and between 512 and PAGE_SIZE */ - if (size > PAGE_SIZE || size < 512 || (size & (size-1))) + if (size > PAGE_SIZE || size < 512 || !is_power_of_2(size)) return -EINVAL; /* Size cannot be smaller than the size supported by the device */