Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Oct 2008 13:35:58 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Ed Schouten <ed@80386.nl>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r184164 - head/sys/dev/ppbus
Message-ID:  <200810221335.59296.jhb@freebsd.org>
In-Reply-To: <20081022170805.GJ16837@hoeg.nl>
References:  <200810221500.m9MF0MvH031614@svn.freebsd.org> <20081022170805.GJ16837@hoeg.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 22 October 2008 01:08:05 pm Ed Schouten wrote:
> Hi John,
> 
> It seems I forgot to CC my message to you, so I'll just stick it to to
> the commit message as well. Sorry.
> 
> * John Baldwin <jhb@FreeBSD.org> wrote:
> > Modified: head/sys/dev/ppbus/lpt.c
> > 
==============================================================================
> > --- head/sys/dev/ppbus/lpt.c	Wed Oct 22 14:58:23 2008	(r184163)
> > +++ head/sys/dev/ppbus/lpt.c	Wed Oct 22 15:00:22 2008	(r184164)
> > @@ -399,7 +399,7 @@ lpt_attach(device_t dev)
> >  	sc->cdev_bypass = make_dev(&lpt_cdevsw, unit,
> >  	    UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", unit);
> >  	sc->cdev_bypass->si_drv1 = sc;
> > -	sc->cdev_bypass->si_drv2 = LP_BYPASS;
> > +	sc->cdev_bypass->si_drv2 = (void *)LP_BYPASS;
> >  	return (0);
> >  }
> >  
> > @@ -476,7 +476,7 @@ lptopen(struct cdev *dev, int flags, int
> >  	} else
> >  		sc->sc_state |= LPTINIT;
> >  
> > -	sc->sc_flags = dev->si_drv2;
> > +	sc->sc_flags = (uintptr_t)dev->si_drv2;
> >  
> >  	/* Check for open with BYPASS flag set. */
> >  	if (sc->sc_flags & LP_BYPASS) {
> 
> Maybe it's better to just use the device unit number to store these
> flags? This value is stored inside si_drv0, which is an integer.
> Hopefully we'll get rid of make_dev()'s unit number argument somewhere
> in the far future, which means drivers can use si_drv0 directly.

Once si_drv0 is publicly available then I would have no problem with doing 
that, but abusing the unit number is non-obvious to me.  Traditionally 
si_drv[12] have been the publicly available fields for drivers to use, and 
I'd rather stick to that until si_drv0 joins them and can be used directly.  
Using si_drv0 is also something that can't be MFC'd to 7.x.

-- 
John Baldwin



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