From: Riku Voipio <riku.voipio@iki.fi>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: Roland Dreier <rdreier@cisco.com>,
rpurdie@rpsys.net, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] leds: Fix &&/|| confusion
Date: Tue, 3 Mar 2009 22:13:06 +0200 [thread overview]
Message-ID: <20090303201306.GA1119@kos.to> (raw)
In-Reply-To: <498C86A1.8030404@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]
On Fri, Feb 06, 2009 at 07:51:13PM +0100, Roel Kluin wrote:
> 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,
I think what I want is:
if (!(type==EV_SND && (code == SND_BELL || code == SND_TONE)))
Not that I think anyone would send SND_* without EV_SND.
From 725c752a53a83319042dcdaccf072908b29d1c40 Mon Sep 17 00:00:00 2001
From: Riku Voipio <riku.voipio@iki.fi>
Date: Tue, 3 Mar 2009 22:06:51 +0200
Subject: [PATCH 19/19] [PATCH v2] leds: Fix &&/|| confusion
Thanks to Roel Kluin <roel.kluin@gmail.com> for noticing.
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
drivers/leds/leds-pca9532.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
index a46d208..dba8921 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 */
--
1.6.1.3
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2009-03-03 20:13 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 ` [PATCH v2] leds: Fix &&/|| confusion Roel Kluin
2009-03-03 20:13 ` Riku Voipio [this message]
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=20090303201306.GA1119@kos.to \
--to=riku.voipio@iki.fi \
--cc=linux-kernel@vger.kernel.org \
--cc=rdreier@cisco.com \
--cc=roel.kluin@gmail.com \
--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