Browse Source

Removed unused funcs (revisited)

Removed [-Wunused-function] warnings, #14 issue.
Gerard van de Schoot 3 years ago
parent
commit
3109ef8e42

+ 0 - 10
acme/bin/source/acd/mmc.c

@@ -19,16 +19,6 @@ msfconv(Fmt *fp)
 	return 0;
 }
 
-static int
-status(Drive *d)
-{
-	uint8_t cmd[12];
-
-	memset(cmd, 0, sizeof cmd);
-	cmd[0] = 0xBD;
-	return scsi(d->scsi, cmd, sizeof cmd, nil, 0, Snone);
-}
-
 static int
 playmsf(Drive *d, Msf start, Msf end)
 {

+ 0 - 6
sys/src/cmd/auth/factotum/p9cr.c

@@ -235,12 +235,6 @@ vncaddkey(Key *k, int before)
 	return replacekey(k, before);
 }
 
-static void
-vncclosekey(Key *k)
-{
-	free(k->priv);
-}
-
 static int
 vncresponse(Fsstate* f, State *s)
 {

+ 2 - 0
sys/src/cmd/aux/gps/util.c

@@ -151,6 +151,7 @@ strtopos(char *p, char **ep)
 	return pl;
 }
 
+#if 0
 static void
 rtcset(int32_t t)		/* We may use this some day */
 {
@@ -181,3 +182,4 @@ rtcset(int32_t t)		/* We may use this some day */
 	}
 	seek(fd, 0, 0);
 }
+#endif

+ 0 - 13
sys/src/cmd/aux/timesync.c

@@ -666,19 +666,6 @@ int64_t2be(uint8_t *t, int64_t from)
 
 static int32_t order = 0x00010203;
 
-static uint8_t*
-be2long(int32_t *to, uint8_t *f)
-{
-	uint8_t *t, *o;
-	int i;
-
-	t = (uint8_t*)to;
-	o = (uint8_t*)ℴ
-	for(i = 0; i < sizeof(int32_t); i++)
-		t[o[i]] = f[i];
-	return f+sizeof(int32_t);
-}
-
 static uint8_t*
 long2be(uint8_t *t, int32_t from)
 {

+ 0 - 32
sys/src/cmd/aux/vga/tvp3026.c

@@ -66,15 +66,6 @@ tvp3026xi(uint8_t index)
 	return r;
 }
 
-static void
-tvp3026o(uint8_t reg, uint8_t data)
-{
-	uint8_t crt55;
-
-	crt55 = tvp3026io(reg, data);
-	vgaxo(Crtx, 0x55, crt55);
-}
-
 void
 tvp3026xo(uint8_t index, uint8_t data)
 {
@@ -125,29 +116,6 @@ init(Vga* vga, Ctlr* ctlr)
 	ctlr->flag |= Finit;
 }
 
-static void
-load(Vga* vga, Ctlr* ctlr)
-{
-	uint8_t x;
-
-	/*
-	 * General Control:
-	 *	output sync polarity
-	 * It's important to set this properly and to turn off the
-	 * VGA controller H and V syncs. Can't be set in VGA mode.
-	 */
-	x = 0x00;
-	if((vga->misc & 0x40) == 0)
-		x |= 0x01;
-	if((vga->misc & 0x80) == 0)
-		x |= 0x02;
-	tvp3026xo(0x1D, x);
-	vga->misc |= 0xC0;
-	vgao(MiscW, vga->misc);
-
-	ctlr->flag |= Fload;
-}
-
 static void
 dump(Vga* vga, Ctlr* ctlr)
 {

+ 0 - 6
sys/src/cmd/aux/vga/vmware.c

@@ -201,12 +201,6 @@ options(Vga* vga, Ctlr* ctlr)
 }
 
 
-static void
-clock(Vga* vga, Ctlr* ctlr)
-{
-	/* BEST CLOCK ROUTINE EVER! */
-}
-
 static void
 init(Vga* vga, Ctlr* ctlr)
 {

+ 0 - 38
sys/src/cmd/cdfs/mmc.c

@@ -124,15 +124,6 @@ bige(void *p)
 	return (a[0]<<24)|(a[1]<<16)|(a[2]<<8)|(a[3]<<0);
 }
 
-static uint16_t
-biges(void *p)
-{
-	uint8_t *a;
-
-	a = p;
-	return (a[0]<<8) | a[1];
-}
-
 uint32_t
 getnwa(Drive *drive)
 {
@@ -142,22 +133,6 @@ getnwa(Drive *drive)
 	return aux->mmcnwa;
 }
 
