PERFORCE change 105852 for review

Warner Losh imp at FreeBSD.org
Fri Sep 8 19:05:05 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=105852

Change 105852 by imp at 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[] = {


More information about the p4-projects mailing list