* [PATCH] mach-osiris-dvs.c: Convert boolean bit tests to logical tests
@ 2010-01-03 17:29 ` Joe Perches
0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2010-01-03 17:29 UTC (permalink / raw)
To: linux-arm-kernel
Bit tests on booleans seem odd, logical tests more appropriate
Signed-off-by: Joe Perches <joe@perches.com>
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);
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] mach-osiris-dvs.c: Convert boolean bit tests to logical tests
@ 2010-01-03 17:29 ` Joe Perches
0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2010-01-03 17:29 UTC (permalink / raw)
To: Ben Dooks; +Cc: linux-arm-kernel, LKML
Bit tests on booleans seem odd, logical tests more appropriate
Signed-off-by: Joe Perches <joe@perches.com>
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);
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] mach-osiris-dvs.c: Convert boolean bit tests to logical tests
2010-01-03 17:29 ` Joe Perches
@ 2010-01-04 2:45 ` Ben Dooks
-1 siblings, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2010-01-04 2:45 UTC (permalink / raw)
To: linux-arm-kernel
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 <joe@perches.com>
Ackced-by: Ben Dooks <ben-linux@fluff.org>
> 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
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mach-osiris-dvs.c: Convert boolean bit tests to logical tests
@ 2010-01-04 2:45 ` Ben Dooks
0 siblings, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2010-01-04 2:45 UTC (permalink / raw)
To: Joe Perches; +Cc: Ben Dooks, LKML, linux-arm-kernel
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 <joe@perches.com>
Ackced-by: Ben Dooks <ben-linux@fluff.org>
> 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
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-04 3:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-03 17:29 [PATCH] mach-osiris-dvs.c: Convert boolean bit tests to logical tests Joe Perches
2010-01-03 17:29 ` Joe Perches
2010-01-04 2:45 ` Ben Dooks
2010-01-04 2:45 ` Ben Dooks
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.