Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c always set *data to appease gcc -03 (some users ...



details:   https://anonhg.NetBSD.org/src/rev/084925d03329
branches:  trunk
changeset: 778084:084925d03329
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Thu Mar 15 16:20:36 2012 +0000

description:
always set *data to appease gcc -03 (some users of cx24227_readreg() don't
check return value for error).

diffstat:

 sys/dev/i2c/cx24227.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r fc2766a1d424 -r 084925d03329 sys/dev/i2c/cx24227.c
--- a/sys/dev/i2c/cx24227.c     Thu Mar 15 16:19:02 2012 +0000
+++ b/sys/dev/i2c/cx24227.c     Thu Mar 15 16:20:36 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cx24227.c,v 1.5 2011/10/02 19:03:56 jmcneill Exp $ */
+/* $NetBSD: cx24227.c,v 1.6 2012/03/15 16:20:36 bouyer Exp $ */
 
 /*
  * Copyright (c) 2008, 2011 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cx24227.c,v 1.5 2011/10/02 19:03:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cx24227.c,v 1.6 2012/03/15 16:20:36 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -128,11 +128,11 @@
        int error;
        uint8_t r[2];
 
+       *data = 0x0000;
+
        if (iic_acquire_bus(sc->tag, I2C_F_POLL) != 0)
                return -1;
 
-       *data = 0x0000;
-
        error = iic_exec(sc->tag, I2C_OP_READ_WITH_STOP, sc->addr,
                         &reg, 1, r, 2, I2C_F_POLL);
 



Home | Main Index | Thread Index | Old Index