diff options
author | vignesh babu <vignesh.babu@wipro.com> | 2007-10-12 10:11:39 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-10-12 10:13:07 -0400 |
commit | e108cebb21316714de43767e242316c784471740 (patch) | |
tree | 2f9a761570437a6d7ed05735c0622c9179613548 /drivers/s390 | |
parent | b18a2db416088ad54a4bfb59c0b932be383aee83 (diff) |
[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: 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>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/block/dasd_int.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h index aeda52682446..d427daeef511 100644 --- a/drivers/s390/block/dasd_int.h +++ b/drivers/s390/block/dasd_int.h | |||
@@ -53,6 +53,7 @@ | |||
53 | #include <linux/genhd.h> | 53 | #include <linux/genhd.h> |
54 | #include <linux/hdreg.h> | 54 | #include <linux/hdreg.h> |
55 | #include <linux/interrupt.h> | 55 | #include <linux/interrupt.h> |
56 | #include <linux/log2.h> | ||
56 | #include <asm/ccwdev.h> | 57 | #include <asm/ccwdev.h> |
57 | #include <linux/workqueue.h> | 58 | #include <linux/workqueue.h> |
58 | #include <asm/debug.h> | 59 | #include <asm/debug.h> |
@@ -456,7 +457,7 @@ dasd_free_chunk(struct list_head *chunk_list, void *mem) | |||
456 | static inline int | 457 | static inline int |
457 | dasd_check_blocksize(int bsize) | 458 | dasd_check_blocksize(int bsize) |
458 | { | 459 | { |
459 | if (bsize < 512 || bsize > 4096 || (bsize & (bsize - 1)) != 0) | 460 | if (bsize < 512 || bsize > 4096 || !is_power_of_2(bsize)) |
460 | return -EMEDIUMTYPE; | 461 | return -EMEDIUMTYPE; |
461 | return 0; | 462 | return 0; |
462 | } | 463 | } |