-static void
-hexdump(void *v, int n)
-{
-	int i;
-	uint8_t *p;
-
-	p = v;
-	for(i=0; i<n; i++){
-		print("%.2ux ", p[i]);
-		if((i%8) == 7)
-			print("\n");
-	}
-	if(i%8)
-		print("\n");
-}
-
 static void
 initcdb(uint8_t *cdb, int len, int cmd)
 {
@@ -271,18 +246,8 @@ mmcsetpage10(Drive *drive, int page, void *v)
 	cmd[1] = 0x10;			/* format not vendor-specific */
 	cmd[8] = len;
 
-//	print("set: sending cmd\n");
-//	hexdump(cmd, 10);
-//	print("parameter list header\n");
-//	hexdump(p, Mode10parmhdrlen);
-//	print("page\n");
-//	hexdump(p + Mode10parmhdrlen, len - Mode10parmhdrlen);
-
 	n = scsi(&drive->scsi, cmd, sizeof(cmd), p, len, Swrite);
 
-//	print("set: got cmd\n");
-//	hexdump(cmd, 10);
-
 	free(p);
 	if(n < len)
 		return -1;
@@ -493,9 +458,6 @@ mmcprobe(Scsi *scsi)
 	if(buf[Capmisc] & Capcdda)	/* CD-DA commands supported? */
 		cap |= Ccdda;		/* not used anywhere else */
 
-//	print("read %d max %d\n", biges(buf+14), biges(buf+8));
-//	print("write %d max %d\n", biges(buf+20), biges(buf+18));
-
 	/* cache optional page 05 (write parameter page) */
 	if(/* (cap & Cwrite) && */
 	    mmcgetpage(drive, Pagwrparams, aux->page05) >= 0) {

+ 0 - 14
sys/src/cmd/cifs/cifs.c

@@ -129,20 +129,6 @@ pbytes(Pkt *p)
 	p->bytebase = pl16(p, 0);	/* filled in by cifsrpc() */
 }
 
-static void
-dmp(int seq, uint8_t *buf)
-{
-	int i;
-
-	if(seq == 99)
-		print("\n   ");
-	else
-		print("%+2d ", seq);
-	for(i = 0; i < 8; i++)
-		print("%02x ", buf[i] & 0xff);
-	print("\n");
-}
-
 int
 cifsrpc(Pkt *p)
 {

+ 0 - 13
sys/src/cmd/cifs/netbios.c

@@ -77,19 +77,6 @@ Gmem(uint8_t **p, void *v, int n)
 		*str++ = *(*p)++;
 }
 
-
-static uint32_t
-GB32(uint8_t **p)
-{
-	uint32_t n;
-
-	n  = *(*p)++ << 24;
-	n |= *(*p)++ << 16;
-	n |= *(*p)++ << 8;
-	n |= *(*p)++;
-	return n;
-}
-
 static uint16_t
 GB16(uint8_t **p)
 {

+ 0 - 7
sys/src/cmd/cifs/trans.c

@@ -112,13 +112,6 @@ gtparam(Pkt *p)
 	p->pos = p->tparam;
 }
 
-static void
-gtdata(Pkt *p)
-{
-	p->pos = p->tdata;
-}
-
-
 int
 RAPshareenum(Session *s, Share *sp, Share **ent)
 {

+ 0 - 6
sys/src/cmd/cifs/transnt.c

@@ -104,12 +104,6 @@ tntrpc(Pkt *p)
 	return got;
 }
 
-static void
-gtntparam(Pkt *p)
-{
-	p->pos = p->tparam;
-}
-
 static void
 gtntdata(Pkt *p)
 {

+ 9 - 2
sys/src/cmd/cpu.c

@@ -57,8 +57,8 @@ static int	netkeyauth(int);
 static int	netkeysrvauth(int, char*);
 static int	p9auth(int);
 static int	srvp9auth(int, char*);
-static int	noauth(int);
-static int	srvnoauth(int, char*);
+// static int	noauth(int);
+// static int	srvnoauth(int, char*);
 
 typedef struct AuthMethod AuthMethod;
 struct AuthMethod {
@@ -629,6 +629,12 @@ p9auth(int fd)
 	return i;
 }
 
+/*
+ * these two functions may lead to a security hole and should only be enabled
+ * for new ports.
+ */
+
+#if 0
 static int
 noauth(int fd)
 {
@@ -644,6 +650,7 @@ srvnoauth(int fd, char *user)
 	newns(user, nil);
 	return fd;
 }
+#endif
 
 void
 loghex(uint8_t *p, int n)

+ 0 - 1
sys/src/cmd/disk/prep/fdisk.c

@@ -28,7 +28,6 @@ static void findmbr(Edit*);
 static void autopart(Edit*);
 static void wrpart(Edit*);
 static void blankpart(Edit*);
-static void cmdnamectl(Edit*);
 static void recover(Edit*);
 static int Dfmt(Fmt*);
 static int blank;

+ 0 - 9
sys/src/cmd/disk/prep/prep.c

@@ -44,7 +44,6 @@ static char 	*cmdadd(Edit*, char*, int64_t, int64_t);
 static char 	*cmddel(Edit*, Part*);
 static char 	*cmdokname(Edit*, char*);
 static char 	*cmdwrite(Edit*);
-static char	*cmdctlprint(Edit*, int, char**);
 
 Edit edit = {
 	.add=	cmdadd,
@@ -348,14 +347,6 @@ rdpart(Edit *edit)
 	}
 }
 
-static int64_t
-min(int64_t a, int64_t b)
-{
-	if(a < b)
-		return a;
-	return b;
-}
-
 static void
 autoxpart(Edit *edit)
 {

+ 0 - 9
sys/src/cmd/dossrv/xfile.c

@@ -19,15 +19,6 @@ static Xfs	*xhead;
 static Xfile	*xfiles[FIDMOD], *freelist;
 static MLock	xlock, xlocks[FIDMOD], freelock;
 
-static int
-okmode(int omode, int fmode)
-{
-	if(omode == OREAD)
-		return fmode & 4;
-	/* else ORDWR */
-	return (fmode & 6) == 6;
-}
-
 Xfs *
 getxfs(char *user, char *name)
 {

+ 0 - 1
sys/src/libndb/ndbipinfo.c

@@ -23,7 +23,6 @@ enum
 static Ndbtuple*	filter(Ndb *db, Ndbtuple *t, Ndbtuple *f);
 static Ndbtuple*	mkfilter(int argc, char **argv);
 static int		filtercomplete(Ndbtuple *f);
-static Ndbtuple*	toipaddr(Ndb *db, Ndbtuple *t);
 static int		prefixlen(uint8_t *ip);
 static Ndbtuple*	subnet(Ndb *db, uint8_t *net, Ndbtuple *f,
 			       int prefix);