M gnot/bbmalloc.c => gnot/bbmalloc.c +2 -1
@@ 53,7 53,6 @@ bbmalloc(int nbytes)
void
bbfree(void *p, int n)
{
- ulong *up;
int a, s;
s = splhi();
@@ 66,12 65,14 @@ bbfree(void *p, int n)
void
flushvirtpage(void *p)
{
+ USED(p);
flushcpucache();
}
void
bbdflush(void *p, int n)
{
+ USED(p, n);
flushcpucache();
}
M gnot/clock.c => gnot/clock.c +0 -1
@@ 10,7 10,6 @@
void
delay(int ms)
{
- ulong t, *p;
int i;
ms *= 1000; /* experimentally determined */
M gnot/devduart.c => gnot/devduart.c +4 -0
@@ 709,6 709,7 @@ duartopen(Chan *c, int omode)
void
duartcreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
@@ 742,17 743,20 @@ duartread(Chan *c, void *buf, long n, ulong offset)
long
duartwrite(Chan *c, void *va, long n, ulong offset)
{
+ USED(offset);
return streamwrite(c, va, n, 0);
}
void
duartremove(Chan *c)
{
+ USED(c);
error(Eperm);
}
void
duartwstat(Chan *c, char *dp)
{
+ USED(c, dp);
error(Eperm);
}
M gnot/devhifi.c => gnot/devhifi.c +5 -2
@@ 175,6 175,7 @@ hifiopen(Chan *c, int omode)
void
hificreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
@@ 233,6 234,7 @@ hifiwrite(Chan *c, void *buf, long n, ulong offset)
Hifichan *hp = &hifichan[c->dev];
char nbuf[32], *p;
+ USED(offset);
if(n < 0)
return 0;
switch(STREAMTYPE(c->qid.path)){
@@ 252,12 254,14 @@ hifiwrite(Chan *c, void *buf, long n, ulong offset)
void
hifiremove(Chan *c)
{
+ USED(c);
error(Eperm);
}
void
hifiwstat(Chan *c, char *dp)
{
+ USED(c, dp);
error(Eperm);
}
@@ 517,8 521,7 @@ hifiintr(void)
Isdn *ip;
Hifichan *hp;
Hifi *hifi;
- int intr = 0, status, n, c, wake = 0, w = 0;
- uchar *p;
+ int intr = 0, status, wake = 0, w = 0;
for(hp=hifichan; hp<hifichanN; hp++){
if(!(ip = hp->udev)) /* assign = */
M gnot/devincon.c => gnot/devincon.c +6 -3
@@ 273,7 273,6 @@ inconpoll(Incon *ip, int station)
void
inconrestart(Incon *ip)
{
- Device *dev;
int i;
if(!canqlock(&ip->reslock))
@@ 309,7 308,6 @@ void
inconreset(void)
{
int i;
- Incon *ip;
incon[0].dev = INCON;
incon[0].state = Selected;
@@ 387,6 385,7 @@ inconopen(Chan *c, int omode)
void
inconcreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
@@ 417,18 416,21 @@ inconread(Chan *c, void *buf, long n, ulong offset)
long
inconwrite(Chan *c, void *buf, long n, ulong offset)
{
+ USED(offset);
return streamwrite(c, buf, n, 0);
}
void
inconremove(Chan *c)
{
+ USED(c);
error(Eperm);
}
void
inconwstat(Chan *c, char *dp)
{
+ USED(c, dp);
error(Eperm);
}
@@ 669,7 671,7 @@ static void
inconkproc(void *arg)
{
Incon *ip;
- Block *bp, *nbp;
+ Block *bp;
int i;
int locked;
@@ 883,6 885,7 @@ inconintr(Ureg *ur)
uchar status;
Incon *ip;
+ USED(ur);
ip = &incon[0];
status = ip->dev->status;
M gnot/devisdn.c => gnot/devisdn.c +3 -0
@@ 132,6 132,7 @@ isdnopen(Chan *c, int omode)
void
isdncreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
@@ 245,12 246,14 @@ isdnwrite(Chan *c, void *buf, long n, ulong offset)
void
isdnremove(Chan *c)
{
+ USED(c);
error(Eperm);
}
void
isdnwstat(Chan *c, char *dp)
{
+ USED(c, dp);
error(Eperm);
}
M gnot/devport.c => gnot/devport.c +2 -0
@@ 123,12 123,14 @@ portopen(Chan *c, int omode)
void
portcreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
void
portclose(Chan *c)
{
+ USED(c);
}
long
M gnot/main.c => gnot/main.c +4 -3
@@ 104,7 104,7 @@ machinit(void)
void
mmuinit(void)
{
- ulong l, d, i, scr;
+ ulong l, d, i;
/*
* Invalidate user addresses
@@ 128,8 128,6 @@ mmuinit(void)
void
init0(void)
{
- Chan *c;
-
u->nerrlab = 0;
m->proc = u->p;
u->p->state = Running;
@@ 353,6 351,7 @@ procsave(Proc *p)
{
Balu *balu = (Balu *)u->balusave;
+ USED(p);
fpsave(&u->fpsave);
if(u->fpsave.type){
if(u->fpsave.size > sizeof u->fpsave.junk)
@@ 397,9 396,11 @@ procrestore(Proc *p)
void
buzz(int f, int d)
{
+ USED(f, d);
}
void
lights(int val)
{
+ USED(val);
}
M gnot/mmu.c => gnot/mmu.c +2 -3
@@ 19,8 19,6 @@ void
mapstack(Proc *p)
{
ulong tlbvirt, tlbphys;
- ulong next;
- MMU *mm, *mn, *me;
if(p->upage->va != (USERADDR|(p->pid&0xFFFF)) && p->pid != 0)
@@ 61,8 59,9 @@ putkmmu(ulong tlbvirt, ulong tlbphys)
}
void
-putmmu(ulong tlbvirt, ulong tlbphys, Page *p)
+putmmu(ulong tlbvirt, ulong tlbphys, Page *pg)
{
+ USED(pg);
if(tlbvirt&KZERO)
panic("putmmu");
tlbphys |= VTAG(tlbvirt)<<24;
M gnot/screen.c => gnot/screen.c +3 -0
@@ 135,18 135,21 @@ getcolor(ulong p, ulong *pr, ulong *pg, ulong *pb)
int
setcolor(ulong p, ulong r, ulong g, ulong b)
{
+ USED(p, r, g, b);
return 0; /* can't change mono screen colormap */
}
int
hwcursset(uchar *s, uchar *c, int ox, int oy)
{
+ USED(s, c, ox, oy);
return 0;
}
int
hwcursmove(int x, int y)
{
+ USED(x, y);
return 0;
}
M gnot/trap.c => gnot/trap.c +0 -1
@@ 273,7 273,6 @@ noted(Ureg *ur, ulong arg0)
long
syscall(Ureg *aur)
{
- int i;
long ret;
ulong sp;
Ureg *ur;
M pc/devether.c => pc/devether.c +8 -0
@@ 143,6 143,7 @@ etheropen(Chan *c, int omode)
void
ethercreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
@@ 162,12 163,14 @@ etherread(Chan *c, void *a, long n, ulong offset)
long
etherwrite(Chan *c, char *a, long n, ulong offset)
{
+ USED(offset);
return streamwrite(c, a, n, 0);
}
void
etherremove(Chan *c)
{
+ USED(c);
error(Eperm);
}
@@ 350,6 353,7 @@ clonecon(Chan *c)
Ctlr *cp = &ctlr[0];
Type *tp;
+ USED(c);
for(tp = cp->type; tp < &cp->type[NType]; tp++){
qlock(tp);
if(tp->inuse || tp->q){
@@ 362,6 366,7 @@ clonecon(Chan *c)
return tp - cp->type;
}
exhausted("ether channels");
+ return 0;
}
static void
@@ 370,6 375,7 @@ statsfill(Chan *c, char *p, int n)
Ctlr *cp = &ctlr[0];
char buf[256];
+ USED(c);
sprint(buf, "in: %d\nout: %d\ncrc errs %d\noverflows: %d\nframe errs %d\nbuff errs: %d\noerrs %d\naddr: %.02x:%.02x:%.02x:%.02x:%.02x:%.02x\n",
cp->inpackets, cp->outpackets, cp->crcs,
cp->overflows, cp->frames, cp->buffs, cp->oerrs,
@@ 693,6 699,7 @@ wd8013mode(Ctlr *cp, int on)
static void
wd8013online(Ctlr *cp, int on)
{
+ USED(on);
OUT(cp->hw, w.tcr, 0);
}
@@ 777,6 784,7 @@ wd8013intr(Ureg *ur)
Buffer *tb;
uchar isr;
+ USED(ur);
while(isr = IN(hw, r.isr)){
OUT(hw, w.isr, isr);
if(isr & 0x08) /* Txe - transmit error */
M pc/devfloppy.c => pc/devfloppy.c +7 -10
@@ 196,9 196,6 @@ floppyreset(void)
{
Drive *dp;
Type *t;
- int n;
- ulong p;
- long l;
/*
* init dependent parameters
@@ 290,23 287,27 @@ floppyopen(Chan *c, int omode)
void
floppycreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
void
floppyclose(Chan *c)
{
+ USED(c);
}
void
floppyremove(Chan *c)
{
+ USED(c);
error(Eperm);
}
void
floppywstat(Chan *c, char *dp)
{
+ USED(c, dp);
error(Eperm);
}
@@ 351,7 352,6 @@ floppyread(Chan *c, void *a, long n)
long rv, i;
int nn, sec, head, cyl;
long len;
- long noff;
uchar *aa;
if(c->qid.path == CHDIR)
@@ 420,7 420,6 @@ floppywrite(Chan *c, void *a, long n)
Drive *dp;
long rv, i;
char *aa = a;
- int dev;
rv = 0;
dp = &fl.d[c->qid.path & ~Qmask];
@@ 474,6 473,7 @@ floppykproc(void *a)
{
Drive *dp;
+ USED(a);
while(waserror())
;
for(;;){
@@ 608,8 608,6 @@ floppypos(Drive *dp, long off)
int lsec;
int ltrack;
int end;
- int cyl;
- int track;
lsec = off/dp->t->bytes;
ltrack = lsec/dp->t->sectors;
@@ 647,6 645,7 @@ floppysense(void)
static int
cmddone(void *a)
{
+ USED(a);
return fl.ncmd == 0;
}
@@ 665,8 664,6 @@ floppywait(void)
static int
floppyrecal(Drive *dp)
{
- int type;
-
dp->ccyl = -1;
fl.ncmd = 0;
@@ 784,7 781,6 @@ static long
floppyxfer(Drive *dp, int cmd, void *a, long off, long n)
{
long offset;
- ulong up;
if(off >= dp->t->cap)
return 0;
@@ 866,6 862,7 @@ floppyxfer(Drive *dp, int cmd, void *a, long off, long n)
static void
floppyintr(Ureg *ur)
{
+ USED(ur);
switch(fl.cmd[0]&~Fmulti){
case Fread:
case Fwrite:
M pc/devhard.c => pc/devhard.c +8 -3
@@ 157,7 157,7 @@ Drive *hard;
static void hardintr(Ureg*);
static long hardxfer(Drive*, Partition*, int, long, long);
-static long hardident(Drive*);
+static void hardident(Drive*);
static void hardsetbuf(Drive*, int);
static void hardpart(Drive*);
@@ 171,6 171,7 @@ hardgen(Chan *c, Dirtab *tab, long ntab, long s, Dir *dirp)
Partition *pp;
ulong l;
+ USED(tab, ntab);
qid.vers = 0;
drive = s/Npart;
s = s % Npart;
@@ 304,23 305,27 @@ hardopen(Chan *c, int omode)
void
hardcreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
void
hardclose(Chan *c)
{
+ USED(c);
}
void
hardremove(Chan *c)
{
+ USED(c);
error(Eperm);
}
void
hardwstat(Chan *c, char *dp)
{
+ USED(c, dp);
error(Eperm);
}
@@ 481,7 486,6 @@ static long
hardxfer(Drive *dp, Partition *pp, int cmd, long start, long len)
{
Controller *cp;
- int err;
long lblk;
int cyl, sec, head;
int loop;
@@ 590,7 594,7 @@ hardsetbuf(Drive *dp, int on)
/*
* get parameters from the drive
*/
-static long
+static void
hardident(Drive *dp)
{
Controller *cp;
@@ 758,6 762,7 @@ hardintr(Ureg *ur)
Drive *dp;
long loop;
+ USED(ur);
spllo(); /* let in other interrupts */
/*
M pc/devincon.c => pc/devincon.c +6 -1
@@ 544,6 544,7 @@ inconopen(Chan *c, int omode)
void
inconcreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
@@ 589,6 590,7 @@ inconwrite(Chan *c, void *buf, long n, ulong offset)
Incon *ip;
int data;
+ USED(offset);
switch(c->qid.path){
default:
return streamwrite(c, buf, n, 0);
@@ 617,12 619,14 @@ inconwrite(Chan *c, void *buf, long n, ulong offset)
void
inconremove(Chan *c)
{
+ USED(c);
error(Eperm);
}
void
inconwstat(Chan *c, char *dp)
{
+ USED(c, dp);
error(Eperm);
}
@@ 872,7 876,7 @@ static void
inconkproc(void *arg)
{
Incon *ip;
- Block *bp, *nbp;
+ Block *bp;
int i;
int locked;
@@ 1072,6 1076,7 @@ inconintr(Ureg *ur)
int pcr;
Incon *ip;
+ USED(ur);
ip = &incon[0];
pcr = inb(ip->dev+Qpcr);
status = irdstatus(ip);
M pc/devlpt.c => pc/devlpt.c +7 -1
@@ 121,22 121,27 @@ lptopen(Chan *c, int omode)
void
lptcreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
void
lptclose(Chan *c)
-{}
+{
+ USED(c);
+}
void
lptremove(Chan *c)
{
+ USED(c);
error(Eperm);
}
void
lptwstat(Chan *c, char *dp)
{
+ USED(c, dp);
error(Eperm);
}
@@ 210,5 215,6 @@ lptready(void *base)
static void
lptintr(Ureg *ur)
{
+ USED(ur);
wakeup(&lptrendez);
}
M pc/devrtc.c => pc/devrtc.c +5 -6
@@ 90,12 90,14 @@ rtcopen(Chan *c, int omode)
void
rtccreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
void
rtcclose(Chan *c)
{
+ USED(c);
}
#define GETBCD(o) ((bcdclock[o]&0xf) + 10*(bcdclock[o]>>4))
@@ 103,10 105,7 @@ rtcclose(Chan *c)
long
rtctime(void)
{
- int i,j;
- uchar ch;
uchar bcdclock[Nbcd];
- char atime[64];
Rtc rtc;
outb(Paddr, Status);
@@ 166,12 165,10 @@ rtcwrite(Chan *c, void *buf, long n, ulong offset)
{
Rtc rtc;
ulong secs;
- int i,j;
- uchar ch;
uchar bcdclock[Nbcd];
- uchar *nv;
char *cp, *ep;
+ USED(c);
if(offset!=0)
error(Ebadarg);
@@ 216,12 213,14 @@ rtcwrite(Chan *c, void *buf, long n, ulong offset)
void
rtcremove(Chan *c)
{
+ USED(c);
error(Eperm);
}
void
rtcwstat(Chan *c, char *dp)
{
+ USED(c, dp);
error(Eperm);
}
M pc/devuart.c => pc/devuart.c +9 -3
@@ 193,7 193,7 @@ void
uartputs(IOQ *cq, char *s, int n)
{
Uart *up = cq->ptr;
- int st, ch, x;
+ int ch, x;
int tries;
x = splhi();
@@ 274,11 274,13 @@ uartintr(Uart *up)
void
uartintr0(Ureg *ur)
{
+ USED(ur);
uartintr(&uart[0]);
}
void
uartintr1(Ureg *ur)
{
+ USED(ur);
uartintr(&uart[1]);
}
@@ 302,8 304,6 @@ uartclock(void)
void
uartenable(Uart *up)
{
- int x;
-
/*
* turn on power to the port
*/
@@ 343,6 343,7 @@ uartenable(Uart *up)
/*
* turn off the uart
*/
+void
uartdisable(Uart *up)
{
@@ 654,6 655,7 @@ uartopen(Chan *c, int omode)
void
uartcreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
@@ 667,6 669,7 @@ uartclose(Chan *c)
long
uartread(Chan *c, void *buf, long n, ulong offset)
{
+ USED(offset);
switch(c->qid.path&~CHDIR){
case Qdir:
return devdirread(c, buf, n, uartdir, NUart, devgen);
@@ 680,17 683,20 @@ uartread(Chan *c, void *buf, long n, ulong offset)
long
uartwrite(Chan *c, void *va, long n, ulong offset)
{
+ USED(offset);
return streamwrite(c, va, n, 0);
}
void
uartremove(Chan *c)
{
+ USED(c);
error(Eperm);
}
void
uartwstat(Chan *c, char *dp)
{
+ USED(c, dp);
error(Eperm);
}
M pc/devvga.c => pc/devvga.c +6 -3
@@ 108,20 108,21 @@ vgaopen(Chan *c, int omode)
void
vgacreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
void
vgaclose(Chan *c)
{
+ USED(c);
}
long
vgaread(Chan *c, void *buf, long n, ulong offset)
{
char obuf[60];
- int port, i;
- uchar *mem;
+ int port;
uchar *cp = buf;
void *outfunc(int, int);
@@ 156,7 157,7 @@ long
vgawrite(Chan *c, void *buf, long n, ulong offset)
{
char cbuf[20], *cp;
- int port, i, maxx, maxy;
+ int port, maxx, maxy;
switch(c->qid.path&~CHDIR){
case Qdir:
@@ 203,11 204,13 @@ vgawrite(Chan *c, void *buf, long n, ulong offset)
void
vgaremove(Chan *c)
{
+ USED(c);
error(Eperm);
}
void
vgawstat(Chan *c, char *dp)
{
+ USED(c, dp);
error(Eperm);
}
M pc/dma.c => pc/dma.c +0 -2
@@ 149,8 149,6 @@ dmaend(int chan)
{
DMA *dp;
DMAxfer *xp;
- ulong addr;
- uchar mode;
dp = &dma[(chan>>2)&1];
chan = chan & 3;
M pc/kbd.c => pc/kbd.c +3 -4
@@ 185,8 185,7 @@ i8042a20(void)
void
kbdinit(void)
{
- int c, s;
- int tries;
+ int c;
setvec(Kbdvec, kbdintr);
@@ 241,7 240,6 @@ mymouseputc(int c)
static int nb;
static uchar b[] = {0, 1, 4, 5, 2, 3, 6, 7};
static lastdx, lastdy;
- int diff;
extern Mouseinfo mouse;
/*
@@ 289,7 287,7 @@ middle(int newval)
int
kbdintr0(void)
{
- int s, c, i, nk, nc;
+ int s, c, i, nk;
static int esc1, esc2;
static int shift;
static int caps;
@@ 442,5 440,6 @@ dochar:
void
kbdintr(Ureg *ur)
{
+ USED(ur);
kbdintr0();
}
M pc/main.c => pc/main.c +4 -5
@@ 67,8 67,6 @@ ulong garbage;
void
init0(void)
{
- Chan *c;
-
u->nerrlab = 0;
m->proc = u->p;
u->p->state = Running;
@@ 174,7 172,6 @@ bootargs(ulong base)
{
int i, ac;
uchar *av[32];
- char *p, *pp;
uchar **lsp;
sp = (uchar*)base + BY2PG - MAXSYSARG*BY2WD;
@@ 306,6 303,7 @@ matherror(Ureg *ur)
void
mathemu(Ureg *ur)
{
+ USED(ur);
switch(u->p->fpstate){
case FPinit:
fpinit();
@@ 327,6 325,7 @@ mathemu(Ureg *ur)
void
mathover(Ureg *ur)
{
+ USED(ur);
pexit("Math overrun", 0);
}
@@ 355,6 354,7 @@ procsetup(Proc *p)
void
procsave(Proc *p)
{
+ USED(p);
if(u->p->fpstate == FPactive){
fpsave(&u->fpsave);
u->p->fpstate = FPinactive;
@@ 367,6 367,7 @@ procsave(Proc *p)
void
procrestore(Proc *p)
{
+ USED(p);
}
@@ 395,8 396,6 @@ meminit(void)
void
exit(void)
{
- int i;
-
u = 0;
print("exiting\n");
switch(machtype){
M pc/mmu.c => pc/mmu.c +0 -4
@@ 213,8 213,6 @@ flushmmu(void)
void
mapstack(Proc *p)
{
- ulong tlbphys;
- int i;
Page *pg;
ulong *top;
@@ 292,8 290,6 @@ putmmu(ulong va, ulong pa, Page *pg)
ulong *top;
ulong *pt;
Proc *p;
- char err[64];
- int x;
if(u==0)
panic("putmmu");
M pc/pmu.c => pc/pmu.c +1 -0
@@ 130,6 130,7 @@ pmubuzz(int f, int d)
static QLock bl;
static Rendez br;
+ USED(f);
qlock(&bl);
pmuwrbit(0, 0, 6);
tsleep(&br, return0, 0, d);
M pc/segment.h => pc/segment.h +3 -3
@@ 12,9 12,9 @@ struct Physseg
Page *(*pgalloc)(ulong); /* Allocation if we need it */
void (*pgfree)(Page*);
}physseg[] = {
- { SG_SHARED, "lock", 0, SEGMAXSIZE, &snewpage, &putpage },
- { SG_SHARED, "shared", 0, SEGMAXSIZE, &snewpage, &putpage },
+ { SG_SHARED, "lock", 0, SEGMAXSIZE, snewpage, putpage },
+ { SG_SHARED, "shared", 0, SEGMAXSIZE, snewpage, putpage },
{ SG_PHYSICAL, "kmem", KZERO, SEGMAXSIZE, 0, 0 },
- { SG_BSS, "memory", 0, SEGMAXSIZE, &snewpage, &putpage },
+ { SG_BSS, "memory", 0, SEGMAXSIZE, snewpage, putpage },
{ 0, 0, 0, 0, 0, 0 },
};
M pc/vga.c => pc/vga.c +7 -4
@@ 224,7 224,9 @@ dumpmodes(void) {
#endif
void
-setscreen(int maxx, int maxy, int bpp) {
+setscreen(int maxx, int maxy, int bpp)
+{
+ USED(bpp);
gbitblt(&gscreen, Pt(0, 0), &gscreen, gscreen.r, flipD[S]);
gscreen.width = maxx/32;
gscreen.r.max = Pt(maxx, maxy);
@@ 238,10 240,8 @@ setscreen(int maxx, int maxy, int bpp) {
void
screeninit(void)
{
- int i, j, k;
- int c;
+ int i;
ulong *l;
- VGAmode testmode;
setmode(&mode12);
@@ 334,18 334,21 @@ getcolor(ulong p, ulong *pr, ulong *pg, ulong *pb)
int
setcolor(ulong p, ulong r, ulong g, ulong b)
{
+ USED(p, r, g, b);
return 0; /* can't change mono screen colormap */
}
int
hwcursset(uchar *s, uchar *c, int ox, int oy)
{
+ USED(s, c, ox, oy);
return 0;
}
int
hwcursmove(int x, int y)
{
+ USED(x, y);
return 0;
}
M port/alarm.c => port/alarm.c +0 -1
@@ 14,7 14,6 @@ alarmkproc(void *arg)
{
Proc *rp;
ulong now;
- int i, n, s;
USED(arg);
M port/chan.c => port/chan.c +3 -5
@@ 27,8 27,6 @@ int
decref(Ref *r)
{
int x;
- int i;
- Segment *s;
lock(r);
x = --r->ref;
@@ 432,7 430,7 @@ namec(char *name, int amode, int omode, ulong perm)
int t;
int mntok, isdot;
char *p;
- char *elem, *nn;
+ char *elem;
char createerr[ERRLEN];
if(name[0] == 0)
@@ 668,8 666,8 @@ nameok(char *elem)
char*
nextelem(char *name, char *elem)
{
- int i, user, w;
- char *end, *e;
+ int w;
+ char *end;
Rune r;
if(*name == '/')
M port/dev.c => port/dev.c +1 -0
@@ 57,6 57,7 @@ devattach(int tc, char *spec)
{
Chan *c;
+ USED(spec);
c = newchan();
c->qid = (Qid){CHDIR, 0};
c->type = devno(tc, 0);
M port/devarp.c => port/devarp.c +7 -2
@@ 74,6 74,9 @@ arpgen(Chan *c, void *vp, int ntab, int i, Dir *dp)
{
Qid q;
+ USED(vp);
+ USED(ntab);
+
q.vers = 0;
/* top level directory contains the directory arp */
@@ 200,9 203,9 @@ long
arpread(Chan *c, void *a, long n, ulong offset)
{
char buf[100];
- Arpcache *ap, *ep;
+ Arpcache *ap;
int part, bytes, size;
- char *ptr, *ststr;
+ char *ststr;
switch((int)(c->qid.path&~CHDIR)){
case arpdirqid:
@@ 255,6 258,8 @@ arpwrite(Chan *c, char *a, long n, ulong offset)
char buf[20], *field[5];
int m;
+ USED(offset);
+
switch(STREAMTYPE(c->qid.path)) {
case arpctlqid:
M port/devbit.c => port/devbit.c +7 -8
@@ 242,8 242,7 @@ bitdebug(void)
void
bitreset(void)
{
- int i, ws;
- GBitmap *bp;
+ int ws;
ulong r;
Arena *a;
@@ 700,7 699,7 @@ long
bitwrite(Chan *c, void *va, long n, ulong offset)
{
uchar *p, *q;
- long m, v, miny, maxy, minx, maxx, t, x, y;
+ long m, v, miny, maxy, t, x, y;
ulong l, nw, ws, rv, q0, q1;
int off, isoff, i, j, ok;
Point pt, pt1, pt2;
@@ 708,11 707,13 @@ bitwrite(Chan *c, void *va, long n, ulong offset)
Cursor curs;
Fcode fc;
Fontchar *fcp;
- GBitmap *b, *src, *dst, *bp;
+ GBitmap *src, *dst;
BSubfont *f, *tf, **fp;
GFont *ff, **ffp;
GCacheinfo *gc;
+ USED(offset);
+
if(c->qid.path == CHDIR)
error(Eisdir);
@@ 1450,12 1451,10 @@ bitwrite(Chan *c, void *va, long n, ulong offset)
int
bitalloc(Rectangle rect, int ld)
{
- Arena *a, *ea, *na, *aa;
+ Arena *a, *ea, *aa;
GBitmap *b, **bp, **ep;
- BSubfont *s;
ulong l, ws, nw;
long t;
- int i, try;
ws = BI2WD>>ld; /* pixels per word */
if(rect.min.x >= 0){
@@ 1674,7 1673,7 @@ bitloadchar(GFont *f, int ci, GSubfont *subf, int si)
void
bitcompact(void)
{
- Arena *a, *b, *ea, *na;
+ Arena *a, *ea, *na;
ulong *p1, *p2, n;
ea = &bit.arena[bit.narena];
M port/devboot.c => port/devboot.c +2 -2
@@ 62,7 62,7 @@ bootopen(Chan *c, int omode)
void
bootcreate(Chan *c, char *name, int omode, ulong perm)
{
- USED(c);
+ USED(c, name, omode, perm);
error(Eperm);
}
@@ 130,6 130,6 @@ bootremove(Chan *c)
void
bootwstat(Chan *c, char *dp)
{
- USED(c);
+ USED(c, dp);
error(Eperm);
}
M port/devconc.c => port/devconc.c +6 -3
@@ 283,7 283,7 @@ concdevstclose(Queue *q)
q->ptr = 0;
q->other->ptr = 0;
dp->rq = 0;
- streamexit(cp->s, 1);
+ streamexit(cp->s);
qunlock(cp);
}
@@ 376,6 376,7 @@ concgen(Chan *c, Dirtab *tab, int ntab, int i, Dir *dp)
Conc *cp;
char buf[16];
+ USED(tab, ntab);
cp = &concs[c->dev];
switch(c->qid.path){
case CHDIR:
@@ 445,7 446,7 @@ concopen(Chan *c, int omode)
void
conccreate(Chan *c, char *name, int omode, ulong perm)
{
- USED(c);
+ USED(c, name, omode, perm);
error(Eperm);
}
@@ 459,6 460,7 @@ concclose(Chan *c)
long
concread(Chan *c, void *a, long n, ulong offset)
{
+ USED(offset);
if(c->stream)
return streamread(c, a, n);
if(c->qid.path & CHDIR)
@@ 470,6 472,7 @@ concread(Chan *c, void *a, long n, ulong offset)
long
concwrite(Chan *c, void *a, long n, ulong offset)
{
+ USED(offset);
return streamwrite(c, a, n, 0);
}
@@ 483,6 486,6 @@ concremove(Chan *c)
void
concwstat(Chan *c, char *dp)
{
- USED(c);
+ USED(c, dp);
error(Eperm);
}
M port/devcons.c => port/devcons.c +1 -4
@@ 489,10 489,8 @@ consread(Chan *c, void *buf, long n, ulong offset)
{
int ch, i, j, k, id;
ulong l;
- uchar *out;
char *cbuf = buf;
- char *user, *chal;
- int userlen;
+ char *chal;
Block *cb;
char tmp[6*NUMSIZE], xbuf[512];
Mach *mp;
@@ 685,7 683,6 @@ consread(Chan *c, void *buf, long n, ulong offset)
void
conslights(char *a, int n)
{
- int l;
char line[128];
char *lp;
int c;
M port/devdk.c => port/devdk.c +5 -5
@@ 696,6 696,9 @@ void
dkcreate(Chan *c, char *name, int omode, ulong perm)
{
USED(c);
+ USED(name);
+ USED(omode);
+ USED(perm);
error(Eperm);
}
@@ 720,6 723,7 @@ dkwrite(Chan *c, void *a, long n, ulong offset)
char *field[5];
int m;
+ USED(offset);
t = STREAMTYPE(c->qid.path);
/*
@@ 840,8 844,6 @@ dkopenline(Dk *dp, int line)
static Chan*
dkopencsc(Dk *dp)
{
- Line *lp;
-
qlock(&dp->csclock);
if(dp->csc == 0)
dp->csc = dkopenline(dp, dp->ncsc);
@@ 1321,7 1323,6 @@ static void
dkwindow(Chan *c)
{
char buf[64];
- long wins;
Line *lp;
lp = linealloc(dk[c->dev], STREAMID(c->qid.path), 1);
@@ 1517,7 1518,6 @@ dkchgmesg(Chan *c, Dk *dp, Dkmsg *dialp, int line)
static void
dkreplymesg(Dk *dp, Dkmsg *dialp, int line)
{
- Proc *p;
Line *lp;
DPRINT("dkreplymesg(%d)\n", line);
@@ 1557,7 1557,7 @@ dkreplymesg(Dk *dp, Dkmsg *dialp, int line)
static void
dktimer(void *a)
{
- int dki, i;
+ int i;
Dk *dp;
Line *lp;
Chan *c;
M port/devdup.c => port/devdup.c +4 -0
@@ 16,6 16,8 @@ dupgen(Chan *c, Dirtab *tab, int ntab, int s, Dir *dp)
Chan *f;
static int perm[] = { 0400, 0200, 0600, 0 };
+ USED(tab);
+ USED(ntab);
if(s >= NFD)
return -1;
if((f=fgrp->fd[s]) == 0)
@@ 99,6 101,7 @@ void
dupwstat(Chan *c, char *dp)
{
USED(c);
+ USED(dp);
error(Egreg);
}
@@ 113,6 116,7 @@ dupread(Chan *c, void *va, long n, ulong offset)
{
char *a = va;
+ USED(offset);
if(c->qid.path != CHDIR)
panic("dupread");
return devdirread(c, a, n, (Dirtab *)0, 0L, dupgen);
M port/devenv.c => port/devenv.c +4 -0
@@ 28,6 28,9 @@ envgen(Chan *c, Dirtab *tab, int ntab, int s, Dir *dp)
Egrp *eg;
Evalue *e;
+ USED(tab);
+ USED(ntab);
+
eg = u->p->egrp;
qlock(eg);
@@ 109,6 112,7 @@ envcreate(Chan *c, char *name, int omode, ulong perm)
Egrp *eg;
Evalue *e;
+ USED(perm);
if(c->qid.path != CHDIR)
error(Eperm);
M port/devip.c => port/devip.c +11 -9
@@ 37,8 37,6 @@ Qinfo *protocols[] = { &tcpinfo, &udpinfo, &ilinfo, 0 };
void
ipinitifc(Ipifc *ifc, Qinfo *stproto)
{
- int j;
-
ifc->conv = xalloc(Nipconv * sizeof(Ipconv*));
ifc->protop = stproto;
ifc->nconv = Nipconv;
@@ 267,6 265,7 @@ ipwrite(Chan *c, char *a, long n, ulong offset)
Port port;
Ipconv *cp;
+ USED(offset);
type = STREAMTYPE(c->qid.path);
if (type == Sdataqid)
return streamwrite(c, a, n, 0);
@@ 588,7 587,7 @@ udpstopen(Queue *q, Stream *s)
Ipconv *ipc;
ipc = ipcreateconv(ipifc[s->dev], s->id);
- initipifc(ipifc[s->dev], IP_UDPPROTO, udprcvmsg, 1500, 512, ETHER_HDR, "UDP");
+ initipifc(ipifc[s->dev], IP_UDPPROTO, udprcvmsg, 1500, 512, ETHER_HDR);
ipc->readq = RD(q);
RD(q)->ptr = (void *)ipc;
@@ 607,7 606,6 @@ tcpstoput(Queue *q, Block *bp)
{
Ipconv *s;
Tcpctl *tcb;
- int len, errnum;
Block *f;
s = (Ipconv *)(q->ptr);
@@ 687,7 685,7 @@ tcpstopen(Queue *q, Stream *s)
if(tcpbase == 0)
tcpbase = ipifc[s->dev]->conv;
ifc = ipifc[s->dev];
- initipifc(ifc, IP_TCPPROTO, tcp_input, 1500, 512, ETHER_HDR, "TCP");
+ initipifc(ifc, IP_TCPPROTO, tcp_input, 1500, 512, ETHER_HDR);
ipc = ipcreateconv(ifc, s->id);
ipc->readq = RD(q);
@@ 711,6 709,8 @@ ipremotefill(Chan *c, char *buf, int len)
{
Ipconv *cp;
+ if(len < 24)
+ error(Ebadarg);
cp = ipcreateconv(ipifc[c->dev], STREAMID(c->qid.path));
sprint(buf, "%d.%d.%d.%d %d\n", fmtaddr(cp->dst), cp->pdst);
}
@@ 720,6 720,8 @@ iplocalfill(Chan *c, char *buf, int len)
{
Ipconv *cp;
+ if(len < 24)
+ error(Ebadarg);
cp = ipcreateconv(ipifc[c->dev], STREAMID(c->qid.path));
sprint(buf, "%d.%d.%d.%d %d\n", fmtaddr(Myip[Myself]), cp->psrc);
}
@@ 730,6 732,8 @@ ipstatusfill(Chan *c, char *buf, int len)
int connection;
Ipconv *cp;
+ if(len < 64)
+ error(Ebadarg);
connection = STREAMID(c->qid.path);
cp = ipcreateconv(ipifc[c->dev], connection);
if(cp->ifc->protop == &tcpinfo)
@@ 756,7 760,6 @@ iplisten(Chan *c)
Ipconv **p, **etab, *new;
Ipconv *s;
int connection;
- Ipconv *cp;
connection = STREAMID(c->qid.path);
s = ipcreateconv(ipifc[c->dev], connection);
@@ 1074,7 1077,7 @@ nextport(Ipifc *ifc, int priv)
/* NEEDS HASHING ! */
Ipconv*
-ip_conn(Ipifc *ifc, Port dst, Port src, Ipaddr dest, char proto)
+ip_conn(Ipifc *ifc, Port dst, Port src, Ipaddr dest)
{
Ipconv **p, *s, **etab;
@@ 1104,6 1107,7 @@ ip_conn(Ipifc *ifc, Port dst, Port src, Ipaddr dest, char proto)
void
bsdopen(Queue *q, Stream *s)
{
+ USED(s);
RD(q)->ptr = q;
WR(q)->ptr = q;
}
@@ 1125,9 1129,7 @@ void
bsdoput(Queue *q, Block *bp)
{
uchar *luser;
- uchar *p;
Block *nbp;
- int n;
/* just pass it on if we've done authentication */
if(q->ptr == 0 || bp->type != M_DATA){
M port/deviproute.c => port/deviproute.c +2 -1
@@ 91,7 91,6 @@ void
ipaddroute(ulong dst, ulong mask, ulong gate)
{
Iproute *r, *e, *free;
- int i;
/*
* filter out impossible requests
@@ 330,6 329,8 @@ iproutewrite(Chan *c, char *a, long n, ulong offset)
Ipaddr mask, dst, gate;
int m;
+ USED(offset);
+
switch((int)(c->qid.path&~CHDIR)){
case Qdata:
strncpy(buf, a, sizeof buf);
M port/devkprof.c => port/devkprof.c +2 -0
@@ 160,6 160,8 @@ kprofread(Chan *c, void *va, long n, ulong offset)
long
kprofwrite(Chan *c, char *a, long n, ulong offset)
{
+ USED(offset);
+
switch((int)(c->qid.path&~CHDIR)){
case Kprofctlqid:
if(strncmp(a, "startclr", 8) == 0){
M port/devlance.c => port/devlance.c +1 -2
@@ 454,7 454,6 @@ static void
lancestart(int mode)
{
int i;
- Etherpkt *p;
Lancemem *lm = LANCEMEM;
Msg *m;
@@ 617,6 616,7 @@ lanceread(Chan *c, void *a, long n, ulong offset)
long
lancewrite(Chan *c, void *a, long n, ulong offset)
{
+ USED(offset);
return streamwrite(c, a, n, 0);
}
@@ 689,7 689,6 @@ lanceclonecon(Chan *c)
void
lanceintr(void)
{
- int i;
ushort csr;
csr = *l.rdp;
M port/devmux.c => port/devmux.c +5 -3
@@ 77,6 77,7 @@ muxgen(Chan *c, Dirtab *tab, int ntab, int s, Dir *dp)
char buf[10];
int nq;
+ USED(tab, ntab);
if(c->qid.path == CHDIR) {
if(s >= Nmuxchan)
return -1;
@@ 190,7 191,7 @@ muxopen(Chan *c, int omode)
{
Mux *m;
Con *cm, *e;
- int mux, ok;
+ int mux;
Chan *new;
c = devopen(c, omode, 0, 0, muxgen);
@@ 406,6 407,7 @@ muxread(Chan *c, void *va, long n, ulong offset)
Con *cm;
int bread;
+ USED(offset);
if(c->qid.path & CHDIR)
return devdirread(c, va, n, 0, 0, muxgen);
@@ 449,9 451,9 @@ muxwrite(Chan *c, void *va, long n, ulong offset)
Mux *m;
Con *cm;
int muxid, fd;
- Block *f, *bp;
char *a, hdr[3], buf[10];
+ USED(offset);
if(c->qid.path&CHDIR)
error(Eisdir);
@@ 589,7 591,7 @@ havedata(Dtq *q)
ulong
muxreadq(Mux *m, Dtq *q, char *va, ulong n)
{
- int l, nread, gotdelim;
+ int l, nread;
Block *bp, *f1;
qlock(&q->rd);
M port/devpipe.c => port/devpipe.c +3 -1
@@ 213,7 213,7 @@ pipeclose(Chan *c)
remote = c->stream->devq->ptr;
if(streamclose(c) == 0){
if(remote)
- streamexit(remote, 0);
+ streamexit(remote);
}
qunlock(p);
}
@@ 239,6 239,7 @@ pipeclose(Chan *c)
long
piperead(Chan *c, void *va, long n, ulong offset)
{
+ USED(offset);
if(c->qid.path & CHDIR)
return devdirread(c, va, n, pipedir, NPIPEDIR, pipegen);
@@ 252,6 253,7 @@ piperead(Chan *c, void *va, long n, ulong offset)
long
pipewrite(Chan *c, void *va, long n, ulong offset)
{
+ USED(offset);
if(waserror()) {
postnote(u->p, 1, "sys: write on closed pipe", NExit);
error(Egreg);
M port/devproc.c => port/devproc.c +1 -2
@@ 64,6 64,7 @@ procgen(Chan *c, Dirtab *tab, int ntab, int s, Dir *dp)
char buf[NAMELEN];
ulong pid, path, perm;
+ USED(ntab);
if(c->qid.path == CHDIR){
if(s >= conf.nproc)
return -1;
@@ 137,7 138,6 @@ procopen(Chan *c, int omode)
{
Proc *p;
Pgrp *pg;
- Segment *s;
Chan *tc;
if(c->qid.path & CHDIR)
@@ 235,7 235,6 @@ procread(Chan *c, void *va, long n, ulong offset)
KMap *k;
int i, j;
long l;
- long pid;
User *up;
Segment *sg;
M port/devroot.c => port/devroot.c +2 -0
@@ 45,6 45,8 @@ int nroot;
int
rootgen(Chan *c, Dirtab *tab, int ntab, int i, Dir *dp)
{
+ USED(ntab);
+
if(i >= nroot)
return -1;
M port/devscc.c => port/devscc.c +1 -2
@@ 194,7 194,6 @@ sccparity(SCC *sp, char type)
void
sccbits(SCC *sp, int n)
{
- int val;
int rbits, tbits;
switch(n){
@@ 743,7 742,6 @@ sccclose(Chan *c)
long
sccread(Chan *c, void *buf, long n, ulong offset)
{
- SCC *sp;
char b[8];
if(c->qid.path == CHDIR)
@@ 763,6 761,7 @@ sccread(Chan *c, void *buf, long n, ulong offset)
long
sccwrite(Chan *c, void *va, long n, ulong offset)
{
+ USED(offset);
return streamwrite(c, va, n, 0);
}
M port/devscsi.c => port/devscsi.c +6 -0
@@ 96,12 96,14 @@ scsigen1(Chan *c, long qid, Dir *dp)
static int
scsigeno(Chan *c, Dirtab *tab, long ntab, long s, Dir *dp)
{
+ USED(tab, ntab, s);
return scsigen1(c, c->qid.path, dp);
}
static int
scsigen(Chan *c, Dirtab *tab, long ntab, long s, Dir *dp)
{
+ USED(tab, ntab);
if (c->qid.path == CHDIR) {
if (0<=s && s<=7)
return scsigen1(c, CHDIR|0x100|(s<<4), dp);
@@ 148,6 150,7 @@ scsiopen(Chan *c, int omode)
void
scsicreate(Chan *c, char *name, int omode, ulong perm)
{
+ USED(c, name, omode, perm);
error(Eperm);
}
@@ 303,12 306,14 @@ scsiwrite(Chan *c, char *a, long n, ulong offset)
void
scsiremove(Chan *c)
{
+ USED(c);
error(Eperm);
}
void
scsiwstat(Chan *c, char *dp)
{
+ USED(c, dp);
error(Eperm);
}
@@ 559,6 564,7 @@ scsiinit(void)
static int
scsidone(void *arg)
{
+ USED(arg);
return (scsibusy == 0);
}
M port/devsrv.c => port/devsrv.c +5 -2
@@ 27,6 27,8 @@ srvgen(Chan *c, Dirtab *tab, int ntab, int s, Dir *dp)
{
Srv *sp;
+ USED(tab);
+ USED(ntab);
qlock(&srvlk);
for(sp = srv; sp && s; sp = sp->link)
s--;
@@ 148,7 150,6 @@ srvcreate(Chan *c, char *name, int omode, ulong perm)
void
srvremove(Chan *c)
{
- Chan *f;
Srv *sp, **l;
if(c->qid.path == CHDIR)
@@ 197,6 198,7 @@ srvclose(Chan *c)
long
srvread(Chan *c, void *va, long n, ulong offset)
{
+ USED(offset);
isdir(c);
return devdirread(c, va, n, 0, 0, srvgen);
}
@@ 207,9 209,10 @@ srvwrite(Chan *c, void *va, long n, ulong offset)
Srv *sp;
Fgrp *f;
Chan *c1;
- int i, fd;
+ int fd;
char buf[32];
+ USED(offset);
if(n >= sizeof buf)
error(Egreg);
memmove(buf, va, n); /* so we can NUL-terminate */
M port/devwren.c => port/devwren.c +1 -0
@@ 78,6 78,7 @@ wrengen(Chan *c, Dirtab *tab, long ntab, long s, Dir *dirp)
Partition *pp;
ulong l;
+ USED(tab, ntab);
qid.vers = 0;
drive = c->dev;
if(drive >= Ndisk)
M port/fault.c => port/fault.c +0 -2
@@ 301,8 301,6 @@ okaddr(ulong addr, ulong len, int write)
void
validaddr(ulong addr, ulong len, int write)
{
- Segment *s;
-
if(!okaddr(addr, len, write))
pexit("Suicide", 0);
}
M port/ipdat.h => port/ipdat.h +2 -2
@@ 442,8 442,8 @@ void ilstart(Ipconv *, int, int);
int inb_window(Tcpctl *, int);
void init_tcpctl(Ipconv *);
void initfrag(int);
-void initipifc(Ipifc*, uchar, void (*)(Ipifc*, Block*), int, int, int, char*);
-Ipconv* ip_conn(Ipifc*, Port, Port, Ipaddr dest, char proto);
+void initipifc(Ipifc*, uchar, void (*)(Ipifc*, Block*), int, int, int);
+Ipconv* ip_conn(Ipifc*, Port, Port, Ipaddr dest);
ushort ip_csum(uchar*);
Block* ip_reassemble(int, Block*, Etherhdr*);
int ipclonecon(Chan *);
M port/net.c => port/net.c +1 -0
@@ 42,6 42,7 @@ netgen(Chan *c, void *vp, int ntab, int i, Dir *dp)
int perm;
char *o;
+ USED(ntab);
q.vers = 0;
/* top level directory contains the name of the network */
M port/page.c => port/page.c +1 -1
@@ 350,7 350,7 @@ Pte*
ptecpy(Pte *old)
{
Pte *new;
- Page **src, **dst, **end;
+ Page **src, **dst;
new = ptealloc();
dst = &new->pages[old->first-old->pages];
M port/pgrp.c => port/pgrp.c +1 -1
@@ 133,7 133,7 @@ closefgrp(Fgrp *f)
Mount*
newmount(Mhead *mh, Chan *to)
{
- Mount *m, *f, *e;
+ Mount *m;
m = smalloc(sizeof(Mount));
m->to = to;
M port/portfns.h => port/portfns.h +1 -1
@@ 212,7 212,7 @@ void splx(int);
int streamclose(Chan*);
int streamclose1(Stream*);
int streamenter(Stream*);
-void streamexit(Stream*, int);
+void streamexit(Stream*);
Devgen streamgen;
void streaminit(void);
void streaminit0(void);
M port/proc.c => port/proc.c +0 -4
@@ 52,7 52,6 @@ void
schedinit(void) /* never returns */
{
Proc *p;
- Page *pg;
setlabel(&m->sched);
if(u){
@@ 152,7 151,6 @@ runproc(void)
{
Schedq *rq;
Proc *p;
- int i;
loop:
spllo();
@@ 731,8 729,6 @@ kproc(char *name, void (*func)(void *), void *arg)
p->pgrp = kpgrp;
incref(kpgrp);
- if(u->p->user[0] != '\0')
- user = u->p->user;
strcpy(p->text, name);
p->nchild = 0;
M port/segment.c => port/segment.c +1 -1
@@ 396,7 396,7 @@ done:
ulong
segattach(Proc *p, ulong attr, char *name, ulong va, ulong len)
{
- Segment *s, *ns, *new;
+ Segment *s, *ns;
Physseg *ps;
ulong newtop;
int i, sno;
M port/stil.c => port/stil.c +3 -6
@@ 73,7 73,7 @@ ilopen(Queue *q, Stream *s)
}
ipc = ipcreateconv(ipifc[s->dev], s->id);
- initipifc(ipc->ifc, IP_ILPROTO, ilrcvmsg, 1500, 60, ETHER_HDR, "IL");
+ initipifc(ipc->ifc, IP_ILPROTO, ilrcvmsg, 1500, 60, ETHER_HDR);
ipc->readq = RD(q);
RD(q)->ptr = (void *)ipc;
@@ 86,7 86,6 @@ ilclose(Queue *q)
{
Ipconv *s;
Ilcb *ic;
- Block *bp, *next;
s = (Ipconv *)(q->ptr);
ic = &s->ilctl;
@@ 121,7 120,7 @@ iloput(Queue *q, Block *bp)
Ilhdr *ih;
Ilcb *ic;
int dlen;
- Block *np, *f;
+ Block *f;
ulong id;
ipc = (Ipconv *)(q->ptr);
@@ 266,7 265,6 @@ ilrcvmsg(Ipifc *ifc, Block *bp)
Ipconv *s, **p, **etab, *new;
short sp, dp;
Ipaddr dst;
- char *st;
ih = (Ilhdr *)bp->rptr;
plen = blen(bp);
@@ 499,7 497,7 @@ _ilprocess(Ipconv *s, Ilhdr *h, Block *bp)
void
ilrexmit(Ilcb *ic)
{
- Block *nb, *bp;
+ Block *nb;
Ilhdr *h;
nb = 0;
@@ 713,7 711,6 @@ ilackproc(void *a)
Ipifc *ifc;
Ipconv **base, **p, **end, *s;
Ilcb *ic;
- Block *bp, *np;
ifc = (Ipifc*)a;
base = ifc->conv;
M port/stip.c => port/stip.c +1 -1
@@ 95,7 95,7 @@ ipetheropen(Queue *q, Stream *s)
*/
void
initipifc(Ipifc *ifc, uchar ptcl, void (*recvfun)(Ipifc*, Block *bp), int max,
- int min, int hdrsize, char *name)
+ int min, int hdrsize)
{
qlock(ifc);
ifc->iprcv = recvfun;
M port/stlapd.c => port/stlapd.c +2 -6
@@ 171,6 171,7 @@ lapdopen(Queue *q, Stream *s)
Lapd *lp;
char name[32];
+ USED(s);
for(lp=lapd; lp<&lapd[conf.nlapd]; lp++){
qlock(lp);
if(lp->state == 0)
@@ 201,8 202,6 @@ lapdopen(Queue *q, Stream *s)
static void
mdl_assign(Lapd *lp)
{
- Block *b; uchar *p;
-
qlock(lp);
if (lp->state != NoTEI) {
qunlock(lp);
@@ 244,8 243,6 @@ assigntei(Lapd *lp)
static void
dl_establish(Lapd *lp)
{
- Block *b; uchar *p;
-
qlock(lp);
if (lp->state != TEIassigned) {
qunlock(lp);
@@ 265,8 262,6 @@ dl_establish(Lapd *lp)
static void
dl_release(Lapd *lp)
{
- Block *b; uchar *p;
-
qlock(lp);
if (lp->state != Multiframe) {
qunlock(lp);
@@ 613,6 608,7 @@ lapdctloput(Lapd *lp, Queue *q, Block *bp)
{
char *fields[2];
+ USED(lp);
switch(bp->type){
case M_CTL:
if(streamparse("debug", bp)){
M port/stream.c => port/stream.c +9 -8
@@ 637,9 637,6 @@ static void hangup(Stream*);
int
streamgen(Chan *c, Dirtab *tab, int ntab, int s, Dir *dp)
{
- Proc *p;
- char buf[NAMELEN];
-
if(s < ntab)
tab = &tab[s];
else if(s < ntab + Shighqid - Slowqid + 1)
@@ 771,7 768,7 @@ streamenter(Stream *s)
s->inuse++;
qunlock(hb);
if(s->opens == 0){
- streamexit(s, 1);
+ streamexit(s);
return -1;
}
return 0;
@@ 785,11 782,10 @@ streamenter(Stream *s)
* zero, free the stream.
*/
void
-streamexit(Stream *s, int locked)
+streamexit(Stream *s)
{
Queue *q;
Queue *nq;
- char *name;
Sthash *hb;
Stream **l, *ns;
@@ 843,7 839,6 @@ int
streamclose1(Stream *s)
{
Queue *q, *nq;
- Block *bp;
int rv;
/*
@@ 883,7 878,7 @@ streamclose1(Stream *s)
/*
* leave it and free it
*/
- streamexit(s, 1);
+ streamexit(s);
return rv;
}
int
@@ 1181,6 1176,12 @@ streamwrite(Chan *c, void *a, long n, int docopy)
Block *bp;
char *va;
+ /*
+ * docopy will get used if I ever figure out when to avoid copying
+ * data. -- presotto
+ */
+ USED(docopy);
+
s = c->stream;
/*
M port/streboot.c => port/streboot.c +1 -0
@@ 26,6 26,7 @@ static void
rebootopen(Queue *q, Stream *s)
{
USED(q);
+ USED(s);
if(strcmp(u->p->user, eve) != 0)
error(Eperm);
}
M port/stsplice.c => port/stsplice.c +0 -2
@@ 73,8 73,6 @@ spliceoput(Queue *q, Block *bp)
static void
spliceiput(Queue *q, Block *bp)
{
- Stream *s;
-
if(bp->type == M_HANGUP)
PUTNEXT(q, bp);
else
M port/sturp.c => port/sturp.c +8 -21
@@ 124,7 124,7 @@ static void sendctl(Urp*, int);
static void sendack(Urp*);
static void sendrej(Urp*);
static void initoutput(Urp*, int);
-static void initinput(Urp*, int);
+static void initinput(Urp*);
static void urpkproc(void *arg);
static void urpvomit(char*, Urp*);
static void tryoutput(Urp*);
@@ 148,9 148,8 @@ static void
urpopen(Queue *q, Stream *s)
{
Urp *up;
- int i;
- char name[128];
+ USED(s);
if(!urpkstarted){
qlock(&urpkl);
if(!urpkstarted){
@@ 188,7 187,7 @@ urpopen(Queue *q, Stream *s)
up->wq = q->other;
up->state = OPEN;
qunlock(up);
- initinput(up, 0);
+ initinput(up);
initoutput(up, 0);
}
@@ 206,7 205,6 @@ isflushed(void *a)
static void
urpclose(Queue *q)
{
- Block *bp;
Urp *up;
int i;
@@ 334,7 332,7 @@ urpciput(Queue *q, Block *bp)
sendctl(up, AINIT);
if(ctl == INIT1)
q->put = urpiput;
- initinput(up, 0);
+ initinput(up);
break;
case INITREQ:
@@ 467,7 465,7 @@ urpiput(Queue *q, Block *bp)
sendctl(up, AINIT);
if(ctl == INIT0)
q->put = urpciput;
- initinput(up, 0);
+ initinput(up);
break;
case INITREQ:
@@ 569,20 567,12 @@ static void
urpctloput(Urp *up, Queue *q, Block *bp)
{
char *fields[2];
- int n;
- int inwin=0, outwin=0;
+ int outwin;
switch(bp->type){
case M_CTL:
if(streamparse("init", bp)){
- switch(getfields((char *)bp->rptr, fields, 2, ' ')){
- case 2:
- inwin = strtoul(fields[1], 0, 0);
- case 1:
- outwin = strtoul(fields[0], 0, 0);
- }
- USED(inwin);
-/* initinput(up, inwin); */
+ outwin = strtoul((char*)bp->rptr, 0, 0);
initoutput(up, outwin);
freeb(bp);
return;
@@ 635,7 625,6 @@ output(Urp *up)
Block *bp, *nbp;
ulong now;
Queue *q;
- int n;
int i;
if(!canqlock(&up->xmit))
@@ 787,8 776,6 @@ sendrej(Urp *up)
static void
sendack(Urp *up)
{
- Block *bp;
-
/*
* check the precondition for acking
*/
@@ 986,7 973,7 @@ initoutput(Urp *up, int window)
* initialize input
*/
static void
-initinput(Urp *up, int window)
+initinput(Urp *up)
{
/*
* restart all sequence parameters
M port/swap.c => port/swap.c +3 -3
@@ 7,7 7,7 @@
/* Predeclaration */
void pageout(Proc *p, Segment*);
-void pagepte(int, Segment*, Page**);
+void pagepte(int, Page**);
int needpages(void*);
void pager(void*);
void executeio(void);
@@ 188,7 188,7 @@ pageout(Proc *p, Segment *s)
if(entry->modref & PG_REF)
entry->modref &= ~PG_REF;
else
- pagepte(type, s, pg);
+ pagepte(type, pg);
if(ioptr >= Maxpages)
goto out;
@@ 235,7 235,7 @@ canflush(Proc *p, Segment *s)
}
void
-pagepte(int type, Segment *s, Page **pg)
+pagepte(int type, Page **pg)
{
ulong daddr;
Page *outp;
M port/sysfile.c => port/sysfile.c +2 -7
@@ 194,7 194,7 @@ sysclose(ulong *arg)
long
unionread(Chan *c, void *va, long n)
{
- Chan *mc, *nc;
+ Chan *nc;
Pgrp *pg = u->p->pgrp;
long nr;
@@ 343,7 343,6 @@ long
sysfstat(ulong *arg)
{
Chan *c;
- long n;
validaddr(arg[1], DIRLEN, 1);
evenaddr(arg[1]);
@@ 356,7 355,6 @@ long
sysstat(ulong *arg)
{
Chan *c;
- long n;
validaddr(arg[1], DIRLEN, 1);
evenaddr(arg[1]);
@@ 390,8 388,7 @@ bindmount(ulong *arg, int ismount)
Chan *c0, *c1;
ulong flag;
long ret;
- char *p;
- int t, fd;
+ int fd;
struct{
Chan *chan;
char *spec;
@@ 534,7 531,6 @@ long
syswstat(ulong *arg)
{
Chan *c;
- long n;
validaddr(arg[1], DIRLEN, 0);
nameok((char*)arg[1]);
@@ 554,7 550,6 @@ long
sysfwstat(ulong *arg)
{
Chan *c;
- long n;
validaddr(arg[1], DIRLEN, 0);
nameok((char*)arg[1]);
M port/sysproc.c => port/sysproc.c +5 -10
@@ 19,15 19,13 @@ sysr1(ulong *arg)
long
sysrfork(ulong *arg)
{
- Chan *c;
KMap *k;
Pgrp *opg;
Egrp *oeg;
Fgrp *ofg;
- Segment *s;
- int n, on, i;
+ int n, i;
Proc *p, *parent;
- ulong usp, upa, pid, flag;
+ ulong upa, pid, flag;
/*
* used to compute last valid system stack address for copy
*/
@@ 206,14 204,13 @@ sysexec(ulong *arg)
{
Proc *p;
Segment *s, *ts;
- ulong l, t, d, b, v;
+ ulong t, d, b;
int i;
- Chan *tc, *c;
+ Chan *tc;
char **argv, **argp;
char *a, *charp, *file;
char *progarg[sizeof(Exec)/2+1], elem[NAMELEN];
ulong ssize, spage, nargs, nbytes, n, bssend;
- ulong *sp;
int indir;
Exec exec;
char line[sizeof(Exec)];
@@ 506,8 503,6 @@ sysdeath(ulong *arg)
long
syserrstr(ulong *arg)
{
- char buf[ERRLEN];
-
validaddr(arg[0], ERRLEN, 1);
memmove((char*)arg[0], u->error, ERRLEN);
strncpy(u->error, Enoerror, ERRLEN);
@@ 628,7 623,7 @@ sysbrk_(ulong *arg)
long
sysrendezvous(ulong *arg)
{
- Proc *p, *d, **l;
+ Proc *p, **l;
int s, tag;
ulong val;
M port/tcpif.c => port/tcpif.c +0 -1
@@ 72,7 72,6 @@ void
tcpstart(Ipconv *s, int mode, ushort window, char tos)
{
Tcpctl *tcb = &s->tcpctl;
- char msg[NAMELEN+2];
if(tcb->state != Closed)
return;
M port/tcpinput.c => port/tcpinput.c +3 -2
@@ 24,6 24,8 @@ reset(Ipaddr source, Ipaddr dest, char tos, ushort length, Tcp *seg)
char rflags;
Tcphdr ph;
+ USED(tos); /* is this right??? */
+
if(seg->flags & RST)
return;
@@ 162,7 164,7 @@ tcp_input(Ipifc *ifc, Block *bp)
return;
/* Look for a connection, failing that attempt to establish a listen */
- s = ip_conn(ifc, seg.dest, seg.source, source, IP_TCPPROTO);
+ s = ip_conn(ifc, seg.dest, seg.source, source);
if (s == 0) {
if(seg.flags & SYN){
/*
@@ 969,7 971,6 @@ ntohtcp(Tcp *tcph, Block **bpp)
{
ushort hdrlen;
ushort i, optlen;
- Block *nbp;
Tcphdr *h;
uchar *optr;
M power/clock.c => power/clock.c +0 -1
@@ 10,7 10,6 @@
void
delay(int ms)
{
- ulong t, *p;
int i;
ms *= 7000; /* experimentally determined */
M power/devcyc.c => power/devcyc.c +3 -1
@@ 221,8 221,9 @@ cycread(Chan *c, void *buf, long n, ulong offset)
User *pu;
Commcyc *cp;
Cycmsg *mp, **cmp;
- ulong l, m, isflush;
+ ulong l, m;
+ USED(offset);
cp = &cyclone[c->dev];
switch(c->qid.path & ~CHDIR){
case Qdir:
@@ 299,6 300,7 @@ cycwrite(Chan *c, void *buf, long n, ulong offset)
Commcyc *cp;
Cycmsg *mp, **cmp;
+ USED(offset);
cp = &cyclone[c->dev];
switch(c->qid.path & ~CHDIR){
case Qdir:
M power/devduart.c => power/devduart.c +6 -2
@@ 377,7 377,7 @@ duartxintr(Port *p)
void
duartintr(void)
{
- int cause, status, c;
+ int cause;
Duartreg *reg;
Port *p;
@@ 467,7 467,6 @@ duartputs(IOQ *cq, char *s, int n)
{
int ch, x;
Port *p;
- Duartreg *reg;
x = splhi();
lock(cq);
@@ 783,6 782,9 @@ void
duartcreate(Chan *c, char *name, int omode, ulong perm)
{
USED(c);
+ USED(name);
+ USED(omode);
+ USED(perm);
error(Eperm);
}
@@ 823,6 825,7 @@ duartread(Chan *c, void *buf, long n, ulong offset)
long
duartwrite(Chan *c, void *va, long n, ulong offset)
{
+ USED(offset);
return streamwrite(c, va, n, 0);
}
@@ 837,6 840,7 @@ void
duartwstat(Chan *c, char *p)
{
USED(c);
+ USED(p);
error(Eperm);
}
M power/devhs.c => power/devhs.c +6 -1
@@ 206,6 206,9 @@ void
hscreate(Chan *c, char *name, int omode, ulong perm)
{
USED(c);
+ USED(name);
+ USED(omode);
+ USED(perm);
error(Eperm);
}
@@ 219,12 222,14 @@ hsclose(Chan *c)
long
hsread(Chan *c, void *buf, long n, ulong offset)
{
+ USED(offset);
return streamread(c, buf, n);
}
long
hswrite(Chan *c, void *buf, long n, ulong offset)
{
+ USED(offset);
return streamwrite(c, buf, n, 0);
}
@@ 239,6 244,7 @@ void
hswstat(Chan *c, char *dp)
{
USED(c);
+ USED(dp);
error(Eperm);
}
@@ 563,7 569,6 @@ static void
hsintr(int vec)
{
ushort csr;
- HSdev *addr;
Hs *hp;
hp = &hs[vec - Intvec];
M power/devrtc.c => power/devrtc.c +4 -1
@@ 104,6 104,9 @@ void
rtccreate(Chan *c, char *name, int omode, ulong perm)
{
USED(c);
+ USED(name);
+ USED(omode);
+ USED(perm);
error(Eperm);
}
@@ 215,6 218,7 @@ void
rtcwstat(Chan *c, char *dp)
{
USED(c);
+ USED(dp);
error(Eperm);
}
@@ 279,7 283,6 @@ rtctime(void)
uchar ch;
uchar *nv;
uchar bcdclock[Nbcd];
- char atime[64];
Rtc rtc;
nv = &((Nvram*)NVRAM)[NVRTC].val;
M power/main.c => power/main.c +3 -8
@@ 90,7 90,6 @@ vecinit(void)
void
vmereset(void)
{
- long i;
int noforce;
if(ioid >= IO3R1)
@@ 111,7 110,6 @@ ioboardinit(void)
{
long i;
int maxlevel;
- ushort *sp;
ioid = *IOID;
if(ioid >= IO3R1)
@@ 180,9 178,6 @@ launchinit(void)
void
init0(void)
{
- int i;
- Chan *c;
-
m->proc = u->p;
u->p->state = Running;
u->p->mach = m;
@@ 216,7 211,6 @@ userinit(void)
Segment *s;
User *up;
KMap *k;
- int i;
char **av;
Page *pg;
@@ 413,7 407,6 @@ confset(char *sym)
{
char *val, *p;
Conftab *ct;
- ulong x;
/*
* parse line
@@ 496,7 489,7 @@ confprint(void)
void
confinit(void)
{
- long x, i, j, *l;
+ long x, i, *l;
/*
* copy configuration down from high memory
@@ 734,12 727,14 @@ void
buzz(int f, int d)
{
USED(f);
+ USED(d);
}
int
mouseputc(IOQ *q, int c)
{
USED(q);
+ USED(c);
return 0;
}
M power/trap.c => power/trap.c +0 -1
@@ 358,7 358,6 @@ dumpregs(Ureg *ur)
{
int i;
ulong *l;
- int (*pr)(char*, ...);
if(u)
print("registers for %s %d\n", u->p->text, u->p->pid);
M ss/bbmalloc.c => ss/bbmalloc.c +0 -2
@@ 41,8 41,6 @@ bbmalloc(int nbytes)
void
bbfree(void *p, int n)
{
- ulong *up;
-
if(p == bblast)
bbcur = (ulong *)(((char *)bblast) + n);
}
M ss/clock.c => ss/clock.c +0 -2
@@ 10,7 10,6 @@
void
delay(int ms)
{
- ulong t, *p;
int i;
ms *= 3000; /* experimentally determined */
@@ 43,7 42,6 @@ clock(Ureg *ur)
{
Proc *p;
ulong i, nrun = 0;
- Segment *s;
i = ctr->lim1; /* clear interrupt */
USED(i);
M ss/main.c => ss/main.c +1 -6
@@ 14,8 14,6 @@ uchar *intrreg;
void
main(void)
{
- int a;
-
u = 0;
memset(edata, 0, (char*)end-(char*)edata);
@@ 93,8 91,6 @@ ioinit(void)
void
init0(void)
{
- Chan *c;
-
u->nerrlab = 0;
m->proc = u->p;
u->p->state = Running;
@@ 227,9 223,8 @@ void
lancesetup(Lance *lp)
{
KMap *k;
- ushort *sp;
uchar *cp;
- ulong pa, pte, va;
+ ulong pa, va;
int i, j;
k = kmappa(ETHER, PTEIO|PTENOCACHE);
M ss/mmu.c => ss/mmu.c +2 -7
@@ 76,7 76,7 @@ mmurelease(Proc *p)
int
newpid(Proc *p)
{
- int i, j, k;
+ int i, j;
ulong t;
Proc *sp;
@@ 222,6 222,7 @@ putmmu(ulong tlbvirt, ulong tlbphys, Page *pg)
ulong seg, l;
int j, k;
+ USED(pg);
splhi();
p = u->p;
tp = p->pidonmach[m->machno];
@@ 263,7 264,6 @@ void
putpmeg(ulong virt, ulong phys)
{
int i;
- int tp;
virt &= VAMASK;
virt &= ~(BY2PG-1);
@@ 287,8 287,6 @@ int nflushmmu;
void
flushmmu(void)
{
- int tp;
-
nflushmmu++;
splhi();
u->p->newtlb = 1;
@@ 378,9 376,6 @@ kmapperm(Page *pg)
void
kunmap(KMap *k)
{
- ulong pte;
- int i;
-
k->pa = 0;
lock(&kmapalloc);
k->next = kmapalloc.free;
M ss/screen.c => ss/screen.c +8 -3
@@ 259,17 259,18 @@ kbdstate(IOQ *q, int c)
static int repeatc;
static int lstate;
static uchar kc[4];
- uchar ch, code;
+ uchar ch;
int i, nk;
+ USED(q);
ch = kbdmap[shift][c&0x7F];
if(c==0x7F){ /* all keys up */
norepeat:
kbdrepeat(0);
- return;
+ return 0;
}
if(ch == 0xFF) /* shouldn't happen; ignore */
- return;
+ return 0;
if(c & 0x80){ /* key went up */
if(ch == 0xF0){ /* control */
shift &= ~2;
@@ 337,6 338,7 @@ kbdstate(IOQ *q, int c)
break;
}
}
+ return 0;
}
void
@@ 376,18 378,21 @@ getcolor(ulong p, ulong *pr, ulong *pg, ulong *pb)
int
setcolor(ulong p, ulong r, ulong g, ulong b)
{
+ USED(p, r, g, b);
return 0; /* can't change mono screen colormap */
}
int
hwcursset(uchar *s, uchar *c, int ox, int oy)
{
+ USED(s, c, ox, oy);
return 0;
}
int
hwcursmove(int x, int y)
{
+ USED(x, y);
return 0;
}