Commit e108cebb authored by vignesh babu's avatar vignesh babu Committed by Martin Schwidefsky
Browse files

[S390] is_power_of_2 in drivers/s390/block/dasd_int.h



Replacing n & (n - 1) for power of 2 check by is_power_of_2(n)
Signed-off-by: default avatarvignesh babu <vignesh.babu@wipro.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent b18a2db4
......@@ -53,6 +53,7 @@
#include <linux/genhd.h>
#include <linux/hdreg.h>
#include <linux/interrupt.h>
#include <linux/log2.h>
#include <asm/ccwdev.h>
#include <linux/workqueue.h>
#include <asm/debug.h>
......@@ -456,7 +457,7 @@ dasd_free_chunk(struct list_head *chunk_list, void *mem)
static inline int
dasd_check_blocksize(int bsize)
{
if (bsize < 512 || bsize > 4096 || (bsize & (bsize - 1)) != 0)
if (bsize < 512 || bsize > 4096 || !is_power_of_2(bsize))
return -EMEDIUMTYPE;
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment