public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: Roland Dreier <rdreier@cisco.com>
Cc: riku.voipio@iki.fi, rpurdie@rpsys.net,
	lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH v2] leds: Fix &&/|| confusion
Date: Fri, 06 Feb 2009 19:51:13 +0100	[thread overview]
Message-ID: <498C86A1.8030404@gmail.com> (raw)
In-Reply-To: <adaiqnnxwxm.fsf@cisco.com>

Roland Dreier wrote:
>  > -	if (type != EV_SND && (code != SND_BELL || code != SND_TONE))
>  > +	if (type != EV_SND && (code != SND_BELL && code != SND_TONE))
> 
> Actually more likely seems to be
> 
> 	if (type != EV_SND || (code != SND_BELL && code != SND_TONE))

Thanks for your review,

----------------------->8--------------8<-------------------------------
Fix &&/|| confusion

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
index 76ec749..11d3f1e 100644
--- a/drivers/leds/leds-pca9532.c
+++ b/drivers/leds/leds-pca9532.c
@@ -169,7 +169,7 @@ static int pca9532_event(struct input_dev *dev, unsigned int type,
 {
 	struct pca9532_data *data = input_get_drvdata(dev);
 
-	if (type != EV_SND && (code != SND_BELL || code != SND_TONE))
+	if (type != EV_SND || (code != SND_BELL && code != SND_TONE))
 		return -1;
 
 	/* XXX: allow different kind of beeps with psc/pwm modifications */

  reply	other threads:[~2009-02-06 18:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03 15:34 [PATCH] leds: always true: (x != 1 || x != 2) Roel Kluin
2009-02-06 18:05 ` Roland Dreier
2009-02-06 18:51   ` Roel Kluin [this message]
2009-03-03 20:13     ` [PATCH v2] leds: Fix &&/|| confusion Riku Voipio

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=498C86A1.8030404@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdreier@cisco.com \
    --cc=riku.voipio@iki.fi \
    --cc=rpurdie@rpsys.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox