is_power_of_2 in drivers/s390/cio
Subsystems (3)
Replacing n & (n - 1) for power of 2 check by is_power_of_2(n)
Signed-off-by vignesh babu <[email protected]>
---
drivers/s390/cio/device_fsm.c +2 -1
@@ -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. */
Signature · 12 lines
Vignesh Babu BM _____________________________________________________________ "Why is it that every time I'm with you, makes me believe in magic?" _______________________________________________ REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon. To resubscribe, send email to [email protected] with "subscribe kernel-janitors" in message body and follow instructions. Kernel-janitors mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
Quoted 17 lines · vignesh babu
Replacing n & (n - 1) for power of 2 check by
is_power_of_2(n)Signed-off-by vignesh babu <[email protected]>---
drivers/s390/cio/device_fsm.c +1
-0@@ -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>
drivers/s390/cio/device_fsm.c device_trigger_reprobe(struct subchannel *sch) · line 1136
Quoted 8 lines
drivers/s390/cio/device_fsm.c +1
-1@@ -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.
_______________________________________________
REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon. To resubscribe, send email to [email protected] with
"subscribe kernel-janitors" in message body and follow instructions.
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors