Mostly Cosmetics. Some of the procedures in if_sl.c was void, but should

be int.  I made them int, and let them return 0.  Will have to find out
what the return-val is used for.
This commit is contained in:
Poul-Henning Kamp 1994-10-08 01:40:23 +00:00
parent 2f7048bff0
commit 9448326fcf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3419
3 changed files with 44 additions and 31 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if.c 8.3 (Berkeley) 1/4/94
* $Id: if.c,v 1.7 1994/09/16 05:47:03 phk Exp $
* $Id: if.c,v 1.8 1994/10/05 20:11:23 wollman Exp $
*/
#include <sys/param.h>
@ -48,6 +48,7 @@
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/radix.h>
#include <ether.h>
int ifqmaxlen = IFQ_MAXLEN;
@ -135,7 +136,8 @@ if_attach(ifp)
if (socksize < sizeof(*sdl))
socksize = sizeof(*sdl);
ifasize = sizeof(*ifa) + 2 * socksize;
if (ifa = (struct ifaddr *)malloc(ifasize, M_IFADDR, M_WAITOK)) {
ifa = (struct ifaddr *)malloc(ifasize, M_IFADDR, M_WAITOK);
if (ifa) {
bzero((caddr_t)ifa, ifasize);
sdl = (struct sockaddr_dl *)(ifa + 1);
sdl->sdl_len = socksize;
@ -327,7 +329,8 @@ link_rtrequest(cmd, rt, sa)
if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == 0) ||
((ifp = ifa->ifa_ifp) == 0) || ((dst = rt_key(rt)) == 0))
return;
if (ifa = ifaof_ifpforaddr(dst, ifp)) {
ifa = ifaof_ifpforaddr(dst, ifp);
if (ifa) {
IFAFREE(rt->rt_ifa);
rt->rt_ifa = ifa;
ifa->ifa_refcnt++;
@ -363,10 +366,10 @@ void
if_up(ifp)
register struct ifnet *ifp;
{
register struct ifaddr *ifa;
ifp->if_flags |= IFF_UP;
#ifdef notyet
register struct ifaddr *ifa;
/* this has no effect on IP, and will kill all iso connections XXX */
for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
pfctlinput(PRC_IFUP, ifa->ifa_addr);
@ -384,7 +387,7 @@ if_qflush(ifq)
register struct mbuf *m, *n;
n = ifq->ifq_head;
while (m = n) {
while ((m = n) != 0) {
n = m->m_act;
m_freem(m);
}
@ -494,7 +497,8 @@ ifioctl(so, cmd, data, p)
break;
case SIOCSIFFLAGS:
if (error = suser(p->p_ucred, &p->p_acflag))
error = suser(p->p_ucred, &p->p_acflag);
if (error)
return (error);
if (ifp->if_flags & IFF_UP && (ifr->ifr_flags & IFF_UP) == 0) {
int s = splimp();
@ -513,13 +517,15 @@ ifioctl(so, cmd, data, p)
break;
case SIOCSIFMETRIC:
if (error = suser(p->p_ucred, &p->p_acflag))
error = suser(p->p_ucred, &p->p_acflag);
if (error)
return (error);
ifp->if_metric = ifr->ifr_metric;
break;
case SIOCSIFMTU:
if (error = suser(p->p_ucred, &p->p_acflag))
error = suser(p->p_ucred, &p->p_acflag);
if (error)
return (error);
if (ifp->if_ioctl == NULL)
return (EOPNOTSUPP);
@ -533,7 +539,8 @@ ifioctl(so, cmd, data, p)
case SIOCADDMULTI:
case SIOCDELMULTI:
if (error = suser(p->p_ucred, &p->p_acflag))
error = suser(p->p_ucred, &p->p_acflag);
if (error)
return (error);
if (ifp->if_ioctl == NULL)
return (EOPNOTSUPP);
@ -615,7 +622,7 @@ ifconf(cmd, data)
register struct ifconf *ifc = (struct ifconf *)data;
register struct ifnet *ifp = ifnet;
register struct ifaddr *ifa;
register char *cp, *ep;
register char *ep;
struct ifreq ifr, *ifrp;
int space = ifc->ifc_len, error = 0;

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_sl.c 8.6 (Berkeley) 2/1/94
* $Id: if_sl.c,v 1.7 1994/09/13 16:05:50 davidg Exp $
* $Id: if_sl.c,v 1.8 1994/10/05 21:22:45 wollman Exp $
*/
/*
@ -260,7 +260,8 @@ slopen(dev, tp)
register int nsl;
int error;
if (error = suser(p->p_ucred, &p->p_acflag))
error = suser(p->p_ucred, &p->p_acflag);
if (error)
return (error);
if (tp->t_line == SLIPDISC)
@ -286,9 +287,10 @@ slopen(dev, tp)
* Line specific close routine.
* Detach the tty from the sl unit.
*/
void
slclose(tp)
int
slclose(tp,flag)
struct tty *tp;
int flag;
{
register struct sl_softc *sc;
int s;
@ -308,6 +310,7 @@ slclose(tp)
cblock_free_cblocks(CLISTEXTRA);
}
splx(s);
return 0;
}
/*
@ -316,11 +319,12 @@ slclose(tp)
*/
/* ARGSUSED */
int
sltioctl(tp, cmd, data, flag)
sltioctl(tp, cmd, data, flag, p)
struct tty *tp;
int cmd;
caddr_t data;
int flag;
struct proc *p;
{
struct sl_softc *sc = (struct sl_softc *)tp->t_sc;
@ -403,7 +407,7 @@ sloutput(ifp, m, dst, rtp)
* to send from the interface queue and map it to
* the interface before starting output.
*/
void
int
slstart(tp)
register struct tty *tp;
{
@ -428,13 +432,13 @@ slstart(tp)
if (tp->t_outq.c_cc != 0) {
(*tp->t_oproc)(tp);
if (tp->t_outq.c_cc > SLIP_HIWAT)
return;
return 0;
}
/*
* This happens briefly when the line shuts down.
*/
if (sc == NULL)
return;
return 0;
/*
* Get a packet and send it to the interface.
@ -447,7 +451,7 @@ slstart(tp)
IF_DEQUEUE(&sc->sc_if.if_snd, m);
splx(s);
if (m == NULL)
return;
return 0;
/*
* We do the header compression here rather than in sloutput
@ -588,6 +592,7 @@ slstart(tp)
sc->sc_if.if_opackets++;
}
}
return 0;
}
/*
@ -636,7 +641,7 @@ sl_btom(sc, len)
/*
* tty interface receiver interrupt.
*/
void
int
slinput(c, tp)
register int c;
register struct tty *tp;
@ -652,11 +657,11 @@ slinput(c, tp)
tk_nin++;
sc = (struct sl_softc *)tp->t_sc;
if (sc == NULL)
return;
return 0;
if (c & TTY_ERRORMASK || ((tp->t_state & TS_CARR_ON) == 0 &&
(tp->t_cflag & CLOCAL) == 0)) {
sc->sc_flags |= SC_ERROR;
return;
return 0;
}
c &= TTY_CHARMASK;
@ -679,8 +684,8 @@ slinput(c, tp)
if (++sc->sc_abortcount == 1)
sc->sc_starttime = time.tv_sec;
if (sc->sc_abortcount >= ABT_COUNT) {
slclose(tp);
return;
slclose(tp,0);
return 0;
}
}
} else
@ -702,7 +707,7 @@ slinput(c, tp)
case FRAME_ESCAPE:
sc->sc_escape = 1;
return;
return 0;
case FRAME_END:
if(sc->sc_flags & SC_ERROR) {
@ -792,7 +797,7 @@ slinput(c, tp)
if (sc->sc_mp < sc->sc_ep) {
*sc->sc_mp++ = c;
sc->sc_escape = 0;
return;
return 0;
}
/* can't put lower; would miss an extra frame */
@ -803,6 +808,7 @@ slinput(c, tp)
newpack:
sc->sc_mp = sc->sc_buf = sc->sc_ep - SLRMAX;
sc->sc_escape = 0;
return 0;
}
/*

View File

@ -32,7 +32,7 @@
*
* @(#)if_slvar.h 8.3 (Berkeley) 2/1/94
*
* $Id: if_slvar.h,v 1.2 1994/08/02 07:46:22 davidg Exp $
* $Id: if_slvar.h,v 1.3 1994/08/21 05:11:43 paul Exp $
*/
#ifndef _NET_IF_SLVAR_H_
@ -72,14 +72,14 @@ struct sl_softc {
#ifdef KERNEL
void slattach __P((void));
void slclose __P((struct tty *));
void slinput __P((int, struct tty *));
int slclose __P((struct tty *,int));
int slinput __P((int, struct tty *));
int slioctl __P((struct ifnet *, int, caddr_t));
int sltioctl __P((struct tty *, int, caddr_t, int, struct proc *));
int slopen __P((dev_t, struct tty *));
int sloutput __P((struct ifnet *,
struct mbuf *, struct sockaddr *, struct rtentry *));
void slstart __P((struct tty *));
int sltioctl __P((struct tty *, int, caddr_t, int));
int slstart __P((struct tty *));
#endif /* KERNEL */
#endif