From: Roel Kluin <roel.kluin@gmail.com>
To: riku.voipio@iki.fi, rpurdie@rpsys.net,
lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] leds: always true: (x != 1 || x != 2)
Date: Tue, 03 Feb 2009 16:34:20 +0100 [thread overview]
Message-ID: <498863FC.1090008@gmail.com> (raw)
see vi include/linux/input.h +710:
#define SND_BELL 0x01
#define SND_TONE 0x02
so (code != SND_BELL || code != SND_TONE) is always true
I think this was intended?
--------------------->8------------------8<-----------------------
(code != SND_BELL || code != SND_TONE) is always true
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..6a481cf 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 */
next reply other threads:[~2009-02-03 15:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-03 15:34 Roel Kluin [this message]
2009-02-06 18:05 ` [PATCH] leds: always true: (x != 1 || x != 2) Roland Dreier
2009-02-06 18:51 ` [PATCH v2] leds: Fix &&/|| confusion Roel Kluin
2009-03-03 20:13 ` 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=498863FC.1090008@gmail.com \
--to=roel.kluin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--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