Re: [kj] is_power_of_2 in drivers/s390/cio

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

 



On Mon, Aug 13, 2007 at 06:25:05PM +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/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
> index 8633dc5..c00ebf4 100644
> --- a/drivers/s390/cio/device_fsm.c
> +++ b/drivers/s390/cio/device_fsm.c
> @@ -12,6 +12,7 @@
>  #include <linux/init.h>
>  #include <linux/jiffies.h>
>  #include <linux/string.h>
> +#include <linux/log2.h>
> 
>  #include <asm/ccwdev.h>
>  #include <asm/cio.h>
> @@ -1129,7 +1130,7 @@ device_trigger_reprobe(struct subchannel *sch)
>  	sch->schib.pmcw.isc = 3;
>  	sch->schib.pmcw.csense = 1;
>  	sch->schib.pmcw.ena = 0;
> -	if ((sch->lpm & (sch->lpm - 1)) != 0)
> +	if (!is_power_of_2(sch->lpm))
>  		sch->schib.pmcw.mp = 1;
>  	sch->schib.pmcw.intparm = (__u32)(unsigned long)sch;
>  	/* We should also udate ssd info, but this has to wait. */

This changes the path taken if sch->lpm == 0. Therefore NOT applied.
-
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