From owner-svn-src-all@FreeBSD.ORG Fri Dec 10 21:43:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFEF81065670; Fri, 10 Dec 2010 21:43:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4C978FC13; Fri, 10 Dec 2010 21:43:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBALhKO8086487; Fri, 10 Dec 2010 21:43:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBALhK0i086484; Fri, 10 Dec 2010 21:43:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012102143.oBALhK0i086484@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 10 Dec 2010 21:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216362 - in head/sys/dev: alc jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 21:43:20 -0000 Author: yongari Date: Fri Dec 10 21:43:20 2010 New Revision: 216362 URL: http://svn.freebsd.org/changeset/base/216362 Log: Remove unecessary and clearly wrong usage of atomic(9). Reported by: avg, jhb, attilio Modified: head/sys/dev/alc/if_alc.c head/sys/dev/jme/if_jme.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Fri Dec 10 21:38:51 2010 (r216361) +++ head/sys/dev/alc/if_alc.c Fri Dec 10 21:43:20 2010 (r216362) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2668,9 +2667,10 @@ alc_int_task(void *arg, int pending) ifp = sc->alc_ifp; status = CSR_READ_4(sc, ALC_INTR_STATUS); - more = atomic_readandclear_int(&sc->alc_morework); - if (more != 0) + if (sc->alc_morework != 0) { + sc->alc_morework = 0; status |= INTR_RX_PKT; + } if ((status & ALC_INTRS) == 0) goto done; @@ -2682,7 +2682,7 @@ alc_int_task(void *arg, int pending) if ((status & INTR_RX_PKT) != 0) { more = alc_rxintr(sc, sc->alc_process_limit); if (more == EAGAIN) - atomic_set_int(&sc->alc_morework, 1); + sc->alc_morework = 1; else if (more == EIO) { ALC_LOCK(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Fri Dec 10 21:38:51 2010 (r216361) +++ head/sys/dev/jme/if_jme.c Fri Dec 10 21:43:20 2010 (r216362) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2181,7 +2180,7 @@ jme_link_task(void *arg, int pending) * procuder/consumer index. */ sc->jme_cdata.jme_rx_cons = 0; - atomic_set_int(&sc->jme_morework, 0); + sc->jme_morework = 0; jme_init_tx_ring(sc); /* Initialize shadow status block. */ jme_init_ssb(sc); @@ -2251,10 +2250,9 @@ jme_int_task(void *arg, int pending) ifp = sc->jme_ifp; status = CSR_READ_4(sc, JME_INTR_STATUS); - more = atomic_readandclear_int(&sc->jme_morework); - if (more != 0) { + if (sc->jme_morework != 0) { + sc->jme_morework = 0; status |= INTR_RXQ_COAL | INTR_RXQ_COAL_TO; - more = 0; } if ((status & JME_INTRS) == 0 || status == 0xFFFFFFFF) goto done; @@ -2270,7 +2268,7 @@ jme_int_task(void *arg, int pending) if ((status & (INTR_RXQ_COAL | INTR_RXQ_COAL_TO)) != 0) { more = jme_rxintr(sc, sc->jme_process_limit); if (more != 0) - atomic_set_int(&sc->jme_morework, 1); + sc->jme_morework = 1; } if ((status & INTR_RXQ_DESC_EMPTY) != 0) { /* @@ -2980,7 +2978,7 @@ jme_init_rx_ring(struct jme_softc *sc) sc->jme_cdata.jme_rx_cons = 0; JME_RXCHAIN_RESET(sc); - atomic_set_int(&sc->jme_morework, 0); + sc->jme_morework = 0; rd = &sc->jme_rdata; bzero(rd->jme_rx_ring, JME_RX_RING_SIZE);