Date: Fri, 8 Sep 2006 19:05:03 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 105852 for review Message-ID: <200609081905.k88J53pD016141@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=105852 Change 105852 by imp@imp_lighthouse on 2006/09/08 19:04:06 nits (and a bug fix in checking validity) Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_twi.c#23 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_twi.c#23 (text+ko) ==== @@ -439,15 +439,15 @@ WR4(sc, TWI_MMR, TWI_MMR_DADR(msgs[i].slave) | rdwr); len = msgs[i].len; buf = msgs[i].buf; - if (len != 0 || buf == NULL) - return EINVAL; + if (len == 0 || buf == NULL) + return (EINVAL); WR4(sc, TWI_CR, TWI_CR_START); if (msgs[i].flags & IIC_M_RD) { while (len--) { if (len == 0) WR4(sc, TWI_CR, TWI_CR_STOP); if (!at91_twi_wait(sc, TWI_SR_RXRDY)) - return EIO; + return (EIO); *buf++ = RD4(sc, TWI_RHR) & 0xff; } } else { @@ -456,13 +456,13 @@ if (len == 0) WR4(sc, TWI_CR, TWI_CR_STOP); if (!at91_twi_wait(sc, TWI_SR_TXRDY)) - return EIO; + return (EIO); } } if (!at91_twi_wait(sc, TWI_SR_TXCOMP)) - return EIO; + return (EIO); } - return 0; + return (0); } static device_method_t at91_twi_methods[] = {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609081905.k88J53pD016141>