Date: Fri, 15 Jul 2011 10:27:38 -0600 From: Warner Losh <imp@bsdimp.com> To: Aleksandr Rybalko <ray@dlink.ua> Cc: freebsd-mips@FreeBSD.org Subject: Re: dev/flash patch Message-ID: <A13C6B97-2146-488E-A43E-2934AE0B3331@bsdimp.com> In-Reply-To: <20110715152210.88db1c98.ray@dlink.ua> References: <20110715152210.88db1c98.ray@dlink.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <ray@dlink.ua> > aka Alex RAY <ray@ddteam.net> > _______________________________________________ > 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" > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A13C6B97-2146-488E-A43E-2934AE0B3331>