From owner-svn-src-all@FreeBSD.ORG Wed Oct 22 17:36:15 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 70B87106566C; Wed, 22 Oct 2008 17:36:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id E55A78FC23; Wed, 22 Oct 2008 17:36:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m9MHa6cF018609; Wed, 22 Oct 2008 13:36:06 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Ed Schouten Date: Wed, 22 Oct 2008 13:35:58 -0400 User-Agent: KMail/1.9.7 References: <200810221500.m9MF0MvH031614@svn.freebsd.org> <20081022170805.GJ16837@hoeg.nl> In-Reply-To: <20081022170805.GJ16837@hoeg.nl> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200810221335.59296.jhb@freebsd.org> Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Wed, 22 Oct 2008 13:36:06 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8470/Wed Oct 22 11:13:42 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx 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:36:15 -0000 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 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