From owner-svn-src-all@FreeBSD.ORG Wed Oct 22 17:08:07 2008 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 0E18010656A4; Wed, 22 Oct 2008 17:08:07 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:3fb::211]) by mx1.freebsd.org (Postfix) with ESMTP id C29878FC14; Wed, 22 Oct 2008 17:08:06 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 01EFD1CD19; Wed, 22 Oct 2008 19:08:05 +0200 (CEST) Date: Wed, 22 Oct 2008 19:08:05 +0200 From: Ed Schouten To: John Baldwin Message-ID: <20081022170805.GJ16837@hoeg.nl> References: <200810221500.m9MF0MvH031614@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="w5xl9Cr7DZZ9WNrn" Content-Disposition: inline In-Reply-To: <200810221500.m9MF0MvH031614@svn.freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184164 - head/sys/dev/ppbus 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: Wed, 22 Oct 2008 17:08:07 -0000 --w5xl9Cr7DZZ9WNrn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 wrote: > Modified: head/sys/dev/ppbus/lpt.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- 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 =3D make_dev(&lpt_cdevsw, unit, > UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", unit); > sc->cdev_bypass->si_drv1 =3D sc; > - sc->cdev_bypass->si_drv2 =3D LP_BYPASS; > + sc->cdev_bypass->si_drv2 =3D (void *)LP_BYPASS; > return (0); > } > =20 > @@ -476,7 +476,7 @@ lptopen(struct cdev *dev, int flags, int > } else > sc->sc_state |=3D LPTINIT; > =20 > - sc->sc_flags =3D dev->si_drv2; > + sc->sc_flags =3D (uintptr_t)dev->si_drv2; > =20 > /* 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. I sent the following patch to current@ this morning: --- sys/dev/ppbus/lpt.c +++ sys/dev/ppbus/lpt.c @@ -392,14 +392,12 @@ lpt_release_ppbus(dev); =20 sc->dev =3D dev; - sc->cdev =3D make_dev(&lpt_cdevsw, unit, + sc->cdev =3D make_dev(&lpt_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d", unit); sc->cdev->si_drv1 =3D sc; - sc->cdev->si_drv2 =3D 0; - sc->cdev_bypass =3D make_dev(&lpt_cdevsw, unit, + sc->cdev_bypass =3D make_dev(&lpt_cdevsw, LP_BYPASS, UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", unit); sc->cdev_bypass->si_drv1 =3D sc; - sc->cdev_bypass->si_drv2 =3D LP_BYPASS; return (0); } =20 @@ -476,7 +474,7 @@ } else sc->sc_state |=3D LPTINIT; =20 - sc->sc_flags =3D dev->si_drv2; + sc->sc_flags =3D dev2unit(dev); =20 /* Check for open with BYPASS flag set. */ if (sc->sc_flags & LP_BYPASS) { --=20 Ed Schouten WWW: http://80386.nl/ --w5xl9Cr7DZZ9WNrn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkj/XfUACgkQ52SDGA2eCwXNfQCfUXM3QS0oleInghXtV72F3EGg GHIAn0Eet57diTTxDtNOfQHLKSdmXH0J =qn3I -----END PGP SIGNATURE----- --w5xl9Cr7DZZ9WNrn--