]> Pileus Git - ~andy/linux/blobdiff - drivers/md/dm-stripe.c
Merge branch 'alpm' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
[~andy/linux] / drivers / md / dm-stripe.c
index 51f5e0760012dd76c35d939bb18862a20e2ee435..969944a8aba2dd0b06dab4191e8b3136ba08bf58 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/blkdev.h>
 #include <linux/bio.h>
 #include <linux/slab.h>
+#include <linux/log2.h>
 
 #define DM_MSG_PREFIX "striped"
 
@@ -99,7 +100,7 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
        /*
         * chunk_size is a power of two
         */
-       if (!chunk_size || (chunk_size & (chunk_size - 1)) ||
+       if (!is_power_of_2(chunk_size) ||
            (chunk_size < (PAGE_SIZE >> SECTOR_SHIFT))) {
                ti->error = "Invalid chunk size";
                return -EINVAL;