Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Dec 2010 21:43:20 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216362 - in head/sys/dev: alc jme
Message-ID:  <201012102143.oBALhK0i086484@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 
-#include <machine/atomic.h>
 #include <machine/bus.h>
 #include <machine/in_cksum.h>
 
@@ -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 <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 
-#include <machine/atomic.h>
 #include <machine/bus.h>
 #include <machine/in_cksum.h>
 
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012102143.oBALhK0i086484>