From owner-p4-projects@FreeBSD.ORG Fri Sep 8 19:05:05 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D5A8A16A416; Fri, 8 Sep 2006 19:05:04 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7353216A412 for ; Fri, 8 Sep 2006 19:05:04 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3243743D45 for ; Fri, 8 Sep 2006 19:05:04 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k88J544C016144 for ; Fri, 8 Sep 2006 19:05:04 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k88J53pD016141 for perforce@freebsd.org; Fri, 8 Sep 2006 19:05:03 GMT (envelope-from imp@freebsd.org) Date: Fri, 8 Sep 2006 19:05:03 GMT Message-Id: <200609081905.k88J53pD016141@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 105852 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Sep 2006 19:05:05 -0000 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[] = {