Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/i2c Fix logical errors (&& instead of & in a few pla...



details:   https://anonhg.NetBSD.org/src/rev/435544e13d7c
branches:  trunk
changeset: 779043:435544e13d7c
user:      wiz <wiz%NetBSD.org@localhost>
date:      Sat Apr 28 17:27:08 2012 +0000

description:
Fix logical errors (&& instead of & in a few places).

diffstat:

 sys/dev/i2c/dbcool.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (53 lines):

diff -r b8b8bf398d98 -r 435544e13d7c sys/dev/i2c/dbcool.c
--- a/sys/dev/i2c/dbcool.c      Fri Apr 27 20:58:54 2012 +0000
+++ b/sys/dev/i2c/dbcool.c      Sat Apr 28 17:27:08 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dbcool.c,v 1.35 2011/10/02 19:03:56 jmcneill Exp $ */
+/*     $NetBSD: dbcool.c,v 1.36 2012/04/28 17:27:08 wiz Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.35 2011/10/02 19:03:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.36 2012/04/28 17:27:08 wiz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -818,10 +818,10 @@
        struct dbcool_softc *sc = device_private(dev);
        uint8_t reg, bit, cfg;
 
-       if ((sc->sc_dc.dc_chip->flags && DBCFLAG_HAS_SHDN) == 0)
+       if ((sc->sc_dc.dc_chip->flags & DBCFLAG_HAS_SHDN) == 0)
                return true;
  
-       if (sc->sc_dc.dc_chip->flags && DBCFLAG_ADT7466) {
+       if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADT7466) {
                reg = DBCOOL_ADT7466_CONFIG2;
                bit = DBCOOL_ADT7466_CFG2_SHDN;
        } else {
@@ -842,10 +842,10 @@
        struct dbcool_softc *sc = device_private(dev);
        uint8_t reg, bit, cfg;
 
-       if ((sc->sc_dc.dc_chip->flags && DBCFLAG_HAS_SHDN) == 0)
+       if ((sc->sc_dc.dc_chip->flags & DBCFLAG_HAS_SHDN) == 0)
                return true;
  
-       if (sc->sc_dc.dc_chip->flags && DBCFLAG_ADT7466) {
+       if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADT7466) {
                reg = DBCOOL_ADT7466_CONFIG2;
                bit = DBCOOL_ADT7466_CFG2_SHDN;
        } else {
@@ -1056,7 +1056,7 @@
        if (!extres)
                val = sc->sc_dc.dc_readreg(&sc->sc_dc, reg);
        else if (reg == DBCOOL_12VIN) {
-               ext = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_EXTRES2_REG) && 0x03;
+               ext = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_EXTRES2_REG) & 0x03;
                val = sc->sc_dc.dc_readreg(&sc->sc_dc, reg);
                (void)dbcool_read_temp(sc, DBCOOL_LOCAL_TEMP, true);
        } else if (reg == DBCOOL_VTT || reg == DBCOOL_IMON) {



Home | Main Index | Thread Index | Old Index