All of lore.kernel.org
 help / color / mirror / Atom feed
From: ben@simtec.co.uk (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mach-osiris-dvs.c: Convert boolean bit tests to logical tests
Date: Mon, 04 Jan 2010 11:45:32 +0900	[thread overview]
Message-ID: <4B41564C.6080802@simtec.co.uk> (raw)
In-Reply-To: <1262539781.1932.128.camel@Joe-Laptop.home>

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

WARNING: multiple messages have this Message-ID (diff)
From: Ben Dooks <ben@simtec.co.uk>
To: Joe Perches <joe@perches.com>
Cc: Ben Dooks <ben-linux@fluff.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] mach-osiris-dvs.c: Convert boolean bit tests to logical tests
Date: Mon, 04 Jan 2010 11:45:32 +0900	[thread overview]
Message-ID: <4B41564C.6080802@simtec.co.uk> (raw)
In-Reply-To: <1262539781.1932.128.camel@Joe-Laptop.home>

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


  reply	other threads:[~2010-01-04  2:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2010-01-04  2:45   ` Ben Dooks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B41564C.6080802@simtec.co.uk \
    --to=ben@simtec.co.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.