Bit tests on booleans seem odd, logical tests more appropriate
Signed-off-by: Joe Perches <[email protected]>
diff --git a/arch/arm/mach-s3c2440/mach-osiris-dvs.c b/arch/arm/mach-s3c2440/mach-osiris-dvs.c
index ad2792d..2367606 100644
--- a/arch/arm/mach-s3c2440/mach-osiris-dvs.c
+++ b/arch/arm/mach-s3c2440/mach-osiris-dvs.c
@@ -69,16 +69,14 @@ static int osiris_dvs_notify(struct notifier_block *nb,
switch (val) {
case CPUFREQ_PRECHANGE:
- if (old_dvs & !new_dvs ||
- cur_dvs & !new_dvs) {
+ if ((old_dvs && !new_dvs) || (cur_dvs && !new_dvs)) {
pr_debug("%s: exiting dvs\n", __func__);
cur_dvs = false;
gpio_set_value(OSIRIS_GPIO_DVS, 1);
}
break;
case CPUFREQ_POSTCHANGE:
- if (!old_dvs & new_dvs ||
- !cur_dvs & new_dvs) {
+ if ((!old_dvs && new_dvs) || (!cur_dvs && new_dvs)) {
pr_debug("entering dvs\n");
cur_dvs = true;
gpio_set_value(OSIRIS_GPIO_DVS, 0);
Joe Perches wrote:
> Bit tests on booleans seem odd, logical tests more appropriate
I think this is ok, don't currently have any hardware on hand to
test it.
> Signed-off-by: Joe Perches <[email protected]>
Ackced-by: Ben Dooks <[email protected]>
> diff --git a/arch/arm/mach-s3c2440/mach-osiris-dvs.c b/arch/arm/mach-s3c2440/mach-osiris-dvs.c
> index ad2792d..2367606 100644
> --- a/arch/arm/mach-s3c2440/mach-osiris-dvs.c
> +++ b/arch/arm/mach-s3c2440/mach-osiris-dvs.c
> @@ -69,16 +69,14 @@ static int osiris_dvs_notify(struct notifier_block *nb,
>
> switch (val) {
> case CPUFREQ_PRECHANGE:
> - if (old_dvs & !new_dvs ||
> - cur_dvs & !new_dvs) {
> + if ((old_dvs && !new_dvs) || (cur_dvs && !new_dvs)) {
> pr_debug("%s: exiting dvs\n", __func__);
> cur_dvs = false;
> gpio_set_value(OSIRIS_GPIO_DVS, 1);
> }
> break;
> case CPUFREQ_POSTCHANGE:
> - if (!old_dvs & new_dvs ||
> - !cur_dvs & new_dvs) {
> + if ((!old_dvs && new_dvs) || (!cur_dvs && new_dvs)) {
> pr_debug("entering dvs\n");
> cur_dvs = true;
> gpio_set_value(OSIRIS_GPIO_DVS, 0);
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel