Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Aug 1997 23:12:47 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        mike@smith.net.au, phk@dk.tfs.com
Cc:        current@FreeBSD.ORG
Subject:   Re: LINT compile failure...
Message-ID:  <199708221312.XAA25491@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>The CVS repo is undergoing open-heart bypass surgery.  Here's a diff; if
>you don't hit it, I will tomorrow :
>
>--- nlpt.c.old  Fri Aug 22 19:12:58 1997
>+++ nlpt.c      Fri Aug 22 19:13:32 1997
>@@ -367,10 +367,10 @@
> 
> #ifdef DEVFS
>        /* XXX what to do about the flags in the minor number? */
>-       sc->devfs_token = devfs_add_devswf(&nlpt_cdevsw,
>+       lpt->devfs_token = devfs_add_devswf(&nlpt_cdevsw,
>                unit, DV_CHR,
>                UID_ROOT, GID_WHEEL, 0600, "nlpt%d", unit);
>-       sc->devfs_token_ctl = devfs_add_devswf(&nlpt_cdevsw,
>+       lpt->devfs_token_ctl = devfs_add_devswf(&nlpt_cdevsw,
>                unit | LP_BYPASS, DV_CHR,
>                UID_ROOT, GID_WHEEL, 0600, "lpctl%d", unit);
> #endif

It still fails to compile here, due to bogus timeout_func_t casts.
It is apparently based on an ancient version of lpt.c (before lpt.c
was staticized).  The renaming of sc to lpt guarantees that patches
for lpt.c usually don't apply :-(.  NetBSD seems to name pointers
to the main driver data struct as `sc' for most drivers.  This should
simplify cloning of drivers even for dissimilar drivers.  E.g., you
wouldn't have had to change anything except maybe "lpt" to "nlpt"
when you cut and pasted the above DEVFS support.

Other bugs:
1. "lpctl" should be "nlpctl" in the above.
2. "[n]lpctl" is a stupid name (it doesn't contain the full "lpt"
   prefix).
3. The device name should not occur literally more than once in each
   driver.

Bruce



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