* [lm-sensors] [PATCH 1/?] &&/|| confusion
@ 2009-01-17 13:53 Roel Kluin
2009-01-17 14:02 ` Roel Kluin
2009-01-17 17:15 ` Jean Delvare
0 siblings, 2 replies; 3+ messages in thread
From: Roel Kluin @ 2009-01-17 13:53 UTC (permalink / raw)
To: lm-sensors
&& / || confusion
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c
index 034b2c5..4a1c9fb 100644
--- a/drivers/hwmon/ltc4245.c
+++ b/drivers/hwmon/ltc4245.c
@@ -456,7 +456,7 @@ static int ltc4245_check_control_reg(struct i2c_client *client, u8 reg, u8 bits)
voff1 &= bits;
voff2 &= bits;
- if (v != voff1 || v != voff2)
+ if (v != voff1 && v != voff2)
return -ENODEV;
}
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [lm-sensors] [PATCH 1/?] &&/|| confusion
2009-01-17 13:53 [lm-sensors] [PATCH 1/?] &&/|| confusion Roel Kluin
@ 2009-01-17 14:02 ` Roel Kluin
2009-01-17 17:15 ` Jean Delvare
1 sibling, 0 replies; 3+ messages in thread
From: Roel Kluin @ 2009-01-17 14:02 UTC (permalink / raw)
To: lm-sensors
I wrote:
> diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c
> index 034b2c5..4a1c9fb 100644
> --- a/drivers/hwmon/ltc4245.c
> +++ b/drivers/hwmon/ltc4245.c
> @@ -456,7 +456,7 @@ static int ltc4245_check_control_reg(struct i2c_client *client, u8 reg, u8 bits)
> voff1 &= bits;
> voff2 &= bits;
>
> - if (v != voff1 || v != voff2)
> + if (v != voff1 && v != voff2)
> return -ENODEV;
> }
On second hand I am not so certain this is wrong. If so, sorry for the noise.
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [lm-sensors] [PATCH 1/?] &&/|| confusion
2009-01-17 13:53 [lm-sensors] [PATCH 1/?] &&/|| confusion Roel Kluin
2009-01-17 14:02 ` Roel Kluin
@ 2009-01-17 17:15 ` Jean Delvare
1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2009-01-17 17:15 UTC (permalink / raw)
To: lm-sensors
On Sat, 17 Jan 2009 15:02:26 +0100, Roel Kluin wrote:
> I wrote:
> > diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c
> > index 034b2c5..4a1c9fb 100644
> > --- a/drivers/hwmon/ltc4245.c
> > +++ b/drivers/hwmon/ltc4245.c
> > @@ -456,7 +456,7 @@ static int ltc4245_check_control_reg(struct i2c_client *client, u8 reg, u8 bits)
> > voff1 &= bits;
> > voff2 &= bits;
> >
> > - if (v != voff1 || v != voff2)
> > + if (v != voff1 && v != voff2)
> > return -ENODEV;
> > }
>
>
> On second hand I am not so certain this is wrong. If so, sorry for the noise.
The original code looks OK to me.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-17 17:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-17 13:53 [lm-sensors] [PATCH 1/?] &&/|| confusion Roel Kluin
2009-01-17 14:02 ` Roel Kluin
2009-01-17 17:15 ` Jean Delvare
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.