From owner-freebsd-mips@FreeBSD.ORG Fri Jul 15 16:30:46 2011 Return-Path: Delivered-To: freebsd-mips@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 478FF106564A for ; Fri, 15 Jul 2011 16:30:46 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id DDEC08FC18 for ; Fri, 15 Jul 2011 16:30:45 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p6FGRl3M030463 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 15 Jul 2011 10:27:49 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20110715152210.88db1c98.ray@dlink.ua> Date: Fri, 15 Jul 2011 10:27:38 -0600 Content-Transfer-Encoding: 7bit Message-Id: References: <20110715152210.88db1c98.ray@dlink.ua> To: Aleksandr Rybalko X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Fri, 15 Jul 2011 10:27:50 -0600 (MDT) Cc: freebsd-mips@FreeBSD.org Subject: Re: dev/flash patch X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2011 16:30:46 -0000 this patch looks good to me. Warner On Jul 15, 2011, at 6:22 AM, Aleksandr Rybalko wrote: > Hi all, > > I have proposal to tidy mx25l driver, since he have macro's that called > M25PXX_*. That name match a real(world known) name, but seems renaming > whole driver is bigger pain than use well known for our users. > > Please let me know, if someone have objections or opinion differ from > my. > > Patch: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > Index: sys/dev/flash/mx25l.c > =================================================================== > --- sys/dev/flash/mx25l.c (revision 223926) > +++ sys/dev/flash/mx25l.c (working copy) > @@ -79,14 +79,14 @@ > unsigned int sc_flags; > }; > > -#define M25PXX_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) > -#define M25PXX_UNLOCK(_sc) mtx_unlock(& > (_sc)->sc_mtx) -#define M25PXX_LOCK_INIT(_sc) \ > +#define MX25L_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) > +#define MX25L_UNLOCK(_sc) mtx_unlock(& > (_sc)->sc_mtx) +#define MX25L_LOCK_INIT(_sc) \ > mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ > "mx25l", MTX_DEF) > -#define M25PXX_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); > -#define M25PXX_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, > MA_OWNED); -#define M25PXX_ASSERT_UNLOCKED(_sc) mtx_assert > (&_sc->sc_mtx, MA_NOTOWNED); +#define MX25L_LOCK_DESTROY(_sc) > mtx_destroy(&_sc->sc_mtx); +#define MX25L_ASSERT_LOCKED(_sc) > mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define MX25L_ASSERT_UNLOCKED(_sc) > mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); > /* disk routines */ > static int mx25l_open(struct disk *dp); > @@ -356,7 +356,7 @@ > > sc = device_get_softc(dev); > sc->sc_dev = dev; > - M25PXX_LOCK_INIT(sc); > + MX25L_LOCK_INIT(sc); > > ident = mx25l_get_device_ident(sc); > if (ident == NULL) > @@ -427,10 +427,10 @@ > struct mx25l_softc *sc; > > sc = (struct mx25l_softc *)bp->bio_disk->d_drv1; > - M25PXX_LOCK(sc); > + MX25L_LOCK(sc); > bioq_disksort(&sc->sc_bio_queue, bp); > wakeup(sc); > - M25PXX_UNLOCK(sc); > + MX25L_UNLOCK(sc); > } > > static void > @@ -442,14 +442,14 @@ > > for (;;) { > dev = sc->sc_dev; > - M25PXX_LOCK(sc); > + MX25L_LOCK(sc); > do { > bp = bioq_first(&sc->sc_bio_queue); > if (bp == NULL) > msleep(sc, &sc->sc_mtx, PRIBIO, > "jobqueue", 0); } while (bp == NULL); > bioq_remove(&sc->sc_bio_queue, bp); > - M25PXX_UNLOCK(sc); > + MX25L_UNLOCK(sc); > > switch (bp->bio_cmd) { > case BIO_READ: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > > -- > Alexandr Rybalko > aka Alex RAY > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" > >