1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Eliminate compiler warnings.

This commit is contained in:
Archie Cobbs 1998-12-10 01:42:32 +00:00
parent 05eea124e9
commit 4b62fdebb8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=41627

View File

@ -46,7 +46,7 @@
* SUCH DAMAGE.
*
* from: unknown origin, 386BSD 0.1
* $Id: lpt.c,v 1.70 1998/08/17 01:05:23 bde Exp $
* $Id: lpt.c,v 1.71 1998/10/22 05:58:39 bde Exp $
*/
/*
@ -189,9 +189,12 @@
#ifndef DEBUG
#define lprintf (void)
#define lprintf(args)
#else
#define lprintf if (lptflag) printf
#define lprintf(args) do { \
if (lptflag) \
printf args; \
} while (0)
static int volatile lptflag = 1;
#endif
@ -315,8 +318,8 @@ lpt_port_test (int port, u_char data, u_char mask)
temp = inb(port) & mask;
}
while (temp != data && --timeout);
lprintf("Port 0x%x\tout=%x\tin=%x\ttout=%d\n",
port, data, temp, timeout);
lprintf(("Port 0x%x\tout=%x\tin=%x\ttout=%d\n",
port, data, temp, timeout));
return (temp == data);
}
@ -431,7 +434,7 @@ lptattach(struct isa_device *isdp)
outb(sc->sc_port+lpt_control, LPC_NINIT);
/* check if we can use interrupt */
lprintf("oldirq %x\n", sc->sc_irq);
lprintf(("oldirq %x\n", sc->sc_irq));
if (isdp->id_irq) {
sc->sc_irq = LP_HAS_IRQ | LP_USE_IRQ | LP_ENABLE_IRQ;
printf("lpt%d: Interrupt-driven port\n", unit);
@ -440,9 +443,9 @@ lptattach(struct isa_device *isdp)
#endif
} else {
sc->sc_irq = 0;
lprintf("lpt%d: Polled port\n", unit);
lprintf(("lpt%d: Polled port\n", unit));
}
lprintf("irq %x\n", sc->sc_irq);
lprintf(("irq %x\n", sc->sc_irq));
#ifdef DEVFS
/* XXX what to do about the flags in the minor number? */
@ -480,7 +483,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
#endif
if (sc->sc_state) {
lprintf("lp: still open %x\n", sc->sc_state);
lprintf(("lp: still open %x\n", sc->sc_state));
return(EBUSY);
} else
sc->sc_state |= INIT;
@ -494,7 +497,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
}
s = spltty();
lprintf("lp flags 0x%x\n", sc->sc_flags);
lprintf(("lp flags 0x%x\n", sc->sc_flags));
port = sc->sc_port;
/* set IRQ status according to ENABLE_IRQ flag */
@ -521,7 +524,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
if (trys++ >= LPINITRDY*4) {
splx(s);
sc->sc_state = 0;
lprintf ("status %x\n", inb(port+lpt_status) );
lprintf(("status %x\n", inb(port+lpt_status)));
return (EBUSY);
}
@ -553,14 +556,14 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
splx(s);
/* only use timeout if using interrupt */
lprintf("irq %x\n", sc->sc_irq);
lprintf(("irq %x\n", sc->sc_irq));
if (sc->sc_irq & LP_USE_IRQ) {
sc->sc_state |= TOUT;
timeout (lptout, (caddr_t)sc,
(sc->sc_backoff = hz/LPTOUTINITIAL));
}
lprintf("opened.\n");
lprintf(("opened.\n"));
return(0);
}
@ -570,7 +573,7 @@ lptout (void *arg)
struct lpt_softc *sc = arg;
int pl;
lprintf ("T %x ", inb(sc->sc_port+lpt_status));
lprintf(("T %x ", inb(sc->sc_port+lpt_status)));
if (sc->sc_state & OPEN) {
sc->sc_backoff++;
if (sc->sc_backoff > hz/LPTOUTMAX)
@ -627,7 +630,7 @@ lptclose(dev_t dev, int flags, int fmt, struct proc *p)
end_close:
sc->sc_state = 0;
sc->sc_xfercnt = 0;
lprintf("closed.\n");
lprintf(("closed.\n"));
return(0);
}
@ -646,7 +649,7 @@ pushbytes(struct lpt_softc * sc)
char ch;
int port = sc->sc_port;
lprintf("p");
lprintf(("p"));
/* loop for every character .. */
while (sc->sc_xfercnt > 0) {
/* printer data */
@ -717,16 +720,16 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
uiomove(sc->sc_cp, n, uio);
sc->sc_xfercnt = n ;
while ((sc->sc_xfercnt > 0)&&(sc->sc_irq & LP_USE_IRQ)) {
lprintf("i");
lprintf(("i"));
/* if the printer is ready for a char, */
/* give it one */
if ((sc->sc_state & OBUSY) == 0){
lprintf("\nC %d. ", sc->sc_xfercnt);
lprintf(("\nC %d. ", sc->sc_xfercnt));
pl = spltty();
lptintr(sc - lpt_sc);
(void) splx(pl);
}
lprintf("W ");
lprintf(("W "));
if (sc->sc_state & OBUSY)
if ((err = tsleep ((caddr_t)sc,
LPPRI|PCATCH, "lpwrite", 0))) {
@ -736,7 +739,7 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
}
/* check to see if we must do a polled write */
if(!(sc->sc_irq & LP_USE_IRQ) && (sc->sc_xfercnt)) {
lprintf("p");
lprintf(("p"));
if((err = pushbytes(sc)))
return(err);
}
@ -781,7 +784,7 @@ lptintr(int unit)
if (sc->sc_xfercnt) {
/* send char */
/*lprintf("%x ", *sc->sc_cp); */
/*lprintf(("%x ", *sc->sc_cp)); */
outb(port+lpt_data, *sc->sc_cp++) ;
outb(port+lpt_control, sc->sc_control|LPC_STB);
/* DELAY(X) */
@ -798,7 +801,7 @@ lptintr(int unit)
sc->sc_state &= ~OBUSY;
if(!(sc->sc_state & INTERRUPTED))
wakeup((caddr_t)sc);
lprintf("w ");
lprintf(("w "));
return;
} else { /* check for error */
if(((sts & (LPS_NERR | LPS_OUT) ) != LPS_NERR) &&
@ -806,7 +809,7 @@ lptintr(int unit)
sc->sc_state |= ERROR;
/* lptout() will jump in and try to restart. */
}
lprintf("sts %x ", sts);
lprintf(("sts %x ", sts));
}
static int
@ -989,7 +992,7 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data)
break;
default:
lprintf("LP:ioctl(0x%lx)\n", cmd);
lprintf(("LP:ioctl(0x%lx)\n", cmd));
return EINVAL;
}
return 0;
@ -1086,7 +1089,7 @@ lpintr (int unit)
sc->sc_iferrs = 0;
if (IF_QFULL(&ipintrq)) {
lprintf("DROP");
lprintf(("DROP"));
IF_DROP(&ipintrq);
goto done;
}
@ -1135,7 +1138,7 @@ lpintr (int unit)
sc->sc_iferrs = 0;
if (IF_QFULL(&ipintrq)) {
lprintf("DROP");
lprintf(("DROP"));
IF_DROP(&ipintrq);
goto done;
}
@ -1157,7 +1160,7 @@ lpintr (int unit)
err:
outb(lpt_data_port, 0);
lprintf("R");
lprintf(("R"));
sc->sc_if.if_ierrors++;
sc->sc_iferrs++;
@ -1221,7 +1224,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
if (ifp->if_flags & IFF_LINK0) {
if (!(inb(lpt_stat_port) & CLPIP_SHAKE)) {
lprintf("&");
lprintf(("&"));
lptintr(ifp->if_unit);
}
@ -1281,7 +1284,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
nend:
if (err) { /* if we didn't timeout... */
ifp->if_oerrors++;
lprintf("X");
lprintf(("X"));
} else {
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
@ -1290,7 +1293,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
m_freem(m);
if (!(inb(lpt_stat_port) & CLPIP_SHAKE)) {
lprintf("^");
lprintf(("^"));
lptintr(ifp->if_unit);
}
(void) splx(s);
@ -1298,7 +1301,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
}
if (inb(lpt_stat_port) & LPIP_SHAKE) {
lprintf("&");
lprintf(("&"));
lptintr(ifp->if_unit);
}
@ -1323,7 +1326,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
if (err) { /* if we didn't timeout... */
ifp->if_oerrors++;
lprintf("X");
lprintf(("X"));
} else {
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
@ -1351,7 +1354,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
m_freem(m);
if (inb(lpt_stat_port) & LPIP_SHAKE) {
lprintf("^");
lprintf(("^"));
lptintr(ifp->if_unit);
}