Skip to content

Commit

Permalink
[S390] is_power_of_2 in drivers/s390/block/dasd_int.h
Browse files Browse the repository at this point in the history
Replacing n & (n - 1) for power of 2 check by is_power_of_2(n)

Signed-off-by: vignesh babu <vignesh.babu@wipro.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
  • Loading branch information
vignesh babu authored and Martin Schwidefsky committed Oct 12, 2007
1 parent b18a2db commit e108ceb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/s390/block/dasd_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit e108ceb

Please sign in to comment.