Re: [kj] is_power_of_2 in drivers/s390/block/dasd_int.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 13, 2007 at 06:23:59PM +0530, vignesh babu wrote:
> Replacing n & (n - 1) for power of 2 check by is_power_of_2(n)
> 
> Signed-off-by: vignesh babu <vignesh.babu@xxxxxxxxx>
> ---
> diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
> index aeda526..d427dae 100644
> --- a/drivers/s390/block/dasd_int.h
> +++ b/drivers/s390/block/dasd_int.h
> @@ -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;
>  }

Added to our patch queue. Thanks.
-
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux