On Wednesday 23 May 2007, Jean Delvare wrote:
> > --- g26.orig/drivers/hwmon/lm70.c   2007-05-22 09:00:24.000000000 -0700
> > +++ g26/drivers/hwmon/lm70.c        2007-05-22 09:06:44.000000000 -0700
> > @@ -96,6 +96,10 @@ static int __devinit lm70_probe(struct s
> >     struct lm70 *p_lm70;
> >     int status;
> >  
> > +   /* signaling is SPI_MODE_0 on a 3-wire link (shared SI/SO) */
> > +   if ((spi->mode & (SPI_CPOL|SPI_CPHA)) || !spi->mode & SPI_3WIRE)
> 
> I don't know anything about SPI, but the second half of the test looks
> broken to me. Missing parentheses?

Right, my bad ... Kaiwan would surely have seen that in his testing
(by next week, I'm told).

Andrew:  incremental fix appended.


> Also note that (SPI_CPOL|SPI_CPHA) 
> is SPI_MODE_3 according to the defines above, maybe you want to use
> that.

No; I wanted to explicitly highlight that neither mode bit may be set.
It's not obvious that "mode 3" would be valid as a mask.

- Dave


======  CUT HERE
Add missing parenthesis ... evidently GCC warns inconsistently.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
---
 drivers/hwmon/lm70.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- g26.orig/drivers/hwmon/lm70.c       2007-05-23 08:30:36.000000000 -0700
+++ g26/drivers/hwmon/lm70.c    2007-05-23 08:40:52.000000000 -0700
@@ -97,7 +97,7 @@ static int __devinit lm70_probe(struct s
        int status;
 
        /* signaling is SPI_MODE_0 on a 3-wire link (shared SI/SO) */
-       if ((spi->mode & (SPI_CPOL|SPI_CPHA)) || !spi->mode & SPI_3WIRE)
+       if ((spi->mode & (SPI_CPOL|SPI_CPHA)) || !(spi->mode & SPI_3WIRE))
                return -EINVAL;
 
        p_lm70 = kzalloc(sizeof *p_lm70, GFP_KERNEL);

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to