linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] leds: always true: (x != 1 || x != 2)
@ 2009-02-03 15:34 Roel Kluin
  2009-02-06 18:05 ` Roland Dreier
  0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2009-02-03 15:34 UTC (permalink / raw)
  To: riku.voipio, rpurdie, lkml

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 */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-03 20:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).