CVS commit: [matt-nb5-mips64] src/sys/arch/arm/include

2014-03-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Mar 27 01:04:39 UTC 2014

Modified Files:
src/sys/arch/arm/include [matt-nb5-mips64]: param.h

Log Message:
Make ALIGNBYTES use __ALIGNBYTES


To generate a diff of this commit:
cvs rdiff -u -r1.12.12.2 -r1.12.12.3 src/sys/arch/arm/include/param.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/param.h
diff -u src/sys/arch/arm/include/param.h:1.12.12.2 src/sys/arch/arm/include/param.h:1.12.12.3
--- src/sys/arch/arm/include/param.h:1.12.12.2	Sat Feb 15 16:30:23 2014
+++ src/sys/arch/arm/include/param.h	Thu Mar 27 01:04:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.12.12.2 2014/02/15 16:30:23 matt Exp $	*/
+/*	$NetBSD: param.h,v 1.12.12.3 2014/03/27 01:04:39 matt Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -148,7 +148,7 @@
 #define	MID_MACHINE	MID_ARM6
 
 /* ARM-specific macro to align a stack pointer (downwards). */
-#define ALIGNBYTES		3
+#define ALIGNBYTES		(__ALIGNBYTES + 1)
 #define ALIGN(p)		(((uintptr_t)(p) + ALIGNBYTES) & ~ALIGNBYTES)
 #define ALIGNED_POINTER(p,t)	(((uintptr_t)(p) % sizeof(t)) == 0)
 #define STACKALIGNBYTES		(8 - 1)



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/conf

2014-03-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Mar 27 00:28:48 UTC 2014

Modified Files:
src/sys/arch/evbarm/conf [matt-nb5-mips64]: std.bcm53xx

Log Message:
Add ARM_HAS_VBAR


To generate a diff of this commit:
cvs rdiff -u -r1.13.2.3 -r1.13.2.4 src/sys/arch/evbarm/conf/std.bcm53xx

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/std.bcm53xx
diff -u src/sys/arch/evbarm/conf/std.bcm53xx:1.13.2.3 src/sys/arch/evbarm/conf/std.bcm53xx:1.13.2.4
--- src/sys/arch/evbarm/conf/std.bcm53xx:1.13.2.3	Sat Feb 15 17:50:02 2014
+++ src/sys/arch/evbarm/conf/std.bcm53xx	Thu Mar 27 00:28:48 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: std.bcm53xx,v 1.13.2.3 2014/02/15 17:50:02 matt Exp $
+#	$NetBSD: std.bcm53xx,v 1.13.2.4 2014/03/27 00:28:48 matt Exp $
 #
 # standard NetBSD/evbarm for BCM5301X options
 
@@ -14,6 +14,7 @@ options 	CORTEX_PMC
 options 	_ARM32_NEED_BUS_DMA_BOUNCE
 options 	PMAP_NEED_ALLOC_POOLPAGE
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
+options 	ARM_HAS_VBAR
 options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP
 options 	__HAVE_CPU_COUNTER
 options 	__HAVE_PCI_CONF_HOOK



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/broadcom

2014-03-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 23:43:45 UTC 2014

Modified Files:
src/sys/arch/arm/broadcom [matt-nb5-mips64]: bcm53xx_cca.c

Log Message:
Only 5301X has GPIO via CCA


To generate a diff of this commit:
cvs rdiff -u -r1.1.16.3 -r1.1.16.4 src/sys/arch/arm/broadcom/bcm53xx_cca.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_cca.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_cca.c:1.1.16.3 src/sys/arch/arm/broadcom/bcm53xx_cca.c:1.1.16.4
--- src/sys/arch/arm/broadcom/bcm53xx_cca.c:1.1.16.3	Wed Mar 26 02:02:29 2014
+++ src/sys/arch/arm/broadcom/bcm53xx_cca.c	Wed Mar 26 23:43:45 2014
@@ -43,7 +43,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_cca.c,v 1.1.16.3 2014/03/26 02:02:29 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_cca.c,v 1.1.16.4 2014/03/26 23:43:45 matt Exp $");
 
 #include 
 #include 
@@ -177,7 +177,7 @@ bcmcca_mainbus_attach(device_t parent, d
 	aprint_normal_dev(sc->sc_dev, "interrupting at irq %d\n", IRQ_CCA);
 
 	bcmcca_uart_attach(sc);
-#if NGPIO > 0
+#if NGPIO > 0 && defined(BCM5301X)
 	bcmcca_gpio_attach(sc);
 #endif
 }



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/include

2014-03-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 22:44:42 UTC 2014

Modified Files:
src/sys/arch/arm/include [matt-nb5-mips64]: cdefs.h

Log Message:
Make the minimal alignment 8 if EABI or ldrd/strd are supported.


To generate a diff of this commit:
cvs rdiff -u -r1.3.38.1 -r1.3.38.2 src/sys/arch/arm/include/cdefs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/cdefs.h
diff -u src/sys/arch/arm/include/cdefs.h:1.3.38.1 src/sys/arch/arm/include/cdefs.h:1.3.38.2
--- src/sys/arch/arm/include/cdefs.h:1.3.38.1	Thu Dec 19 01:17:06 2013
+++ src/sys/arch/arm/include/cdefs.h	Wed Mar 26 22:44:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.3.38.1 2013/12/19 01:17:06 matt Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.3.38.2 2014/03/26 22:44:41 matt Exp $	*/
 
 #ifndef	_ARM_CDEFS_H_
 #define	_ARM_CDEFS_H_
@@ -40,8 +40,8 @@
 #define	_ARM_ARCH_DWORD_OK
 #endif
 
-#ifdef __ARM_EABI__
-#define __ALIGNBYTES		(8 - 1)
+#if defined(__ARM_EABI__) || defined(_ARM_ARCH_DWORD_OK)
+#define __ALIGNBYTES		(sizeof(long long) - 1)
 #else
 #define __ALIGNBYTES		(sizeof(int) - 1)
 #endif



CVS commit: othersrc/external/bsd/multigest/dist

2014-03-26 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Wed Mar 26 22:42:22 UTC 2014

Added Files:
othersrc/external/bsd/multigest/dist: Makefile.lib.in
Makefile.libtool.in

Log Message:
add files needed for the portable distribution


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/multigest/dist/Makefile.lib.in \
othersrc/external/bsd/multigest/dist/Makefile.libtool.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: othersrc/external/bsd/multigest/dist/Makefile.lib.in
diff -u /dev/null othersrc/external/bsd/multigest/dist/Makefile.lib.in:1.1
--- /dev/null	Wed Mar 26 22:42:22 2014
+++ othersrc/external/bsd/multigest/dist/Makefile.lib.in	Wed Mar 26 22:42:22 2014
@@ -0,0 +1,32 @@
+# $NetBSD: Makefile.lib.in,v 1.1 2014/03/26 22:42:22 agc Exp $
+
+LIB=	libmultigest.a
+
+OBJS+= blake2.o
+OBJS+= crc32c.o
+OBJS+= keccak.o
+OBJS+= md5c.o
+OBJS+= multigest.o
+OBJS+= rmd160.o
+OBJS+= sha1.o
+OBJS+= sha2.o
+OBJS+= tiger.o
+OBJS+= whirlpool.o
+
+PREFIX=@PREFIX@
+MANDIR=@MANDIR@
+
+all: ${LIB}
+
+${LIB}: ${OBJS}
+	ar crv ${LIB} ${OBJS}
+
+install:
+	${BSD_INSTALL_LIB} ${LIB} ${DESTDIR}${PREFIX}/lib
+	${BSD_INSTALL_DATA} multigest.h ${DESTDIR}${PREFIX}/include
+	${BSD_INSTALL_DATA} libmultigest.3 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man3
+
+clean:
+	rm -rf *.core ${OBJS} ${LIB}
+cleandist:
+	rm -rf *.core ${OBJS} ${LIB} Makefile
Index: othersrc/external/bsd/multigest/dist/Makefile.libtool.in
diff -u /dev/null othersrc/external/bsd/multigest/dist/Makefile.libtool.in:1.1
--- /dev/null	Wed Mar 26 22:42:22 2014
+++ othersrc/external/bsd/multigest/dist/Makefile.libtool.in	Wed Mar 26 22:42:22 2014
@@ -0,0 +1,35 @@
+# $NetBSD: Makefile.libtool.in,v 1.1 2014/03/26 22:42:22 agc Exp $
+
+LIB=	libmultigest.a
+
+OBJS+= blake2.o
+OBJS+= crc32c.o
+OBJS+= keccak.o
+OBJS+= md5c.o
+OBJS+= multigest.o
+OBJS+= rmd160.o
+OBJS+= sha1.o
+OBJS+= sha2.o
+OBJS+= tiger.o
+OBJS+= whirlpool.o
+
+PREFIX=@PREFIX@
+MANDIR=@MANDIR@
+
+all: ${LIB}
+
+${LIB}: ${OBJS}
+	${LIBTOOL} --mode=link --tag=CC cc -o ${.TARGET:.a=.la} ${OBJS:.o=.lo} -rpath ${PREFIX}/lib -version-info 0:0
+
+.c.o:
+	${LIBTOOL} --mode=compile --tag=CC ${CC} ${CFLAGS} -c $<
+
+install:
+	libtool --mode=install ${BSD_INSTALL_LIB} libmultigest.la ${DESTDIR}${PREFIX}/lib
+	${BSD_INSTALL_DATA} multigest.h ${DESTDIR}${PREFIX}/include
+	${BSD_INSTALL_DATA} libmultigest.3 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man3
+
+clean:
+	rm -rf *.core ${OBJS} ${LIB}
+cleandist:
+	rm -rf *.core ${OBJS} ${LIB} Makefile



CVS commit: othersrc/external/bsd/multigest

2014-03-26 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Wed Mar 26 22:13:44 UTC 2014

Modified Files:
othersrc/external/bsd/multigest/bin: Makefile
othersrc/external/bsd/multigest/dist: multigest.c multigest.h
Added Files:
othersrc/external/bsd/multigest/bin: 28.expected

Log Message:
update multigest to version 20140326

+ allow the digest combiners to be specified anywhere in the list
  of digest algorithms
+ add tests for comb4p


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/multigest/bin/28.expected
cvs rdiff -u -r1.6 -r1.7 othersrc/external/bsd/multigest/bin/Makefile
cvs rdiff -u -r1.13 -r1.14 othersrc/external/bsd/multigest/dist/multigest.c
cvs rdiff -u -r1.10 -r1.11 othersrc/external/bsd/multigest/dist/multigest.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/multigest/bin/Makefile
diff -u othersrc/external/bsd/multigest/bin/Makefile:1.6 othersrc/external/bsd/multigest/bin/Makefile:1.7
--- othersrc/external/bsd/multigest/bin/Makefile:1.6	Wed Mar 26 06:43:01 2014
+++ othersrc/external/bsd/multigest/bin/Makefile	Wed Mar 26 22:13:44 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2014/03/26 06:43:01 agc Exp $
+# $NetBSD: Makefile,v 1.7 2014/03/26 22:13:44 agc Exp $
 
 .include 
 
@@ -106,3 +106,12 @@ t: ${PROG}
 	env LD_LIBRARY_PATH=${LIB_MULTIGEST_DIR} ./${PROG} -o 27.out -a rmd160,hash,sha1 2.in
 	diff 27.expected 27.out
 	rm -f 27.out
+	env LD_LIBRARY_PATH=${LIB_MULTIGEST_DIR} ./${PROG} -o 28.out -a comb4p,sha1,rmd160 < 2.in
+	diff 28.expected 28.out
+	rm -f 28.out
+	env LD_LIBRARY_PATH=${LIB_MULTIGEST_DIR} ./${PROG} -o 29.out -a sha1,comb4p,rmd160 < 2.in
+	diff 28.expected 29.out
+	rm -f 29.out
+	env LD_LIBRARY_PATH=${LIB_MULTIGEST_DIR} ./${PROG} -o 30.out -a sha1,rmd160,comb4p < 2.in
+	diff 28.expected 30.out
+	rm -f 30.out

Index: othersrc/external/bsd/multigest/dist/multigest.c
diff -u othersrc/external/bsd/multigest/dist/multigest.c:1.13 othersrc/external/bsd/multigest/dist/multigest.c:1.14
--- othersrc/external/bsd/multigest/dist/multigest.c:1.13	Wed Mar 26 06:43:01 2014
+++ othersrc/external/bsd/multigest/dist/multigest.c	Wed Mar 26 22:13:44 2014
@@ -450,11 +450,13 @@ normalise(multigest_t *multigest, const 
 			break;
 		}
 		for (d = multigest->digs, i = 0 ; i < multigest->digc ; i++, d++) {
-			(*d->update)(&multigest->ctx[d->ctxoff], &data[*from],
-(unsigned)(match[0].rm_so - *from));
-			if (multigest->repllen) {
-(*d->update)(&multigest->ctx[d->ctxoff], multigest->repl,
-	multigest->repllen);
+			if (d->rawsize) {
+(*d->update)(&multigest->ctx[d->ctxoff], &data[*from],
+	(unsigned)(match[0].rm_so - *from));
+if (multigest->repllen) {
+	(*d->update)(&multigest->ctx[d->ctxoff], multigest->repl,
+		multigest->repllen);
+}
 			}
 		}
 		*from = match[0].rm_eo;
@@ -478,13 +480,11 @@ xorbuf(uint8_t *out, uint8_t *in1, uint8
 
 /* a round of comb4p combination */
 static int
-comb4p_round(multigest_t *m, uint8_t *out, uint8_t *in, size_t insize, uint32_t r)
+comb4p_round(multigest_t *m, uint8_t *out, uint8_t *in, multigest_dig_t *d1, multigest_dig_t *d2, uint32_t r)
 {
-	multigest_dig_t	*d;
 	const int	 indian = 1;
 	uint32_t	 b2;
 	uint32_t	 b4;
-	uint32_t	 i;
 	uint8_t		 h1[4096];
 	uint8_t		 h2[4096];
 
@@ -494,16 +494,14 @@ comb4p_round(multigest_t *m, uint8_t *ou
 		b4 = (r & 0x00ff);
 		r = (r & 0xff00ff00) | (b2 >> 16) | (b4 << 16);
 	}
-	for (d = &m->digs[1], i = 1 ; i < m->digc ; i++, d++) {
-		(*d->update)(&m->ctx[d->ctxoff], (const char *)&r, sizeof(r));
-		(*d->update)(&m->ctx[d->ctxoff], (const char *)in, insize);
-	}
-	d = &m->digs[1];
-	(*d->final)(h1, &m->ctx[d->ctxoff]);
-	xorbuf(out, out, h1, d->rawsize);
-	d = &m->digs[2];
-	(*d->final)(h2, &m->ctx[d->ctxoff]);
-	xorbuf(out, out, h2, d->rawsize);
+	(*d1->update)(&m->ctx[d1->ctxoff], (const char *)&r, sizeof(r));
+	(*d2->update)(&m->ctx[d2->ctxoff], (const char *)&r, sizeof(r));
+	(*d1->update)(&m->ctx[d1->ctxoff], (const char *)in, d1->rawsize);
+	(*d2->update)(&m->ctx[d2->ctxoff], (const char *)in, d2->rawsize);
+	(*d1->final)(h1, &m->ctx[d1->ctxoff]);
+	xorbuf(out, out, h1, d1->rawsize);
+	(*d2->final)(h2, &m->ctx[d2->ctxoff]);
+	xorbuf(out, out, h2, d2->rawsize);
 	return 1;
 }
 
@@ -647,7 +645,9 @@ multigest_update(multigest_t *multigest,
 	if (multigest && data) {
 		normalise(multigest, data, len, &from);
 		for (d = multigest->digs, i = 0 ; i < multigest->digc ; i++, d++) {
-			(*d->update)(&multigest->ctx[d->ctxoff], &data[from], (unsigned)(len - from));
+			i

CVS commit: src/external/mit/lua/dist/src

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 22:03:26 UTC 2014

Modified Files:
src/external/mit/lua/dist/src: lobject.c lstrlib.c luaconf.h lvm.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/mit/lua/dist/src/lobject.c \
src/external/mit/lua/dist/src/lvm.c
cvs rdiff -u -r1.3 -r1.4 src/external/mit/lua/dist/src/lstrlib.c
cvs rdiff -u -r1.6 -r1.7 src/external/mit/lua/dist/src/luaconf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lobject.c
diff -u src/external/mit/lua/dist/src/lobject.c:1.1.1.2 src/external/mit/lua/dist/src/lobject.c:1.2
--- src/external/mit/lua/dist/src/lobject.c:1.1.1.2	Wed Mar 14 20:08:09 2012
+++ src/external/mit/lua/dist/src/lobject.c	Wed Mar 26 18:03:26 2014
@@ -1,7 +1,7 @@
-/*	$NetBSD: lobject.c,v 1.1.1.2 2012/03/15 00:08:09 alnsn Exp $	*/
+/*	$NetBSD: lobject.c,v 1.2 2014/03/26 22:03:26 christos Exp $	*/
 
 /*
-** $Id: lobject.c,v 1.1.1.2 2012/03/15 00:08:09 alnsn Exp $
+** $Id: lobject.c,v 1.2 2014/03/26 22:03:26 christos Exp $
 ** Some generic functions over Lua objects
 ** See Copyright Notice in lua.h
 */
@@ -144,7 +144,7 @@ const char *luaO_pushvfstring (lua_State
   }
   case 'p': {
 char buff[4*sizeof(void *) + 8]; /* should be enough space for a `%p' */
-sprintf(buff, "%p", va_arg(argp, void *));
+snprintf(buff, sizeof(buff), "%p", va_arg(argp, void *));
 pushstr(L, buff);
 break;
   }
Index: src/external/mit/lua/dist/src/lvm.c
diff -u src/external/mit/lua/dist/src/lvm.c:1.1.1.2 src/external/mit/lua/dist/src/lvm.c:1.2
--- src/external/mit/lua/dist/src/lvm.c:1.1.1.2	Wed Mar 14 20:08:05 2012
+++ src/external/mit/lua/dist/src/lvm.c	Wed Mar 26 18:03:26 2014
@@ -1,7 +1,7 @@
-/*	$NetBSD: lvm.c,v 1.1.1.2 2012/03/15 00:08:05 alnsn Exp $	*/
+/*	$NetBSD: lvm.c,v 1.2 2014/03/26 22:03:26 christos Exp $	*/
 
 /*
-** $Id: lvm.c,v 1.1.1.2 2012/03/15 00:08:05 alnsn Exp $
+** $Id: lvm.c,v 1.2 2014/03/26 22:03:26 christos Exp $
 ** Lua virtual machine
 ** See Copyright Notice in lua.h
 */
@@ -52,7 +52,7 @@ int luaV_tostring (lua_State *L, StkId o
   else {
 char s[LUAI_MAXNUMBER2STR];
 lua_Number n = nvalue(obj);
-lua_number2str(s, n);
+lua_number2str(s, sizeof(s), n);
 setsvalue2s(L, obj, luaS_new(L, s));
 return 1;
   }

Index: src/external/mit/lua/dist/src/lstrlib.c
diff -u src/external/mit/lua/dist/src/lstrlib.c:1.3 src/external/mit/lua/dist/src/lstrlib.c:1.4
--- src/external/mit/lua/dist/src/lstrlib.c:1.3	Mon Dec 16 18:25:56 2013
+++ src/external/mit/lua/dist/src/lstrlib.c	Wed Mar 26 18:03:26 2014
@@ -1,7 +1,7 @@
-/*	$NetBSD: lstrlib.c,v 1.3 2013/12/16 23:25:56 lneto Exp $	*/
+/*	$NetBSD: lstrlib.c,v 1.4 2014/03/26 22:03:26 christos Exp $	*/
 
 /*
-** $Id: lstrlib.c,v 1.3 2013/12/16 23:25:56 lneto Exp $
+** $Id: lstrlib.c,v 1.4 2014/03/26 22:03:26 christos Exp $
 ** Standard library for string operations and pattern-matching
 ** See Copyright Notice in lua.h
 */
@@ -776,27 +776,27 @@ static int str_format (lua_State *L) {
   strfrmt = scanformat(L, strfrmt, form);
   switch (*strfrmt++) {
 case 'c': {
-  sprintf(buff, form, (int)luaL_checknumber(L, arg));
+  snprintf(buff, sizeof(buff), form, (int)luaL_checknumber(L, arg));
   break;
 }
 case 'd':  case 'i': {
   addintlen(form);
-  sprintf(buff, form, (LUA_INTFRM_T)luaL_checknumber(L, arg));
+  snprintf(buff, sizeof(buff), form, (LUA_INTFRM_T)luaL_checknumber(L, arg));
   break;
 }
 case 'o':  case 'u':  case 'x':  case 'X': {
   addintlen(form);
 #ifndef _KERNEL
-  sprintf(buff, form, (unsigned LUA_INTFRM_T)luaL_checknumber(L, arg));
+  snprintf(buff, sizeof(buff), form, (unsigned LUA_INTFRM_T)luaL_checknumber(L, arg));
 #else
-  sprintf(buff, form, (LUA_UINTFRM_T)luaL_checknumber(L, arg));
+  snprintf(buff, sizeof(buff), form, (LUA_UINTFRM_T)luaL_checknumber(L, arg));
 #endif
   break;
 }
 #ifndef _KERNEL
 case 'e':  case 'E': case 'f':
 case 'g': case 'G': {
-  sprintf(buff, form, (double)luaL_checknumber(L, arg));
+  snprintf(buff, sizeof(buff), form, (double)luaL_checknumber(L, arg));
   break;
 }
 #endif
@@ -815,7 +815,7 @@ static int str_format (lua_State *L) {
 continue;  /* skip the `addsize' at the end */
   }
   else {
-sprintf(buff, form, s);
+snprintf(buff, sizeof(buff), form, s);
 break;
   }
 }

Index: src/external/mit/lua/dist/src/luaconf.h
diff -u src/external/mit/lua/dist/src/luaconf.h:1.6 src/external/mit/lua/dist/src/luaconf.h:1.7
--- src/external/mit/lua/dist/src/luaconf.h:1.6	Mon Dec 16 18:25:56 2013
+++ src/external/mit/lua/dist/src/luaconf

CVS commit: src/sys/kern

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 21:29:54 UTC 2014

Modified Files:
src/sys/kern: tty_bsdpty.c

Log Message:
in the bsdpty allocvp flavor, call the bsdpty mkname directly, since it is
the only one possible to be valid (Ilya Zykov)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/kern/tty_bsdpty.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/tty_bsdpty.c
diff -u src/sys/kern/tty_bsdpty.c:1.17 src/sys/kern/tty_bsdpty.c:1.18
--- src/sys/kern/tty_bsdpty.c:1.17	Fri Nov 19 01:44:43 2010
+++ src/sys/kern/tty_bsdpty.c	Wed Mar 26 17:29:54 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty_bsdpty.c,v 1.17 2010/11/19 06:44:43 dholland Exp $	*/
+/*	$NetBSD: tty_bsdpty.c,v 1.18 2014/03/26 21:29:54 christos Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty_bsdpty.c,v 1.17 2010/11/19 06:44:43 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_bsdpty.c,v 1.18 2014/03/26 21:29:54 christos Exp $");
 
 #include "opt_ptm.h"
 
@@ -121,7 +121,7 @@ pty_allocvp(struct ptm_pty *ptm, struct 
 	struct nameidata nd;
 	char name[TTY_NAMESIZE];
 
-	error = (*ptm->makename)(ptm, l, name, sizeof(name), dev, ms);
+	error = pty_makename(ptm, l, name, sizeof(name), dev, ms);
 	if (error)
 		return error;
 



CVS commit: src/sys/fs/ptyfs

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 21:28:48 UTC 2014

Modified Files:
src/sys/fs/ptyfs: ptyfs_subr.c

Log Message:
if one of the ptyfs instances has grabbed the handle don't grab it again,
Ilya Zykov


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/fs/ptyfs/ptyfs_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/ptyfs/ptyfs_subr.c
diff -u src/sys/fs/ptyfs/ptyfs_subr.c:1.27 src/sys/fs/ptyfs/ptyfs_subr.c:1.28
--- src/sys/fs/ptyfs/ptyfs_subr.c:1.27	Fri Mar 21 13:21:53 2014
+++ src/sys/fs/ptyfs/ptyfs_subr.c	Wed Mar 26 17:28:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptyfs_subr.c,v 1.27 2014/03/21 17:21:53 christos Exp $	*/
+/*	$NetBSD: ptyfs_subr.c,v 1.28 2014/03/26 21:28:48 christos Exp $	*/
 
 /*
  * Copyright (c) 1993
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ptyfs_subr.c,v 1.27 2014/03/21 17:21:53 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ptyfs_subr.c,v 1.28 2014/03/26 21:28:48 christos Exp $");
 
 #include 
 #include 
@@ -116,7 +116,7 @@ static void ptyfs_rehash(kmutex_t *, str
 static void
 ptyfs_getinfo(struct ptyfsnode *ptyfs, struct lwp *l)
 {
-	extern struct ptm_pty *ptyfs_save_ptm, ptm_ptyfspty;
+	extern struct ptm_pty *ptyfs_save_ptm;
 
 	if (ptyfs->ptyfs_type == PTYFSroot) {
 		ptyfs->ptyfs_mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|
@@ -126,7 +126,7 @@ ptyfs_getinfo(struct ptyfsnode *ptyfs, s
 		ptyfs->ptyfs_mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|
 		S_IROTH|S_IWOTH;
 
-	if (ptyfs_save_ptm != NULL && ptyfs_save_ptm != &ptm_ptyfspty) {
+	if (ptyfs_save_ptm != NULL) {
 		int error;
 		struct pathbuf *pb;
 		struct nameidata nd;



CVS commit: src/sys/arch/arm/iomd

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 19:44:51 UTC 2014

Modified Files:
src/sys/arch/arm/iomd: iomd_irqhandler.c

Log Message:
Add missing ;


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/iomd/iomd_irqhandler.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/iomd/iomd_irqhandler.c
diff -u src/sys/arch/arm/iomd/iomd_irqhandler.c:1.19 src/sys/arch/arm/iomd/iomd_irqhandler.c:1.20
--- src/sys/arch/arm/iomd/iomd_irqhandler.c:1.19	Wed Mar 26 04:52:00 2014
+++ src/sys/arch/arm/iomd/iomd_irqhandler.c	Wed Mar 26 15:44:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: iomd_irqhandler.c,v 1.19 2014/03/26 08:52:00 christos Exp $	*/
+/*	$NetBSD: iomd_irqhandler.c,v 1.20 2014/03/26 19:44:51 christos Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iomd_irqhandler.c,v 1.19 2014/03/26 08:52:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iomd_irqhandler.c,v 1.20 2014/03/26 19:44:51 christos Exp $");
 
 #include "opt_irqstats.h"
 
@@ -180,7 +180,7 @@ irq_claim(int irq, irqhandler_t *handler
 	/* Get the interrupt name from the head of the list */
 	char *iptr = _intrnames + (irq * 14);
 	if (handler->ih_name) {
-		strlcpy(iptr, handler->ih_name, 14)
+		strlcpy(iptr, handler->ih_name, 14);
 	} else {
 		snprintf(iptr, 14, "irq %2d ", irq);
 	}



CVS commit: src/common/lib/libprop

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 18:12:46 UTC 2014

Modified Files:
src/common/lib/libprop: prop_number.c prop_string.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/common/lib/libprop/prop_number.c
cvs rdiff -u -r1.11 -r1.12 src/common/lib/libprop/prop_string.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libprop/prop_number.c
diff -u src/common/lib/libprop/prop_number.c:1.25 src/common/lib/libprop/prop_number.c:1.26
--- src/common/lib/libprop/prop_number.c:1.25	Fri Oct 18 14:26:20 2013
+++ src/common/lib/libprop/prop_number.c	Wed Mar 26 14:12:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: prop_number.c,v 1.25 2013/10/18 18:26:20 martin Exp $	*/
+/*	$NetBSD: prop_number.c,v 1.26 2014/03/26 18:12:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -199,9 +199,11 @@ _prop_number_externalize(struct _prop_ob
 	 * we output in decimal.
 	 */
 	if (pn->pn_value.pnv_is_unsigned)
-		sprintf(tmpstr, "0x%" PRIx64, pn->pn_value.pnv_unsigned);
+		snprintf(tmpstr, sizeof(tmpstr), "0x%" PRIx64,
+		pn->pn_value.pnv_unsigned);
 	else
-		sprintf(tmpstr, "%" PRIi64, pn->pn_value.pnv_signed);
+		snprintf(tmpstr, sizeof(tmpstr), "%" PRIi64,
+		pn->pn_value.pnv_signed);
 
 	if (_prop_object_externalize_start_tag(ctx, "integer") == false ||
 	_prop_object_externalize_append_cstring(ctx, tmpstr) == false ||

Index: src/common/lib/libprop/prop_string.c
diff -u src/common/lib/libprop/prop_string.c:1.11 src/common/lib/libprop/prop_string.c:1.12
--- src/common/lib/libprop/prop_string.c:1.11	Sun Aug  3 00:00:12 2008
+++ src/common/lib/libprop/prop_string.c	Wed Mar 26 14:12:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: prop_string.c,v 1.11 2008/08/03 04:00:12 thorpej Exp $	*/
+/*	$NetBSD: prop_string.c,v 1.12 2014/03/26 18:12:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -339,7 +339,7 @@ prop_string_append(prop_string_t dst, pr
 	cp = _PROP_MALLOC(len + 1, M_PROP_STRING);
 	if (cp == NULL)
 		return (false);
-	sprintf(cp, "%s%s", prop_string_contents(dst),
+	snprintf(cp, len + 1, "%s%s", prop_string_contents(dst),
 		prop_string_contents(src));
 	ocp = dst->ps_mutable;
 	dst->ps_mutable = cp;
@@ -373,7 +373,7 @@ prop_string_append_cstring(prop_string_t
 	cp = _PROP_MALLOC(len + 1, M_PROP_STRING);
 	if (cp == NULL)
 		return (false);
-	sprintf(cp, "%s%s", prop_string_contents(dst), src);
+	snprintf(cp, len + 1, "%s%s", prop_string_contents(dst), src);
 	ocp = dst->ps_mutable;
 	dst->ps_mutable = cp;
 	dst->ps_size = len;



CVS commit: src/sys/compat/ndis

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 18:11:26 UTC 2014

Modified Files:
src/sys/compat/ndis: subr_ntoskrnl.c

Log Message:
kill {v,}sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/compat/ndis/subr_ntoskrnl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/ndis/subr_ntoskrnl.c
diff -u src/sys/compat/ndis/subr_ntoskrnl.c:1.24 src/sys/compat/ndis/subr_ntoskrnl.c:1.25
--- src/sys/compat/ndis/subr_ntoskrnl.c:1.24	Tue Mar 25 12:23:58 2014
+++ src/sys/compat/ndis/subr_ntoskrnl.c	Wed Mar 26 14:11:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_ntoskrnl.c,v 1.24 2014/03/25 16:23:58 christos Exp $	*/
+/*	$NetBSD: subr_ntoskrnl.c,v 1.25 2014/03/26 18:11:26 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003
@@ -37,7 +37,7 @@
 __FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.43.2.5 2005/03/31 04:24:36 wpaul Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: subr_ntoskrnl.c,v 1.24 2014/03/25 16:23:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_ntoskrnl.c,v 1.25 2014/03/26 18:11:26 christos Exp $");
 #endif
 
 #ifdef __FreeBSD__
@@ -2693,8 +2693,6 @@ image_patch_table ntoskrnl_functbl[] = {
 	IMPORT_FUNC(RtlFreeAnsiString),
 	IMPORT_FUNC(RtlFreeUnicodeString),
 	IMPORT_FUNC(RtlUnicodeStringToInteger),
-	IMPORT_FUNC(sprintf),
-	IMPORT_FUNC(vsprintf),
 	IMPORT_FUNC_MAP(_snprintf, snprintf),
 	IMPORT_FUNC_MAP(_vsnprintf, vsnprintf),
 	IMPORT_FUNC(DbgPrint),



CVS commit: src/sys/arch/atari

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 18:04:34 UTC 2014

Modified Files:
src/sys/arch/atari/atari: machdep.c
src/sys/arch/atari/dev: clock.c ite.c
src/sys/arch/atari/pci: pci_machdep.c
src/sys/arch/atari/stand/ahdilabel: ahdilabel.c
src/sys/arch/atari/stand/installboot: installboot.c
src/sys/arch/atari/stand/tostools/aptck: diskio.c
src/sys/arch/atari/stand/tostools/libtos: diskio.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/arch/atari/atari/machdep.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/atari/dev/clock.c
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/atari/dev/ite.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/atari/pci/pci_machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/atari/stand/ahdilabel/ahdilabel.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/atari/stand/installboot/installboot.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/atari/stand/tostools/aptck/diskio.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/atari/stand/tostools/libtos/diskio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/atari/atari/machdep.c
diff -u src/sys/arch/atari/atari/machdep.c:1.176 src/sys/arch/atari/atari/machdep.c:1.177
--- src/sys/arch/atari/atari/machdep.c:1.176	Mon Mar 24 14:39:57 2014
+++ src/sys/arch/atari/atari/machdep.c	Wed Mar 26 14:04:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.176 2014/03/24 18:39:57 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.177 2014/03/26 18:04:33 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.176 2014/03/24 18:39:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.177 2014/03/26 18:04:33 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -268,7 +268,7 @@ identifycpu(void)
 
 			__asm(".word 0x4e7a,0x0808;"
 			"movl %%d0,%0" : "=d"(pcr) : : "d0");
-			sprintf(cputxt, "68%s060 rev.%d",
+			snprintf(cputxt, sizeof(cputxt), "68%s060 rev.%d",
 			pcr & 0x1 ? "LC/EC" : "", (pcr >> 8) & 0xff);
 			cpu = cputxt;
 			mmu = "/MMU";

Index: src/sys/arch/atari/dev/clock.c
diff -u src/sys/arch/atari/dev/clock.c:1.57 src/sys/arch/atari/dev/clock.c:1.58
--- src/sys/arch/atari/dev/clock.c:1.57	Mon Mar 24 14:39:57 2014
+++ src/sys/arch/atari/dev/clock.c	Wed Mar 26 14:04:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.57 2014/03/24 18:39:57 christos Exp $	*/
+/*	$NetBSD: clock.c,v 1.58 2014/03/26 18:04:33 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.57 2014/03/24 18:39:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.58 2014/03/26 18:04:33 christos Exp $");
 
 #include 
 #include 
@@ -519,7 +519,7 @@ rtcread(dev_t dev, struct uio *uio, int 
 	MC146818_GETTOD(RTC, &clkregs);
 	splx(s);
 
-	sprintf(buffer, "%4d%02d%02d%02d%02d.%02d\n",
+	snprintf(buffer, sizeof(buffer), "%4d%02d%02d%02d%02d.%02d\n",
 	clkregs[MC_YEAR] + GEMSTARTOFTIME,
 	clkregs[MC_MONTH], clkregs[MC_DOM],
 	clkregs[MC_HOUR], clkregs[MC_MIN], clkregs[MC_SEC]);

Index: src/sys/arch/atari/dev/ite.c
diff -u src/sys/arch/atari/dev/ite.c:1.74 src/sys/arch/atari/dev/ite.c:1.75
--- src/sys/arch/atari/dev/ite.c:1.74	Mon Mar 24 14:39:57 2014
+++ src/sys/arch/atari/dev/ite.c	Wed Mar 26 14:04:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite.c,v 1.74 2014/03/24 18:39:57 christos Exp $	*/
+/*	$NetBSD: ite.c,v 1.75 2014/03/26 18:04:33 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -44,7 +44,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.74 2014/03/24 18:39:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.75 2014/03/26 18:04:33 christos Exp $");
 
 #include "opt_ddb.h"
 
@@ -1681,7 +1681,7 @@ iteputchar(register int c, struct ite_so
 			break;
 		  case 6:
 			/* cursor position report */
-		sprintf (sc->argbuf, "\033[%d;%dR", 
+		snprintf (sc->argbuf, sizeof(sc->argbuf), "\033[%d;%dR",
  sc->cury + 1, sc->curx + 1);
 			ite_sendstr (sc->argbuf);
 			break;

Index: src/sys/arch/atari/pci/pci_machdep.c
diff -u src/sys/arch/atari/pci/pci_machdep.c:1.52 src/sys/arch/atari/pci/pci_machdep.c:1.53
--- src/sys/arch/atari/pci/pci_machdep.c:1.52	Fri Jul  1 16:34:06 2011
+++ src/sys/arch/atari/pci/pci_machdep.c	Wed Mar 26 14:04:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.52 2011/07/01 20:34:06 dyoung Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.53 2014/03/26 18:04:33 christos Exp $	*/
 
 /*
  * Copyright (c) 1996 Leo Weppelman.  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.52 2011/07/01 20:34:06 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.53 2014/03/26 18:04:33 christos Exp $");
 
 #include "opt_mbtype.h"
 
@@ -680,7 +680,7 @@ p

CVS commit: src/sys

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 18:03:47 UTC 2014

Modified Files:
src/sys/kern: subr_prf.c
src/sys/sys: systm.h

Log Message:
remove {v,}sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/sys/kern/subr_prf.c
cvs rdiff -u -r1.261 -r1.262 src/sys/sys/systm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/subr_prf.c
diff -u src/sys/kern/subr_prf.c:1.152 src/sys/kern/subr_prf.c:1.153
--- src/sys/kern/subr_prf.c:1.152	Sat Jan 11 19:29:15 2014
+++ src/sys/kern/subr_prf.c	Wed Mar 26 14:03:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.152 2014/01/12 00:29:15 joerg Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.153 2014/03/26 18:03:47 christos Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.152 2014/01/12 00:29:15 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.153 2014/03/26 18:03:47 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipkdb.h"
@@ -995,38 +995,6 @@ vprintf(const char *fmt, va_list ap)
 }
 
 /*
- * sprintf: print a message to a buffer
- */
-int
-sprintf(char *bf, const char *fmt, ...)
-{
-	int retval;
-	va_list ap;
-
-	va_start(ap, fmt);
-	retval = kprintf(fmt, TOBUFONLY, NULL, bf, ap);
-	va_end(ap);
-	if (bf)
-		bf[retval] = '\0';	/* nul terminate */
-	return retval;
-}
-
-/*
- * vsprintf: print a message to a buffer [already have va_list]
- */
-
-int
-vsprintf(char *bf, const char *fmt, va_list ap)
-{
-	int retval;
-
-	retval = kprintf(fmt, TOBUFONLY, NULL, bf, ap);
-	if (bf)
-		bf[retval] = '\0';	/* nul terminate */
-	return retval;
-}
-
-/*
  * snprintf: print a message to a buffer
  */
 int

Index: src/sys/sys/systm.h
diff -u src/sys/sys/systm.h:1.261 src/sys/sys/systm.h:1.262
--- src/sys/sys/systm.h:1.261	Mon Mar 24 16:07:40 2014
+++ src/sys/sys/systm.h	Wed Mar 26 14:03:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: systm.h,v 1.261 2014/03/24 20:07:40 christos Exp $	*/
+/*	$NetBSD: systm.h,v 1.262 2014/03/26 18:03:47 christos Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1988, 1991, 1993
@@ -214,14 +214,10 @@ void	printf_nolog(const char *, ...) __p
 
 void	printf(const char *, ...) __printflike(1, 2);
 
-int	sprintf(char *, const char *, ...) __printflike(2, 3);
-
 int	snprintf(char *, size_t, const char *, ...) __printflike(3, 4);
 
 void	vprintf(const char *, va_list) __printflike(1, 0);
 
-int	vsprintf(char *, const char *, va_list) __printflike(2, 0);
-
 int	vsnprintf(char *, size_t, const char *, va_list) __printflike(3, 0);
 
 int	humanize_number(char *, size_t, uint64_t, const char *, int);



CVS commit: src/sys/lib/libsa

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 18:02:24 UTC 2014

Modified Files:
src/sys/lib/libsa: Makefile stand.h
Removed Files:
src/sys/lib/libsa: sprintf.c vsprintf.c

Log Message:
Remove {v,}sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/lib/libsa/Makefile
cvs rdiff -u -r1.5 -r0 src/sys/lib/libsa/sprintf.c \
src/sys/lib/libsa/vsprintf.c
cvs rdiff -u -r1.77 -r1.78 src/sys/lib/libsa/stand.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libsa/Makefile
diff -u src/sys/lib/libsa/Makefile:1.80 src/sys/lib/libsa/Makefile:1.81
--- src/sys/lib/libsa/Makefile:1.80	Sun Jan 12 10:19:57 2014
+++ src/sys/lib/libsa/Makefile	Wed Mar 26 14:02:24 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.80 2014/01/12 15:19:57 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.81 2014/03/26 18:02:24 christos Exp $
 
 LIB=	sa
 LIBISPRIVATE?= yes
@@ -25,8 +25,8 @@ CPPFLAGS=	-I${SADIR} ${SACPPFLAGS} ${SAM
 # stand routines
 SRCS+=	alloc.c errno.c exit.c files.c \
 	getfile.c gets.c globals.c \
-	panic.c printf.c qsort.c snprintf.c sprintf.c strerror.c \
-	subr_prf.c twiddle.c vsprintf.c checkpasswd.c
+	panic.c printf.c qsort.c snprintf.c strerror.c \
+	subr_prf.c twiddle.c checkpasswd.c
 
 # string routines
 .if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH} != "x86_64"

Index: src/sys/lib/libsa/stand.h
diff -u src/sys/lib/libsa/stand.h:1.77 src/sys/lib/libsa/stand.h:1.78
--- src/sys/lib/libsa/stand.h:1.77	Sun Jan  5 16:38:25 2014
+++ src/sys/lib/libsa/stand.h	Wed Mar 26 14:02:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: stand.h,v 1.77 2014/01/05 21:38:25 jakllsch Exp $	*/
+/*	$NetBSD: stand.h,v 1.78 2014/03/26 18:02:24 christos Exp $	*/
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -80,9 +80,7 @@
 #define gets		libsa_gets
 #define printf		libsa_printf
 #define putchar		libsa_putchar
-#define sprintf		libsa_sprintf
 #define vprintf		libsa_vprintf
-#define vsprintf	libsa_vsprintf
 #endif
 
 struct open_file;
@@ -252,14 +250,10 @@ int	dkcksum(const struct disklabel *);
 
 void	printf(const char *, ...)
 __attribute__((__format__(__printf__, 1, 2)));
-int	sprintf(char *, const char *, ...)
-__attribute__((__format__(__printf__, 2, 3)));
 int	snprintf(char *, size_t, const char *, ...)
 __attribute__((__format__(__printf__, 3, 4)));
 void	vprintf(const char *, va_list)
 __attribute__((__format__(__printf__, 1, 0)));
-int	vsprintf(char *, const char *, va_list)
-__attribute__((__format__(__printf__, 2, 0)));
 int	vsnprintf(char *, size_t, const char *, va_list)
 __attribute__((__format__(__printf__, 3, 0)));
 void	twiddle(void);



CVS commit: src/sys/arch/i386/stand

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:58:57 UTC 2014

Modified Files:
src/sys/arch/i386/stand/boot: boot2.c
src/sys/arch/i386/stand/dosboot: main.c
src/sys/arch/i386/stand/lib/test: sanamespace.h

Log Message:
kill sprintf.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/i386/stand/boot/boot2.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/i386/stand/dosboot/main.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/lib/test/sanamespace.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/stand/boot/boot2.c
diff -u src/sys/arch/i386/stand/boot/boot2.c:1.61 src/sys/arch/i386/stand/boot/boot2.c:1.62
--- src/sys/arch/i386/stand/boot/boot2.c:1.61	Wed Mar 19 21:15:29 2014
+++ src/sys/arch/i386/stand/boot/boot2.c	Wed Mar 26 13:58:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot2.c,v 1.61 2014/03/20 01:15:29 christos Exp $	*/
+/*	$NetBSD: boot2.c,v 1.62 2014/03/26 17:58:57 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -228,7 +228,8 @@ sprint_bootsel(const char *filename)
 
 	if (parsebootfile(filename, &fsname, &devname, &unit,
 			  &partition, &file) == 0) {
-		sprintf(buf, "%s%d%c:%s", devname, unit, 'a' + partition, file);
+		snprintf(buf, sizeof(buf), "%s%d%c:%s", devname, unit,
+		'a' + partition, file);
 		return buf;
 	}
 	return "(invalid)";

Index: src/sys/arch/i386/stand/dosboot/main.c
diff -u src/sys/arch/i386/stand/dosboot/main.c:1.31 src/sys/arch/i386/stand/dosboot/main.c:1.32
--- src/sys/arch/i386/stand/dosboot/main.c:1.31	Sun Dec 25 01:09:09 2011
+++ src/sys/arch/i386/stand/dosboot/main.c	Wed Mar 26 13:58:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.31 2011/12/25 06:09:09 tsutsui Exp $	 */
+/*	$NetBSD: main.c,v 1.32 2014/03/26 17:58:57 christos Exp $	 */
 
 /*
  * Copyright (c) 1996, 1997
@@ -163,9 +163,9 @@ sprint_bootsel(const char *filename)
 	if (parsebootfile(filename, &fsname, &devname, &unit,
 			  &partition, &file) == 0) {
 		if (!strcmp(fsname, "dos"))
-			sprintf(buf, "dos:%s", file);
+			snprintf(buf, sizeof(buf), "dos:%s", file);
 		else if (!strcmp(fsname, "ufs"))
-			sprintf(buf, "%s%d%c:%s", devname, unit,
+			snprintf(buf, sizeof(buf), "%s%d%c:%s", devname, unit,
 'a' + partition, file);
 		else goto bad;
 		return (buf);

Index: src/sys/arch/i386/stand/lib/test/sanamespace.h
diff -u src/sys/arch/i386/stand/lib/test/sanamespace.h:1.1 src/sys/arch/i386/stand/lib/test/sanamespace.h:1.2
--- src/sys/arch/i386/stand/lib/test/sanamespace.h:1.1	Fri May 15 13:07:16 1998
+++ src/sys/arch/i386/stand/lib/test/sanamespace.h	Wed Mar 26 13:58:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sanamespace.h,v 1.1 1998/05/15 17:07:16 drochner Exp $	*/
+/*	$NetBSD: sanamespace.h,v 1.2 2014/03/26 17:58:57 christos Exp $	*/
 
 /* take back the namespace mangling done by "Makefile.satest" */
 
@@ -12,7 +12,6 @@
 #undef ioctl
 #undef lseek
 #undef printf
-#undef sprintf
 #undef vprintf
 #undef putchar
 #undef gets



CVS commit: src/sys/arch/hppa

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:57:17 UTC 2014

Modified Files:
src/sys/arch/hppa/dev: mongoose.c
src/sys/arch/hppa/hppa: autoconf.c
src/sys/arch/hppa/stand/common: dev_hppa.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hppa/dev/mongoose.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hppa/hppa/autoconf.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hppa/stand/common/dev_hppa.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hppa/dev/mongoose.c
diff -u src/sys/arch/hppa/dev/mongoose.c:1.1 src/sys/arch/hppa/dev/mongoose.c:1.2
--- src/sys/arch/hppa/dev/mongoose.c:1.1	Mon Feb 24 02:23:42 2014
+++ src/sys/arch/hppa/dev/mongoose.c	Wed Mar 26 13:57:17 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mongoose.c,v 1.1 2014/02/24 07:23:42 skrll Exp $	*/
+/*	$NetBSD: mongoose.c,v 1.2 2014/03/26 17:57:17 christos Exp $	*/
 
 /*	$OpenBSD: mongoose.c,v 1.19 2010/01/01 20:28:42 kettenis Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.1 2014/02/24 07:23:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.2 2014/03/26 17:57:17 christos Exp $");
 
 #define MONGOOSE_DEBUG 9
 
@@ -259,7 +259,7 @@ mg_intr_string(void *v, int irq)
 {
 	static char buf[16];
 
-	sprintf (buf, "isa irq %d", irq);
+	snprintf (buf, sizeof(buf), "isa irq %d", irq);
 	return buf;
 }
 

Index: src/sys/arch/hppa/hppa/autoconf.c
diff -u src/sys/arch/hppa/hppa/autoconf.c:1.1 src/sys/arch/hppa/hppa/autoconf.c:1.2
--- src/sys/arch/hppa/hppa/autoconf.c:1.1	Mon Feb 24 02:23:43 2014
+++ src/sys/arch/hppa/hppa/autoconf.c	Wed Mar 26 13:57:17 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.1 2014/02/24 07:23:43 skrll Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.2 2014/03/26 17:57:17 christos Exp $	*/
 
 /*	$OpenBSD: autoconf.c,v 1.15 2001/06/25 00:43:10 mickey Exp $	*/
 
@@ -86,7 +86,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.1 2014/02/24 07:23:43 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.2 2014/03/26 17:57:17 christos Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_useleds.h"
@@ -654,7 +654,7 @@ hppa_mod_info(int type, int sv)
 	}
 
 	if (i == __arraycount(hppa_knownmods)) {
-		sprintf(fakeid, "type %x, sv %x", type, sv);
+		snprintf(fakeid, sizeof(fakeid), "type %x, sv %x", type, sv);
 		return fakeid;
 	}
 

Index: src/sys/arch/hppa/stand/common/dev_hppa.c
diff -u src/sys/arch/hppa/stand/common/dev_hppa.c:1.1 src/sys/arch/hppa/stand/common/dev_hppa.c:1.2
--- src/sys/arch/hppa/stand/common/dev_hppa.c:1.1	Mon Feb 24 02:23:43 2014
+++ src/sys/arch/hppa/stand/common/dev_hppa.c	Wed Mar 26 13:57:17 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev_hppa.c,v 1.1 2014/02/24 07:23:43 skrll Exp $	*/
+/*	$NetBSD: dev_hppa.c,v 1.2 2014/03/26 17:57:17 christos Exp $	*/
 
 /*	$OpenBSD: dev_hppa.c,v 1.5 1999/04/20 20:01:01 mickey Exp $	*/
 
@@ -250,7 +250,8 @@ char ttyname_buf[8];
 char *
 ttyname(int fd)
 {
-	sprintf(ttyname_buf, "%s%d", cdevs[major(cn_tab->cn_dev)],
+	snprintf(ttyname_buf, sizeof(ttyname_buf), "%s%d",
+	cdevs[major(cn_tab->cn_dev)],
 	minor(cn_tab->cn_dev));
 	return (ttyname_buf);
 }



CVS commit: src/sys/arch/ews4800mips

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:56:18 UTC 2014

Modified Files:
src/sys/arch/ews4800mips/sbd: kbms_sbdio.c
src/sys/arch/ews4800mips/stand/common: disk.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ews4800mips/sbd/kbms_sbdio.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ews4800mips/stand/common/disk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/ews4800mips/sbd/kbms_sbdio.c
diff -u src/sys/arch/ews4800mips/sbd/kbms_sbdio.c:1.10 src/sys/arch/ews4800mips/sbd/kbms_sbdio.c:1.11
--- src/sys/arch/ews4800mips/sbd/kbms_sbdio.c:1.10	Sat Oct 13 02:08:30 2012
+++ src/sys/arch/ews4800mips/sbd/kbms_sbdio.c	Wed Mar 26 13:56:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbms_sbdio.c,v 1.10 2012/10/13 06:08:30 tsutsui Exp $	*/
+/*	$NetBSD: kbms_sbdio.c,v 1.11 2014/03/26 17:56:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2005 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kbms_sbdio.c,v 1.10 2012/10/13 06:08:30 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbms_sbdio.c,v 1.11 2014/03/26 17:56:18 christos Exp $");
 
 #include 
 #include 
@@ -503,7 +503,7 @@ mouse_debug_print(u_int buttons, int x, 
 	__y = MINMAX(__y + y, 0, FB_HEIGHT);
 	*(uint8_t *)(fb.fb_addr + __x + __y * FB_LINEBYTES) = 0xff;
 
-	sprintf(buf, "%8d %8d", x, y);
+	snprintf(buf, sizeof(buf), "%8d %8d", x, y);
 	for (i = 0; i < 64 && buf[i]; i++)
 		fb_drawchar(480 + i * 12, k, buf[i]);
 

Index: src/sys/arch/ews4800mips/stand/common/disk.c
diff -u src/sys/arch/ews4800mips/stand/common/disk.c:1.7 src/sys/arch/ews4800mips/stand/common/disk.c:1.8
--- src/sys/arch/ews4800mips/stand/common/disk.c:1.7	Wed Feb  4 10:22:13 2009
+++ src/sys/arch/ews4800mips/stand/common/disk.c	Wed Mar 26 13:56:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: disk.c,v 1.7 2009/02/04 15:22:13 tsutsui Exp $	*/
+/*	$NetBSD: disk.c,v 1.8 2014/03/26 17:56:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2005 The NetBSD Foundation, Inc.
@@ -285,9 +285,8 @@ __fd_progress_msg(int pos)
 {
 	char msg[16];
 
-	memset(msg, 0, sizeof msg);
-	sprintf(msg, "C%d H%d S%d  \r", (pos >> 16) & 0xff, (pos >> 8) & 0xff,
-	pos & 0xff);
+	snprintf(msg, sizeof(msg), "C%d H%d S%d  \r",
+	(pos >> 16) & 0xff, (pos >> 8) & 0xff, pos & 0xff);
 	printf("%s", msg);
 }
 #endif



CVS commit: src/sys/arch/hp300/dev

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:55:26 UTC 2014

Modified Files:
src/sys/arch/hp300/dev: dio.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/hp300/dev/dio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hp300/dev/dio.c
diff -u src/sys/arch/hp300/dev/dio.c:1.38 src/sys/arch/hp300/dev/dio.c:1.39
--- src/sys/arch/hp300/dev/dio.c:1.38	Sun Mar  6 09:51:21 2011
+++ src/sys/arch/hp300/dev/dio.c	Wed Mar 26 13:55:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dio.c,v 1.38 2011/03/06 14:51:21 tsutsui Exp $	*/
+/*	$NetBSD: dio.c,v 1.39 2014/03/26 17:55:26 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dio.c,v 1.38 2011/03/06 14:51:21 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dio.c,v 1.39 2014/03/26 17:55:26 christos Exp $");
 
 #define	_HP300_INTR_H_PRIVATE
 
@@ -263,7 +263,8 @@ dio_devinfo(struct dio_attach_args *da, 
 }
 			} else {
 			foundit:
-sprintf(buf, "%s", dio_devdescs[i].dd_desc);
+snprintf(buf, buflen, "%s",
+dio_devdescs[i].dd_desc);
 return buf;
 			}
 		}
@@ -273,7 +274,7 @@ dio_devinfo(struct dio_attach_args *da, 
 	/*
 	 * Device is unknown.  Construct something reasonable.
 	 */
-	sprintf(buf, "device id = 0x%x secid = 0x%x",
+	snprintf(buf, buflen, "device id = 0x%x secid = 0x%x",
 	da->da_id, da->da_secid);
 	return buf;
 }



CVS commit: src/sys/arch/hpc/hpc/platid_gen

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:54:46 UTC 2014

Modified Files:
src/sys/arch/hpc/hpc/platid_gen: gram.y platid_gen.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hpc/hpc/platid_gen/gram.y
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hpc/hpc/platid_gen/platid_gen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hpc/hpc/platid_gen/gram.y
diff -u src/sys/arch/hpc/hpc/platid_gen/gram.y:1.4 src/sys/arch/hpc/hpc/platid_gen/gram.y:1.5
--- src/sys/arch/hpc/hpc/platid_gen/gram.y:1.4	Fri Sep 23 10:14:38 2011
+++ src/sys/arch/hpc/hpc/platid_gen/gram.y	Wed Mar 26 13:54:46 2014
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: gram.y,v 1.4 2011/09/23 14:14:38 nonaka Exp $	*/
+/*	$NetBSD: gram.y,v 1.5 2014/03/26 17:54:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999
@@ -184,7 +184,7 @@ dump_node(prefix, n)
 	char prefix2[1024];
 	node_t *np;
 
-	sprintf(prefix2, "%s", prefix);
+	snprintf(prefix2, sizeof(prefix2), "%s", prefix);
 
 	switch (n->type) {
 	case N_LABEL:

Index: src/sys/arch/hpc/hpc/platid_gen/platid_gen.c
diff -u src/sys/arch/hpc/hpc/platid_gen/platid_gen.c:1.10 src/sys/arch/hpc/hpc/platid_gen/platid_gen.c:1.11
--- src/sys/arch/hpc/hpc/platid_gen/platid_gen.c:1.10	Fri Sep 23 10:14:38 2011
+++ src/sys/arch/hpc/hpc/platid_gen/platid_gen.c	Wed Mar 26 13:54:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: platid_gen.c,v 1.10 2011/09/23 14:14:38 nonaka Exp $	*/
+/*	$NetBSD: platid_gen.c,v 1.11 2014/03/26 17:54:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: platid_gen.c,v 1.10 2011/09/23 14:14:38 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: platid_gen.c,v 1.11 2014/03/26 17:54:46 christos Exp $");
 
 #include 
 #include 
@@ -307,7 +307,7 @@ gen_list(node_t* np)
 		case N_ENTRY:
 			if (np->ptr2 == NULL) {
 char buf[MAXLEN];
-sprintf(buf, "%s%s",
+snprintf(buf, sizeof(buf), "%s%s",
 nest == 0 ? "" : " ",
 np->ptr1);
 		  		np->ptr2 = strdup(buf);



CVS commit: src/sys/arch/hpcmips

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:53:36 UTC 2014

Modified Files:
src/sys/arch/hpcmips/dev: mq200debug.c plumpcmcia.c
src/sys/arch/hpcmips/hpcmips: machdep.c
src/sys/arch/hpcmips/include: cpu.h
src/sys/arch/hpcmips/tx: tx39.c tx39icu.c
src/sys/arch/hpcmips/vr: vr.c vrpmu.c

Log Message:
- kill sprintf
- fix unused


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hpcmips/dev/mq200debug.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/hpcmips/dev/plumpcmcia.c
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/hpcmips/hpcmips/machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hpcmips/include/cpu.h
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/hpcmips/tx/tx39.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/hpcmips/tx/tx39icu.c
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/hpcmips/vr/vr.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hpcmips/vr/vrpmu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hpcmips/dev/mq200debug.c
diff -u src/sys/arch/hpcmips/dev/mq200debug.c:1.5 src/sys/arch/hpcmips/dev/mq200debug.c:1.6
--- src/sys/arch/hpcmips/dev/mq200debug.c:1.5	Sun Dec 11 07:17:33 2005
+++ src/sys/arch/hpcmips/dev/mq200debug.c	Wed Mar 26 13:53:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mq200debug.c,v 1.5 2005/12/11 12:17:33 christos Exp $	*/
+/*	$NetBSD: mq200debug.c,v 1.6 2014/03/26 17:53:36 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001 TAKEMURA Shin
@@ -31,7 +31,7 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mq200debug.c,v 1.5 2005/12/11 12:17:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mq200debug.c,v 1.6 2014/03/26 17:53:36 christos Exp $");
 
 #include 
 #include 
@@ -193,11 +193,11 @@ mq200_regname(struct mq200_softc *sc, in
 	for (i = 0; i < sizeof(regs)/sizeof(*regs); i++)
 		if (regs[i].base + regs[i].start * 4 <= offset &&
 		offset <= regs[i].base + regs[i].end * 4) {
-			sprintf(buf, "%s%02XR", regs[i].name,
+			snprintf(buf, bufsize, "%s%02XR", regs[i].name,
 			(offset - regs[i].base) / 4);
 			return (buf);
 		}
-	sprintf(buf, "OFFSET %02X", offset);
+	snprintf(buf, bufsize, "OFFSET %02X", offset);
 	return (buf);
 }
 

Index: src/sys/arch/hpcmips/dev/plumpcmcia.c
diff -u src/sys/arch/hpcmips/dev/plumpcmcia.c:1.26 src/sys/arch/hpcmips/dev/plumpcmcia.c:1.27
--- src/sys/arch/hpcmips/dev/plumpcmcia.c:1.26	Sat Oct 27 13:17:53 2012
+++ src/sys/arch/hpcmips/dev/plumpcmcia.c	Wed Mar 26 13:53:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: plumpcmcia.c,v 1.26 2012/10/27 17:17:53 chs Exp $ */
+/*	$NetBSD: plumpcmcia.c,v 1.27 2014/03/26 17:53:36 christos Exp $ */
 
 /*
  * Copyright (c) 1999, 2000 UCHIYAMA Yasushi. All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plumpcmcia.c,v 1.26 2012/10/27 17:17:53 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plumpcmcia.c,v 1.27 2014/03/26 17:53:36 christos Exp $");
 
 #include 
 #include 
@@ -213,7 +213,7 @@ plumpcmcia_attach(device_t parent, devic
 	struct plum_attach_args *pa = aux;
 	struct plumpcmcia_softc *sc = device_private(self);
 	struct plumpcmcia_handle *ph;
-	int error;
+	int error __diagused;
 
 	sc->sc_dev = self;
 	sc->sc_pc	= pa->pa_pc;
@@ -844,7 +844,6 @@ plum_csc_intr_setup(struct plumpcmcia_so
 	bus_space_tag_t regt = ph->ph_regt;
 	bus_space_handle_t regh = ph->ph_regh;
 	plumreg_t reg;
-	void *ih;
 	
 	/* enable CARD DETECT ENABLE only */
 	plum_conf_write(regt, regh, PLUM_PCMCIA_CSCINT,
@@ -856,7 +855,7 @@ plum_csc_intr_setup(struct plumpcmcia_so
 	plum_conf_write(regt, regh, PLUM_PCMCIA_GLOBALCTRL, reg);
 	
 	/* install interrupt handler (don't fail) */
-	ih = plum_intr_establish(sc->sc_pc, irq, IST_EDGE, IPL_TTY,
+	plum_intr_establish(sc->sc_pc, irq, IST_EDGE, IPL_TTY,
 	plum_csc_intr, ph);
 	KASSERT(ih != 0);
 }

Index: src/sys/arch/hpcmips/hpcmips/machdep.c
diff -u src/sys/arch/hpcmips/hpcmips/machdep.c:1.118 src/sys/arch/hpcmips/hpcmips/machdep.c:1.119
--- src/sys/arch/hpcmips/hpcmips/machdep.c:1.118	Tue Mar 25 09:38:25 2014
+++ src/sys/arch/hpcmips/hpcmips/machdep.c	Wed Mar 26 13:53:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.118 2014/03/25 13:38:25 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.119 2014/03/26 17:53:36 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 Shin Takemura, All rights reserved.
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.118 2014/03/25 13:38:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.119 2014/03/26 17:53:36 christos Exp $");
 
 #include "opt_vr41xx.h"
 #include "opt_tx39xx.h"
@@ -152,7 +152,7 @@ static int __bicons_enable;
 #endif
 
 /* the following is used externally (sysctl_hw) */
-char	hpcmips_cpuname[40];		/* set CPU depend xx_init() */
+static char	hpcmips_cpuname[40];		/* set CPU depend xx_init() */
 
 int	cpuspeed = 1;			/* approx # instr per usec. */
 
@@ -458,6 +458,19 @@ mach_init(int argc, char *argv[], struct
 	mips_init_lwp0_uare

CVS commit: src/sys/arch/mac68k/mac68k

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:46:04 UTC 2014

Modified Files:
src/sys/arch/mac68k/mac68k: pram.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mac68k/mac68k/pram.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mac68k/mac68k/pram.c
diff -u src/sys/arch/mac68k/mac68k/pram.c:1.22 src/sys/arch/mac68k/mac68k/pram.c:1.23
--- src/sys/arch/mac68k/mac68k/pram.c:1.22	Tue Jun 20 20:02:26 2006
+++ src/sys/arch/mac68k/mac68k/pram.c	Wed Mar 26 13:46:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pram.c,v 1.22 2006/06/21 00:02:26 rjs Exp $	*/
+/*	$NetBSD: pram.c,v 1.23 2014/03/26 17:46:04 christos Exp $	*/
 
 /*-
  * Copyright (C) 1993	Allen K. Briggs, Chris P. Caputo,
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pram.c,v 1.22 2006/06/21 00:02:26 rjs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pram.c,v 1.23 2014/03/26 17:46:04 christos Exp $");
 
 #include "opt_adb.h"
 
@@ -121,7 +121,8 @@ static const char *convtime(unsigned lon
 t=0;
   }
 
-  sprintf(s,"%s %ld, %ld   %ld:%ld:%ld",monstr[month],day,year,hour,minute,seconds);
+  snprintf(s, sizeof(s), "%s %ld, %ld   %ld:%ld:%ld",
+  monstr[month], day, year, hour, minute, seconds);
 
   return s;
 }



CVS commit: src/sys/arch/landisk

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:47:10 UTC 2014

Modified Files:
src/sys/arch/landisk/landisk: shpcic_machdep.c
src/sys/arch/landisk/stand/boot: boot2.c cons.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/landisk/landisk/shpcic_machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/landisk/stand/boot/boot2.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/landisk/stand/boot/cons.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/landisk/landisk/shpcic_machdep.c
diff -u src/sys/arch/landisk/landisk/shpcic_machdep.c:1.5 src/sys/arch/landisk/landisk/shpcic_machdep.c:1.6
--- src/sys/arch/landisk/landisk/shpcic_machdep.c:1.5	Sat Oct 27 13:17:58 2012
+++ src/sys/arch/landisk/landisk/shpcic_machdep.c	Wed Mar 26 13:47:10 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: shpcic_machdep.c,v 1.5 2012/10/27 17:17:58 chs Exp $	*/
+/*	$NetBSD: shpcic_machdep.c,v 1.6 2014/03/26 17:47:10 christos Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: shpcic_machdep.c,v 1.5 2012/10/27 17:17:58 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: shpcic_machdep.c,v 1.6 2014/03/26 17:47:10 christos Exp $");
 
 #include 
 #include 
@@ -125,7 +125,7 @@ landisk_pci_intr_string(void *v, pci_int
 	if (ih == 0)
 		panic("pci_intr_string: bogus handle 0x%x", ih);
 
-	sprintf(irqstr, "irq %d", ih);
+	snprintf(irqstr, sizeof(irqstr), "irq %d", ih);
 
 	return (irqstr);
 }

Index: src/sys/arch/landisk/stand/boot/boot2.c
diff -u src/sys/arch/landisk/stand/boot/boot2.c:1.3 src/sys/arch/landisk/stand/boot/boot2.c:1.4
--- src/sys/arch/landisk/stand/boot/boot2.c:1.3	Sun Dec 25 01:09:09 2011
+++ src/sys/arch/landisk/stand/boot/boot2.c	Wed Mar 26 13:47:10 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot2.c,v 1.3 2011/12/25 06:09:09 tsutsui Exp $	*/
+/*	$NetBSD: boot2.c,v 1.4 2014/03/26 17:47:10 christos Exp $	*/
 
 /*
  * Copyright (c) 2003
@@ -183,7 +183,8 @@ sprint_bootsel(const char *filename)
 	const char *file;
 
 	if (parsebootfile(filename, &devname, &unit, &partition, &file) == 0) {
-		sprintf(buf, "%s%d%c:%s", devname, unit, 'a' + partition, file);
+		snprintf(buf, sizeof(buf), "%s%d%c:%s", devname, unit,
+		'a' + partition, file);
 		return (buf);
 	}
 	return ("(invalid)");

Index: src/sys/arch/landisk/stand/boot/cons.c
diff -u src/sys/arch/landisk/stand/boot/cons.c:1.1 src/sys/arch/landisk/stand/boot/cons.c:1.2
--- src/sys/arch/landisk/stand/boot/cons.c:1.1	Fri Sep  1 17:26:18 2006
+++ src/sys/arch/landisk/stand/boot/cons.c	Wed Mar 26 13:47:10 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cons.c,v 1.1 2006/09/01 21:26:18 uwe Exp $	*/
+/*	$NetBSD: cons.c,v 1.2 2014/03/26 17:47:10 christos Exp $	*/
 
 /*-
  * Copyright (c) 2005 NONAKA Kimihiro
@@ -137,8 +137,8 @@ awaitkey(int timeout, int tell)
 			char numbuf[20];
 			int len, j;
 
-			sprintf(numbuf, "%d ", i / POLL_FREQ);
-			len = strlen(numbuf);
+			len = snprintf(numbuf, sizeof(numbuf),
+			"%d ", i / POLL_FREQ);
 			for (j = 0; j < len; j++)
 numbuf[len + j] = '\b';
 			numbuf[len + j] = '\0';



CVS commit: src/sys/arch/mvmeppc/mvmeppc

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:44:36 UTC 2014

Modified Files:
src/sys/arch/mvmeppc/mvmeppc: machdep.c platform_160x.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/mvmeppc/mvmeppc/machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mvmeppc/mvmeppc/platform_160x.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mvmeppc/mvmeppc/machdep.c
diff -u src/sys/arch/mvmeppc/mvmeppc/machdep.c:1.30 src/sys/arch/mvmeppc/mvmeppc/machdep.c:1.31
--- src/sys/arch/mvmeppc/mvmeppc/machdep.c:1.30	Sat Oct 13 13:58:54 2012
+++ src/sys/arch/mvmeppc/mvmeppc/machdep.c	Wed Mar 26 13:44:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.30 2012/10/13 17:58:54 jdc Exp $	*/
+/*	$NetBSD: machdep.c,v 1.31 2014/03/26 17:44:36 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.30 2012/10/13 17:58:54 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.31 2014/03/26 17:44:36 christos Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_mvmetype.h"
@@ -123,7 +123,7 @@ initppc(u_long startkernel, u_long endke
 		extern void _mvmeppc_unsup_board(const char *, const char *);
 		char msg[80];
 
-		sprintf(msg, "Unsupported model: MVME%04x",
+		snprintf(msg, sizeof(msg), "Unsupported model: MVME%04x",
 		bootinfo.bi_modelnumber);
 		_mvmeppc_unsup_board(msg, &msg[strlen(msg)]);
 		/* NOTREACHED */
@@ -168,7 +168,8 @@ cpu_startup(void)
 	if (!prep_intr_reg)
 		panic("startup: no room for interrupt register");
 
-	sprintf(modelbuf, "%s\nCore Speed: %dMHz, Bus Speed: %dMHz\n",
+	snprintf(modelbuf, sizeof(modelbuf),
+	"%s\nCore Speed: %dMHz, Bus Speed: %dMHz\n",
 	platform->model,
 	bootinfo.bi_mpuspeed/100,
 	bootinfo.bi_busspeed/100);

Index: src/sys/arch/mvmeppc/mvmeppc/platform_160x.c
diff -u src/sys/arch/mvmeppc/mvmeppc/platform_160x.c:1.8 src/sys/arch/mvmeppc/mvmeppc/platform_160x.c:1.9
--- src/sys/arch/mvmeppc/mvmeppc/platform_160x.c:1.8	Sat Jun 18 04:08:29 2011
+++ src/sys/arch/mvmeppc/mvmeppc/platform_160x.c	Wed Mar 26 13:44:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: platform_160x.c,v 1.8 2011/06/18 08:08:29 matt Exp $	*/
+/*	$NetBSD: platform_160x.c,v 1.9 2014/03/26 17:44:36 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: platform_160x.c,v 1.8 2011/06/18 08:08:29 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: platform_160x.c,v 1.9 2014/03/26 17:44:36 christos Exp $");
 
 #include 
 #include 
@@ -104,8 +104,8 @@ p160x_match(struct platform *p)
 	for (cp = &bid.pwa[sizeof(bid.pwa) - 1]; *cp == ' '; cp--)
 		*cp = '\0';
 
-	sprintf(p160x_model, "%s, Serial: %s, PWA: %s", bid.id,
-	bid.serial, bid.pwa);
+	snprintf(p160x_model, sizeof(p160x_model),
+	"%s, Serial: %s, PWA: %s", bid.id, bid.serial, bid.pwa);
 	p->model = p160x_model;
 
 	speed[3] = '\0';



CVS commit: src/sys/arch/macppc/macppc

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:45:16 UTC 2014

Modified Files:
src/sys/arch/macppc/macppc: cpu.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/macppc/macppc/cpu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/macppc/macppc/cpu.c
diff -u src/sys/arch/macppc/macppc/cpu.c:1.59 src/sys/arch/macppc/macppc/cpu.c:1.60
--- src/sys/arch/macppc/macppc/cpu.c:1.59	Sat Oct 27 13:18:00 2012
+++ src/sys/arch/macppc/macppc/cpu.c	Wed Mar 26 13:45:16 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.59 2012/10/27 17:18:00 chs Exp $	*/
+/*	$NetBSD: cpu.c,v 1.60 2014/03/26 17:45:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001 Tsubai Masanari.
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.59 2012/10/27 17:18:00 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.60 2014/03/26 17:45:16 christos Exp $");
 
 #include "opt_ppcparam.h"
 #include "opt_multiprocessor.h"
@@ -221,7 +221,7 @@ md_setup_trampoline(volatile struct cpu_
 		h->hatch_running = -1;
 
 		/* see if there's an OF property for the reset register */
-		sprintf(cpupath, "/cpus/@%x", ci->ci_cpuid);
+		snprintf(cpupath, sizeof(cpupath), "/cpus/@%x", ci->ci_cpuid);
 		node = OF_finddevice(cpupath);
 		if (node == -1) {
 			printf(": no OF node for CPU %d?\n", ci->ci_cpuid);



CVS commit: src/sys/arch/newsmips/stand

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:43:11 UTC 2014

Modified Files:
src/sys/arch/newsmips/stand/boot: boot.c
src/sys/arch/newsmips/stand/bootxx: bootxx.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/newsmips/stand/boot/boot.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/newsmips/stand/bootxx/bootxx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/newsmips/stand/boot/boot.c
diff -u src/sys/arch/newsmips/stand/boot/boot.c:1.19 src/sys/arch/newsmips/stand/boot/boot.c:1.20
--- src/sys/arch/newsmips/stand/boot/boot.c:1.19	Sat Jan 22 14:19:21 2011
+++ src/sys/arch/newsmips/stand/boot/boot.c	Wed Mar 26 13:43:11 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.19 2011/01/22 19:19:21 joerg Exp $	*/
+/*	$NetBSD: boot.c,v 1.20 2014/03/26 17:43:11 christos Exp $	*/
 
 /*-
  * Copyright (C) 1999 Tsubai Masanari.  All rights reserved.
@@ -147,7 +147,8 @@ boot(uint32_t a0, uint32_t a1, uint32_t 
 			_rtt();
 		}
 
-		sprintf(devname, "%s(%d,%d,%d)", devs[type], ctlr, unit, part);
+		snprintf(devname, sizeof(devname), "%s(%d,%d,%d)",
+		devs[type], ctlr, unit, part);
 	}
 
 	printf("Booting %s%s\n", devname, netbsd);
@@ -165,7 +166,7 @@ boot(uint32_t a0, uint32_t a1, uint32_t 
 	marks[MARK_START] = 0;
 
 	for (i = 0; kernels[i]; i++) {
-		sprintf(file, "%s%s", devname, kernels[i]);
+		snprintf(file, sizeof(file), "%s%s", devname, kernels[i]);
 		DPRINTF("trying %s...\n", file);
 		fd = loadfile(file, marks, loadflag);
 		if (fd != -1)

Index: src/sys/arch/newsmips/stand/bootxx/bootxx.c
diff -u src/sys/arch/newsmips/stand/bootxx/bootxx.c:1.8 src/sys/arch/newsmips/stand/bootxx/bootxx.c:1.9
--- src/sys/arch/newsmips/stand/bootxx/bootxx.c:1.8	Thu Feb 21 09:32:31 2008
+++ src/sys/arch/newsmips/stand/bootxx/bootxx.c	Wed Mar 26 13:43:11 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootxx.c,v 1.8 2008/02/21 14:32:31 tsutsui Exp $	*/
+/*	$NetBSD: bootxx.c,v 1.9 2014/03/26 17:43:11 christos Exp $	*/
 
 /*-
  * Copyright (C) 1999 Tsubai Masanari.  All rights reserved.
@@ -108,7 +108,8 @@ bootxx(uint32_t a0, uint32_t a1, uint32_
 			printf("unknown bootdev (0x%x)\n", bootdev);
 			return;
 		}
-		sprintf(devname, "%s(%d,%d,%d)", devs[type], ctlr, unit, part);
+		snprintf(devname, sizeof(devname), "%s(%d,%d,%d)",
+		devs[type], ctlr, unit, part);
 
 		fd = rom_open(devname, 0);
 	}



CVS commit: src/sys/arch/mips

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:42:00 UTC 2014

Modified Files:
src/sys/arch/mips/alchemy/dev: aupci.c
src/sys/arch/mips/mips: trap.c
src/sys/arch/mips/ralink: ralink_mainbus.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mips/alchemy/dev/aupci.c
cvs rdiff -u -r1.235 -r1.236 src/sys/arch/mips/mips/trap.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/mips/ralink/ralink_mainbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/alchemy/dev/aupci.c
diff -u src/sys/arch/mips/alchemy/dev/aupci.c:1.13 src/sys/arch/mips/alchemy/dev/aupci.c:1.14
--- src/sys/arch/mips/alchemy/dev/aupci.c:1.13	Fri Jan 27 13:52:58 2012
+++ src/sys/arch/mips/alchemy/dev/aupci.c	Wed Mar 26 13:42:00 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: aupci.c,v 1.13 2012/01/27 18:52:58 para Exp $ */
+/* $NetBSD: aupci.c,v 1.14 2014/03/26 17:42:00 christos Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -35,7 +35,7 @@
 #include "pci.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: aupci.c,v 1.13 2012/01/27 18:52:58 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aupci.c,v 1.14 2014/03/26 17:42:00 christos Exp $");
 
 #include 
 #include 
@@ -400,7 +400,7 @@ aupci_intr_string(void *v, pci_intr_hand
 {
 	static char	name[16];
 
-	sprintf(name, "irq %u", (unsigned)ih);
+	snprintf(name, sizeof(name), "irq %u", (unsigned)ih);
 	return (name);
 }
 

Index: src/sys/arch/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.235 src/sys/arch/mips/mips/trap.c:1.236
--- src/sys/arch/mips/mips/trap.c:1.235	Sun Feb 19 16:06:20 2012
+++ src/sys/arch/mips/mips/trap.c	Wed Mar 26 13:42:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.235 2012/02/19 21:06:20 rmind Exp $	*/
+/*	$NetBSD: trap.c,v 1.236 2014/03/26 17:42:00 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.235 2012/02/19 21:06:20 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.236 2014/03/26 17:42:00 christos Exp $");
 
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 #include "opt_ddb.h"
@@ -1192,7 +1192,7 @@ fn_name(vaddr_t addr)
 	for (i = 0; names[i].name; i++)
 		if (names[i].addr == (void*)addr)
 			return (names[i].name);
-	sprintf(buf, "%#"PRIxVADDR, addr);
+	snprintf(buf, sizeof(buf), "%#"PRIxVADDR, addr);
 	return (buf);
 }
 

Index: src/sys/arch/mips/ralink/ralink_mainbus.c
diff -u src/sys/arch/mips/ralink/ralink_mainbus.c:1.2 src/sys/arch/mips/ralink/ralink_mainbus.c:1.3
--- src/sys/arch/mips/ralink/ralink_mainbus.c:1.2	Thu Jul 28 11:38:49 2011
+++ src/sys/arch/mips/ralink/ralink_mainbus.c	Wed Mar 26 13:42:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ralink_mainbus.c,v 1.2 2011/07/28 15:38:49 matt Exp $	*/
+/*	$NetBSD: ralink_mainbus.c,v 1.3 2014/03/26 17:42:00 christos Exp $	*/
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ralink_mainbus.c,v 1.2 2011/07/28 15:38:49 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_mainbus.c,v 1.3 2014/03/26 17:42:00 christos Exp $");
 
 #include 
 #include 
@@ -129,7 +129,7 @@ mainbus_find(device_t parent, cfdata_t c
 	struct mainbus_attach_args * const ma = aux;
 	char devname[16];
 
-	sprintf(devname, "%s%d", cf->cf_name, cf->cf_unit);
+	snprintf(devname, sizeof(devname), "%s%d", cf->cf_name, cf->cf_unit);
 	if (strcmp(ma->ma_name, devname) != 0)
 		return 0;
 



CVS commit: src/sys/arch/evbmips

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:41:15 UTC 2014

Modified Files:
src/sys/arch/evbmips/loongson: loongson_intr.c
src/sys/arch/evbmips/malta/pci: pcib.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbmips/loongson/loongson_intr.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbmips/malta/pci/pcib.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbmips/loongson/loongson_intr.c
diff -u src/sys/arch/evbmips/loongson/loongson_intr.c:1.2 src/sys/arch/evbmips/loongson/loongson_intr.c:1.3
--- src/sys/arch/evbmips/loongson/loongson_intr.c:1.2	Sat Oct 27 13:17:50 2012
+++ src/sys/arch/evbmips/loongson/loongson_intr.c	Wed Mar 26 13:41:15 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: loongson_intr.c,v 1.2 2012/10/27 17:17:50 chs Exp $  */
+/*  $NetBSD: loongson_intr.c,v 1.3 2014/03/26 17:41:15 christos Exp $  */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: loongson_intr.c,v 1.2 2012/10/27 17:17:50 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: loongson_intr.c,v 1.3 2014/03/26 17:41:15 christos Exp $");
 
 #define __INTR_PRIVATE
 
@@ -126,7 +126,7 @@ evbmips_intr_init(void)
 		static char irqstr[8];
 		for (irq = 0; irq < BONITO_NISA; irq++) {
 			i = BONITO_ISA_IRQ(irq);
-			sprintf(irqstr, "irq %d", irq);
+			snprintf(irqstr, sizeof(irqstr), "irq %d", irq);
 			DPRINTF(("attach %d %d %s\n", i, irq, irqstr));
 			evcnt_attach_dynamic(&bonito_intrhead[i].intr_count,
 			EVCNT_TYPE_INTR, NULL, "isa", irqstr);
@@ -334,7 +334,8 @@ loongson_intr_string(const struct bonito
 {
 	static char irqstr[12]; /* 8 + 2 + NULL + sanity */
 	if (BONITO_IRQ_IS_ISA(irq)) {
-		sprintf(irqstr, "isa irq %d", BONITO_IRQ_TO_ISA(irq));
+		snprintf(irqstr, sizeof(irqstr), "isa irq %d",
+		BONITO_IRQ_TO_ISA(irq));
 		return irqstr;
 	}
 	return sys_platform->irq_map[irq].name;

Index: src/sys/arch/evbmips/malta/pci/pcib.c
diff -u src/sys/arch/evbmips/malta/pci/pcib.c:1.16 src/sys/arch/evbmips/malta/pci/pcib.c:1.17
--- src/sys/arch/evbmips/malta/pci/pcib.c:1.16	Sat Oct 27 13:17:51 2012
+++ src/sys/arch/evbmips/malta/pci/pcib.c	Wed Mar 26 13:41:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcib.c,v 1.16 2012/10/27 17:17:51 chs Exp $	*/
+/*	$NetBSD: pcib.c,v 1.17 2014/03/26 17:41:15 christos Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.16 2012/10/27 17:17:51 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.17 2014/03/26 17:41:15 christos Exp $");
 
 #include 
 #include 
@@ -306,7 +306,7 @@ pcib_attach(device_t parent, device_t se
 #if 0
 		char irqstr[8];		/* 4 + 2 + NULL + sanity */
 
-		sprintf(irqstr, "irq %d", i);
+		snprintf(irqstr, sizeof(irqstr), "irq %d", i);
 		evcnt_attach_dynamic(&sc->sc_intrtab[i].intr_count,
 		EVCNT_TYPE_INTR, NULL, "pcib", irqstr);
 #else
@@ -469,7 +469,7 @@ pcib_isa_intr_string(void *v, int irq)
 	if (irq == 0 || irq >= ICU_LEN || irq == 2)
 		panic("pcib_isa_intr_string: bogus isa irq 0x%x", irq);
 
-	sprintf(irqstr, "isa irq %d", irq);
+	snprintf(irqstr, sizeof(irqstr), "isa irq %d", irq);
 	return (irqstr);
 }
 



CVS commit: src/sys/arch/evbarm

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:40:03 UTC 2014

Modified Files:
src/sys/arch/evbarm/ifpga: ifpga_pci.c
src/sys/arch/evbarm/iq80310: iq80310_intr.c iq80310_pci.c
src/sys/arch/evbarm/ixdp425: ixdp425_pci.c
src/sys/arch/evbarm/ixm1200: ixm1200_pci.c nappi_nppb.c

Log Message:
kill sprintf.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/ifpga/ifpga_pci.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/evbarm/iq80310/iq80310_intr.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/iq80310/iq80310_pci.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/ixdp425/ixdp425_pci.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/ixm1200/ixm1200_pci.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/ixm1200/nappi_nppb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/ifpga/ifpga_pci.c
diff -u src/sys/arch/evbarm/ifpga/ifpga_pci.c:1.16 src/sys/arch/evbarm/ifpga/ifpga_pci.c:1.17
--- src/sys/arch/evbarm/ifpga/ifpga_pci.c:1.16	Sun Mar  9 15:55:48 2014
+++ src/sys/arch/evbarm/ifpga/ifpga_pci.c	Wed Mar 26 13:40:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ifpga_pci.c,v 1.16 2014/03/09 19:55:48 martin Exp $	*/
+/*	$NetBSD: ifpga_pci.c,v 1.17 2014/03/26 17:40:03 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 ARM Ltd
@@ -64,7 +64,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ifpga_pci.c,v 1.16 2014/03/09 19:55:48 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ifpga_pci.c,v 1.17 2014/03/26 17:40:03 christos Exp $");
 
 #include 
 #include 
@@ -335,7 +335,7 @@ ifpga_pci_intr_string(void *pcv, pci_int
 	if (ih == 0)
 		panic("ifpga_pci_intr_string: bogus handle 0x%lx", ih);
 
-	sprintf(irqstr, "pciint%ld", ih - IFPGA_INTRNUM_PCIINT0);
+	snprintf(irqstr, sizeof(irqstr), "pciint%ld", ih - IFPGA_INTRNUM_PCIINT0);
 	return irqstr;	
 }
 

Index: src/sys/arch/evbarm/iq80310/iq80310_intr.c
diff -u src/sys/arch/evbarm/iq80310/iq80310_intr.c:1.33 src/sys/arch/evbarm/iq80310/iq80310_intr.c:1.34
--- src/sys/arch/evbarm/iq80310/iq80310_intr.c:1.33	Tue Jan 28 07:01:31 2014
+++ src/sys/arch/evbarm/iq80310/iq80310_intr.c	Wed Mar 26 13:40:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: iq80310_intr.c,v 1.33 2014/01/28 12:01:31 martin Exp $	*/
+/*	$NetBSD: iq80310_intr.c,v 1.34 2014/03/26 17:40:03 christos Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iq80310_intr.c,v 1.33 2014/01/28 12:01:31 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iq80310_intr.c,v 1.34 2014/03/26 17:40:03 christos Exp $");
 
 #ifndef EVBARM_SPL_NOINLINE
 #define	EVBARM_SPL_NOINLINE
@@ -337,7 +337,7 @@ iq80310_intr_init(void)
 		iq = &intrq[i];
 		TAILQ_INIT(&iq->iq_list);
 
-		sprintf(iq->iq_name, "irq %d", i);
+		snprintf(iq->iq_name, sizeof(iq->iq_name), "irq %d", i);
 	}
 
 	iq80310_intr_calculate_masks();

Index: src/sys/arch/evbarm/iq80310/iq80310_pci.c
diff -u src/sys/arch/evbarm/iq80310/iq80310_pci.c:1.11 src/sys/arch/evbarm/iq80310/iq80310_pci.c:1.12
--- src/sys/arch/evbarm/iq80310/iq80310_pci.c:1.11	Fri Jul  1 16:41:16 2011
+++ src/sys/arch/evbarm/iq80310/iq80310_pci.c	Wed Mar 26 13:40:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: iq80310_pci.c,v 1.11 2011/07/01 20:41:16 dyoung Exp $	*/
+/*	$NetBSD: iq80310_pci.c,v 1.12 2014/03/26 17:40:03 christos Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iq80310_pci.c,v 1.11 2011/07/01 20:41:16 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iq80310_pci.c,v 1.12 2014/03/26 17:40:03 christos Exp $");
 
 #include 
 #include 
@@ -234,7 +234,7 @@ iq80310_pci_intr_string(void *v, pci_int
 {
 	static char irqstr[IRQNAMESIZE];
 
-	sprintf(irqstr, "iq80310 irq %ld", ih);
+	snprintf(irqstr, sizeof(irqstr), "iq80310 irq %ld", ih);
 	return (irqstr);
 }
 

Index: src/sys/arch/evbarm/ixdp425/ixdp425_pci.c
diff -u src/sys/arch/evbarm/ixdp425/ixdp425_pci.c:1.9 src/sys/arch/evbarm/ixdp425/ixdp425_pci.c:1.10
--- src/sys/arch/evbarm/ixdp425/ixdp425_pci.c:1.9	Mon Nov 12 13:00:39 2012
+++ src/sys/arch/evbarm/ixdp425/ixdp425_pci.c	Wed Mar 26 13:40:03 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: ixdp425_pci.c,v 1.9 2012/11/12 18:00:39 skrll Exp $ */
+/*  $NetBSD: ixdp425_pci.c,v 1.10 2014/03/26 17:40:03 christos Exp $ */
 #define PCI_DEBUG
 /*
  * Copyright (c) 2003
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixdp425_pci.c,v 1.9 2012/11/12 18:00:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixdp425_pci.c,v 1.10 2014/03/26 17:40:03 christos Exp $");
 
 /*
  * IXDP425 PCI interrupt support.
@@ -219,7 +219,7 @@ ixdp425_pci_intr_string(void *v, pci_int
 {
 	static char irqstr[IRQNAMESIZE];
 
-	sprintf(irqstr, "ixp425 irq %ld", ih);
+	snprintf(irqstr, sizeof(irqstr), "ixp425 irq %ld", ih);
 	return (irqstr);
 }
 

Index: src/sys/arch/evbarm/ixm1200/ixm1200_pci.c
diff -u s

CVS commit: src/sys/arch/ofppc/ofppc

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:38:09 UTC 2014

Modified Files:
src/sys/arch/ofppc/ofppc: machdep.c

Log Message:
kill sprintf.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/ofppc/ofppc/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/ofppc/ofppc/machdep.c
diff -u src/sys/arch/ofppc/ofppc/machdep.c:1.116 src/sys/arch/ofppc/ofppc/machdep.c:1.117
--- src/sys/arch/ofppc/ofppc/machdep.c:1.116	Sat Jul 28 19:11:01 2012
+++ src/sys/arch/ofppc/ofppc/machdep.c	Wed Mar 26 13:38:09 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.116 2012/07/28 23:11:01 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.117 2014/03/26 17:38:09 christos Exp $	*/
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.116 2012/07/28 23:11:01 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.117 2014/03/26 17:38:09 christos Exp $");
 
 #include 
 #include 
@@ -166,17 +166,17 @@ model_init(void)
 		}
 
 		/* init frame buffer mode */
-		sprintf(buf, "%x vesa-set-mode", mode);
+		snprintf(buf, sizeof(buf), "%x vesa-set-mode", mode);
 		OF_interpret(buf, 0, 0);
 
 		/* set dimensions and frame buffer address in OFW */
-		sprintf(buf, "%x to screen-width", width);
+		snprintf(buf, sizeof(buf), "%x to screen-width", width);
 		OF_interpret(buf, 0, 0);
-		sprintf(buf, "%x to screen-height", height);
+		snprintf(buf, sizeof(buf), "%x to screen-height", height);
 		OF_interpret(buf, 0, 0);
 		OF_interpret("vesa-frame-buffer-adr", 0, 1, &fbaddr);
 		if (fbaddr != 0) {
-			sprintf(buf, "%x to frame-buffer-adr", fbaddr);
+			snprintf(buf, sizeof(buf), "%x to frame-buffer-adr", fbaddr);
 			OF_interpret(buf, 0, 0);
 		}
 	}



CVS commit: src/sys/arch/sandpoint

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:35:08 UTC 2014

Modified Files:
src/sys/arch/sandpoint/pci: pci_machdep.c
src/sys/arch/sandpoint/stand/altboot: main.c

Log Message:
fix sprintf.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sandpoint/pci/pci_machdep.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sandpoint/stand/altboot/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sandpoint/pci/pci_machdep.c
diff -u src/sys/arch/sandpoint/pci/pci_machdep.c:1.31 src/sys/arch/sandpoint/pci/pci_machdep.c:1.32
--- src/sys/arch/sandpoint/pci/pci_machdep.c:1.31	Wed Dec 28 15:33:20 2011
+++ src/sys/arch/sandpoint/pci/pci_machdep.c	Wed Mar 26 13:35:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.31 2011/12/28 20:33:20 phx Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.32 2014/03/26 17:35:08 christos Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.31 2011/12/28 20:33:20 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.32 2014/03/26 17:35:08 christos Exp $");
 
 #include "opt_pci.h"
 
@@ -393,7 +393,7 @@ pci_intr_string(pci_chipset_tag_t pc, pc
 	if (ih < 0 || ih >= OPENPIC_ICU)
 		panic("pci_intr_string: bogus handle 0x%x", ih);
 
-	sprintf(irqstr, "irq %d", ih + I8259_ICU);
+	snprintf(irqstr, sizeof(irqstr), "irq %d", ih + I8259_ICU);
 	return irqstr;
 	
 }

Index: src/sys/arch/sandpoint/stand/altboot/main.c
diff -u src/sys/arch/sandpoint/stand/altboot/main.c:1.24 src/sys/arch/sandpoint/stand/altboot/main.c:1.25
--- src/sys/arch/sandpoint/stand/altboot/main.c:1.24	Sat Mar 22 14:54:28 2014
+++ src/sys/arch/sandpoint/stand/altboot/main.c	Wed Mar 26 13:35:08 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.24 2014/03/22 18:54:28 jakllsch Exp $ */
+/* $NetBSD: main.c,v 1.25 2014/03/26 17:35:08 christos Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -287,16 +287,17 @@ main(int argc, char *argv[], char *boota
 	 * which have valid disklabels.
 	 */
 	if (n >= argc) {
+		static const size_t blen = sizeof("wdN:");
 		n = 0;
 		argc = 0;
-		argv = alloc(MAX_UNITS * (sizeof(char *) + sizeof("wdN:")));
+		argv = alloc(MAX_UNITS * (sizeof(char *) + blen));
 		bname = (char *)(argv + MAX_UNITS);
 		for (i = 0; i < MAX_UNITS; i++) {
 			if (!dlabel_valid(i))
 continue;
-			sprintf(bname, "wd%d:", i);
+			snprintf(bname, blen, "wd%d:", i);
 			argv[argc++] = bname;
-			bname += sizeof("wdN:");
+			bname += blen;
 		}
 		/* use default drive if no valid disklabel is found */
 		if (argc == 0) {



CVS commit: src/sys/arch/sparc/sparc

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:31:13 UTC 2014

Modified Files:
src/sys/arch/sparc/sparc: autoconf.c

Log Message:
return something


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/sys/arch/sparc/sparc/autoconf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc/sparc/autoconf.c
diff -u src/sys/arch/sparc/sparc/autoconf.c:1.254 src/sys/arch/sparc/sparc/autoconf.c:1.255
--- src/sys/arch/sparc/sparc/autoconf.c:1.254	Wed Mar 26 13:29:21 2014
+++ src/sys/arch/sparc/sparc/autoconf.c	Wed Mar 26 13:31:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.254 2014/03/26 17:29:21 christos Exp $ */
+/*	$NetBSD: autoconf.c,v 1.255 2014/03/26 17:31:13 christos Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.254 2014/03/26 17:29:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.255 2014/03/26 17:31:13 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1036,6 +1036,7 @@ clockfreq(int freq)
 	static char buf[10];
 
 	humanize_number(buf, sizeof(buf), freq / 1000, "", 1000);
+	return buf;
 }
 
 /* ARGSUSED */



CVS commit: src/sys/arch

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:29:21 UTC 2014

Modified Files:
src/sys/arch/sparc/sparc: autoconf.c
src/sys/arch/sparc64/sparc64: autoconf.c

Log Message:
use humanize_number per gimpy.


To generate a diff of this commit:
cvs rdiff -u -r1.253 -r1.254 src/sys/arch/sparc/sparc/autoconf.c
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/sparc64/sparc64/autoconf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc/sparc/autoconf.c
diff -u src/sys/arch/sparc/sparc/autoconf.c:1.253 src/sys/arch/sparc/sparc/autoconf.c:1.254
--- src/sys/arch/sparc/sparc/autoconf.c:1.253	Wed Mar 26 13:17:22 2014
+++ src/sys/arch/sparc/sparc/autoconf.c	Wed Mar 26 13:29:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.253 2014/03/26 17:17:22 christos Exp $ */
+/*	$NetBSD: autoconf.c,v 1.254 2014/03/26 17:29:21 christos Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.253 2014/03/26 17:17:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.254 2014/03/26 17:29:21 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1034,14 +1034,8 @@ char *
 clockfreq(int freq)
 {
 	static char buf[10];
-	size_t len;
 
-	freq /= 1000;
-	len = snprintf(buf, sizeof(buf), "%d", freq / 1000);
-	freq %= 1000;
-	if (freq)
-		snprintf(buf + len, sizeof(buf) - len, ".%03d", freq);
-	return buf;
+	humanize_number(buf, sizeof(buf), freq / 1000, "", 1000);
 }
 
 /* ARGSUSED */

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.196 src/sys/arch/sparc64/sparc64/autoconf.c:1.197
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.196	Wed Mar 26 13:17:22 2014
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Wed Mar 26 13:29:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.196 2014/03/26 17:17:22 christos Exp $ */
+/*	$NetBSD: autoconf.c,v 1.197 2014/03/26 17:29:21 christos Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.196 2014/03/26 17:17:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.197 2014/03/26 17:29:21 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -510,15 +510,10 @@ cpu_rootconf(void)
 char *
 clockfreq(long freq)
 {
-	static char sbuf[10];
-	size_t len;
+	static char buf[10];
 
-	freq /= 1000;
-	len = snprintf(sbuf, sizeof(sbuf), "%ld", freq / 1000);
-	freq %= 1000;
-	if (freq)
-		snprintf(sbuf + len, sizeof(sbuf) - len, ".%03ld", freq);
-	return sbuf;
+	humanize_number(buf, sizeof(buf), freq / 1000, "", 1000);
+	return buf;
 }
 
 /* ARGSUSED */



CVS commit: src/sys/arch

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:17:22 UTC 2014

Modified Files:
src/sys/arch/sparc/sparc: autoconf.c
src/sys/arch/sparc64/sparc64: autoconf.c

Log Message:
fix fraction part of printing (from apb)


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/arch/sparc/sparc/autoconf.c
cvs rdiff -u -r1.195 -r1.196 src/sys/arch/sparc64/sparc64/autoconf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc/sparc/autoconf.c
diff -u src/sys/arch/sparc/sparc/autoconf.c:1.252 src/sys/arch/sparc/sparc/autoconf.c:1.253
--- src/sys/arch/sparc/sparc/autoconf.c:1.252	Wed Mar 26 11:55:31 2014
+++ src/sys/arch/sparc/sparc/autoconf.c	Wed Mar 26 13:17:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.252 2014/03/26 15:55:31 christos Exp $ */
+/*	$NetBSD: autoconf.c,v 1.253 2014/03/26 17:17:22 christos Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.252 2014/03/26 15:55:31 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.253 2014/03/26 17:17:22 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1039,11 +1039,9 @@ clockfreq(int freq)
 	freq /= 1000;
 	len = snprintf(buf, sizeof(buf), "%d", freq / 1000);
 	freq %= 1000;
-	if (freq) {
-		freq += 1000;	/* now in 1000..1999 */
-		snprintf(buf + len, sizeof(buf) - len, ".%d", freq);
-	}
-	return (buf);
+	if (freq)
+		snprintf(buf + len, sizeof(buf) - len, ".%03d", freq);
+	return buf;
 }
 
 /* ARGSUSED */

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.195 src/sys/arch/sparc64/sparc64/autoconf.c:1.196
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.195	Wed Mar 26 11:55:31 2014
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Wed Mar 26 13:17:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.195 2014/03/26 15:55:31 christos Exp $ */
+/*	$NetBSD: autoconf.c,v 1.196 2014/03/26 17:17:22 christos Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.195 2014/03/26 15:55:31 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.196 2014/03/26 17:17:22 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -516,11 +516,9 @@ clockfreq(long freq)
 	freq /= 1000;
 	len = snprintf(sbuf, sizeof(sbuf), "%ld", freq / 1000);
 	freq %= 1000;
-	if (freq) {
-		freq += 1000;	/* now in 1000..1999 */
-		snprintf(sbuf + len, sizeof(sbuf) - len, ".%ld", freq);
-	}
-	return (sbuf);
+	if (freq)
+		snprintf(sbuf + len, sizeof(sbuf) - len, ".%03ld", freq);
+	return sbuf;
 }
 
 /* ARGSUSED */



CVS commit: src/sys/external/bsd/vchiq/dist/interface/compat

2014-03-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Mar 26 16:44:41 UTC 2014

Modified Files:
src/sys/external/bsd/vchiq/dist/interface/compat: vchi_bsd.h

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h
diff -u src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h:1.4 src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h:1.5
--- src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h:1.4	Thu Sep 19 14:43:39 2013
+++ src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h	Wed Mar 26 16:44:41 2014
@@ -315,7 +315,8 @@ MALLOC_DECLARE(M_VCHI);
  */
 #if 1
 /* emulate jiffies */
-static inline unsigned long _jiffies(void)
+static inline unsigned long
+_jiffies(void)
 {
 	struct timeval tv;
 
@@ -323,7 +324,8 @@ static inline unsigned long _jiffies(voi
 	return tvtohz(&tv);
 }
 
-static inline unsigned long msecs_to_jiffies(unsigned long msecs)
+static inline unsigned long
+msecs_to_jiffies(unsigned long msecs)
 {
 	struct timeval tv;
 



CVS commit: src/sys/arch/x68k/x68k

2014-03-26 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed Mar 26 16:21:39 UTC 2014

Modified Files:
src/sys/arch/x68k/x68k: machdep.c

Log Message:
Implement the software power-off (correctly) when RB_POWERDOWN is
specified.  Before this, the kernel doesn't turn off the power in fact,
and thus the power off had happened in IPLROM after software reset.

Many thanks to tsutsui@ on port-x68k.


To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 src/sys/arch/x68k/x68k/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x68k/x68k/machdep.c
diff -u src/sys/arch/x68k/x68k/machdep.c:1.190 src/sys/arch/x68k/x68k/machdep.c:1.191
--- src/sys/arch/x68k/x68k/machdep.c:1.190	Wed Mar 26 08:17:59 2014
+++ src/sys/arch/x68k/x68k/machdep.c	Wed Mar 26 16:21:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.190 2014/03/26 08:17:59 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.191 2014/03/26 16:21:39 isaki Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.190 2014/03/26 08:17:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.191 2014/03/26 16:21:39 isaki Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -513,16 +513,23 @@ cpu_reboot(int howto, char *bootstr)
 	 *	Power cannot be removed; simply halt the system (b)
 	 *	Power switch state is checked in shutdown hook
 	 *  a2: the power switch is off
-	 *	Remove the power; the simplest way is go back to ROM eg. reboot
+	 *	Remove the power
 	 * b) RB_HALT
 	 *	call cngetc
 	 * c) otherwise
 	 *	Reboot
 	 */
-	if (((howto & RB_POWERDOWN) == RB_POWERDOWN) && power_switch_is_off)
-		doboot();
-	else if (/*((howto & RB_POWERDOWN) == RB_POWERDOWN) ||*/
-		 ((howto & RB_HALT) == RB_HALT)) {
+	if (((howto & RB_POWERDOWN) == RB_POWERDOWN) && power_switch_is_off) {
+		printf("powering off...\n");
+		delay(100);
+		intio_set_sysport_powoff(0x00);
+		intio_set_sysport_powoff(0x0f);
+		intio_set_sysport_powoff(0x0f);
+		delay(100);
+		printf("WARNING: powerdown failed\n");
+		delay(100);
+		/* PASSTHROUGH even if came back */
+	} else if ((howto & RB_HALT) == RB_HALT) {
 		printf("System halted.  Hit any key to reboot.\n\n");
 		(void)cngetc();
 	}



CVS commit: src/sys/arch/sgimips

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 16:16:06 UTC 2014

Modified Files:
src/sys/arch/sgimips/mace: pci_mace.c
src/sys/arch/sgimips/sgimips: arcemu.c
src/sys/arch/sgimips/stand/common: boot.c
src/sys/arch/sgimips/stand/sgivol: sgivol.c

Log Message:
kill sprintf.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sgimips/mace/pci_mace.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sgimips/sgimips/arcemu.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/sgimips/stand/common/boot.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/sgimips/stand/sgivol/sgivol.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sgimips/mace/pci_mace.c
diff -u src/sys/arch/sgimips/mace/pci_mace.c:1.15 src/sys/arch/sgimips/mace/pci_mace.c:1.16
--- src/sys/arch/sgimips/mace/pci_mace.c:1.15	Sat Oct 27 13:18:10 2012
+++ src/sys/arch/sgimips/mace/pci_mace.c	Wed Mar 26 12:16:06 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_mace.c,v 1.15 2012/10/27 17:18:10 chs Exp $	*/
+/*	$NetBSD: pci_mace.c,v 1.16 2014/03/26 16:16:06 christos Exp $	*/
 
 /*
  * Copyright (c) 2001,2003 Christopher Sekiya
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_mace.c,v 1.15 2012/10/27 17:18:10 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_mace.c,v 1.16 2014/03/26 16:16:06 christos Exp $");
 
 #include "opt_pci.h"
 #include "pci.h"
@@ -252,7 +252,7 @@ macepci_intr_string(pci_chipset_tag_t pc
 {
 	static char irqstr[32];
 
-	sprintf(irqstr, "crime interrupt %d", ih);
+	snprintf(irqstr, sizeof(irqstr), "crime interrupt %d", ih);
 	return irqstr;
 }
 

Index: src/sys/arch/sgimips/sgimips/arcemu.c
diff -u src/sys/arch/sgimips/sgimips/arcemu.c:1.21 src/sys/arch/sgimips/sgimips/arcemu.c:1.22
--- src/sys/arch/sgimips/sgimips/arcemu.c:1.21	Fri Jul  1 14:54:32 2011
+++ src/sys/arch/sgimips/sgimips/arcemu.c	Wed Mar 26 12:16:06 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: arcemu.c,v 1.21 2011/07/01 18:54:32 dyoung Exp $	*/
+/*	$NetBSD: arcemu.c,v 1.22 2014/03/26 16:16:06 christos Exp $	*/
 
 /*
  * Copyright (c) 2004 Steve Rumble 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arcemu.c,v 1.21 2011/07/01 18:54:32 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arcemu.c,v 1.22 2014/03/26 16:16:06 christos Exp $");
 
 #ifndef _LP64
 
@@ -298,7 +298,7 @@ arcemu_eeprom_read(void)
 	}
 
 	/* cache enaddr string */
-	sprintf(enaddr, "%02x:%02x:%02x:%02x:%02x:%02x",
+	snprintf(enaddr, sizeof(enaddr), "%02x:%02x:%02x:%02x:%02x:%02x",
 	nvram.enaddr[0],
 	nvram.enaddr[1],
 	nvram.enaddr[2],

Index: src/sys/arch/sgimips/stand/common/boot.c
diff -u src/sys/arch/sgimips/stand/common/boot.c:1.19 src/sys/arch/sgimips/stand/common/boot.c:1.20
--- src/sys/arch/sgimips/stand/common/boot.c:1.19	Sun Feb 20 02:59:52 2011
+++ src/sys/arch/sgimips/stand/common/boot.c	Wed Mar 26 12:16:06 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.19 2011/02/20 07:59:52 matt Exp $	*/
+/*	$NetBSD: boot.c,v 1.20 2014/03/26 16:16:06 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -160,14 +160,16 @@ main(int argc, char **argv)
 	 */
 
 	if (strstr(argv[0], "cdrom(")) {
+		char *ep =
 		strcpy(bootfile, argv[0]);
-		i = (strrchr(bootfile, ')') - bootfile);
+		ep = strrchr(bootfile, ')');
+		i =  ep - bootfile;
 		bootfile[i - 1] = '0';
 		if (strstr(bootfile, "ip3x"))
 			kernel = "ip3x";
 		else
 			kernel = "ip2x";
-		sprintf((strrchr(bootfile, ')') + 1), kernel);
+		strcpy(ep + 1, kernel);
 		if ((loadfile(bootfile, marks, LOAD_KERNEL)) >= 0)
 			goto finish;
 	}

Index: src/sys/arch/sgimips/stand/sgivol/sgivol.c
diff -u src/sys/arch/sgimips/stand/sgivol/sgivol.c:1.19 src/sys/arch/sgimips/stand/sgivol/sgivol.c:1.20
--- src/sys/arch/sgimips/stand/sgivol/sgivol.c:1.19	Thu Jun 27 17:24:08 2013
+++ src/sys/arch/sgimips/stand/sgivol/sgivol.c	Wed Mar 26 12:16:06 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sgivol.c,v 1.19 2013/06/27 21:24:08 christos Exp $	*/
+/*	$NetBSD: sgivol.c,v 1.20 2014/03/26 16:16:06 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -206,7 +206,8 @@ main(int argc, char *argv[])
 		perror("File open");
 		exit(1);
 #else
-		sprintf((char *)buf, "/dev/r%s%c", argv[0], 'a' + getrawpartition());
+		snprintf(buf, sizeof(buf), "/dev/r%s%c", argv[0],
+		'a' + getrawpartition());
 		fd = open((char *)buf, (opt_i | opt_w | opt_d | opt_p) 
 ? O_RDWR : O_RDONLY);
 		if (fd < 0) {



CVS commit: src/sys/arch/emips/stand/common

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 16:10:20 UTC 2014

Modified Files:
src/sys/arch/emips/stand/common: boot.c

Log Message:
fix sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/stand/common/boot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/emips/stand/common/boot.c
diff -u src/sys/arch/emips/stand/common/boot.c:1.2 src/sys/arch/emips/stand/common/boot.c:1.3
--- src/sys/arch/emips/stand/common/boot.c:1.2	Mon Feb 24 02:46:33 2014
+++ src/sys/arch/emips/stand/common/boot.c	Wed Mar 26 12:10:20 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.2 2014/02/24 07:46:33 martin Exp $	*/
+/*	$NetBSD: boot.c,v 1.3 2014/03/26 16:10:20 christos Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -320,7 +320,7 @@ devcanon(char *fname)
 
 	/* Copy kernel name before we overwrite, then do it */
 	strcpy(file_name, (*cp) ? cp : kernelnames[0]);
-	sprintf(fname,"%c/%s(%c,%c)/%s",
+	snprintf(fname, PATH_MAX, "%c/%s(%c,%c)/%s",
 	ctlr + '0', device_name, unit + '0', part + '0', file_name);
 
 	//printf("devcanon -> %s\n",fname);



CVS commit: src/sys/arch/dreamcast/dev

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 16:08:45 UTC 2014

Modified Files:
src/sys/arch/dreamcast/dev: pvr.c
src/sys/arch/dreamcast/dev/maple: maple.c mlcd.c mmemcard.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/dreamcast/dev/pvr.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/dreamcast/dev/maple/maple.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/dreamcast/dev/maple/mlcd.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/dreamcast/dev/maple/mmemcard.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/dreamcast/dev/pvr.c
diff -u src/sys/arch/dreamcast/dev/pvr.c:1.34 src/sys/arch/dreamcast/dev/pvr.c:1.35
--- src/sys/arch/dreamcast/dev/pvr.c:1.34	Wed Jan 11 16:17:33 2012
+++ src/sys/arch/dreamcast/dev/pvr.c	Wed Mar 26 12:08:45 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pvr.c,v 1.34 2012/01/11 21:17:33 macallan Exp $	*/
+/*	$NetBSD: pvr.c,v 1.35 2014/03/26 16:08:45 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001 Marcus Comstedt.
@@ -35,7 +35,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pvr.c,v 1.34 2012/01/11 21:17:33 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pvr.c,v 1.35 2014/03/26 16:08:45 christos Exp $");
 
 #include 
 #include 
@@ -260,7 +260,7 @@ pvr_getdevconfig(struct fb_devconfig *dc
 	dc->dc_wsscrdescr.textops = &dc->dc_rinfo.ri_ops;
 	dc->dc_wsscrdescr.capabilities = dc->dc_rinfo.ri_caps;
 
-	sprintf(dc->dc_wsscrname, "%dx%d",
+	snprintf(dc->dc_wsscrname, sizeof(dc->dc_wsscrname), "%dx%d",
 	dc->dc_wsscrdescr.ncols, dc->dc_wsscrdescr.nrows);
 }
 

Index: src/sys/arch/dreamcast/dev/maple/maple.c
diff -u src/sys/arch/dreamcast/dev/maple/maple.c:1.48 src/sys/arch/dreamcast/dev/maple/maple.c:1.49
--- src/sys/arch/dreamcast/dev/maple/maple.c:1.48	Sun Mar 16 01:20:23 2014
+++ src/sys/arch/dreamcast/dev/maple/maple.c	Wed Mar 26 12:08:45 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: maple.c,v 1.48 2014/03/16 05:20:23 dholland Exp $	*/
+/*	$NetBSD: maple.c,v 1.49 2014/03/26 16:08:45 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: maple.c,v 1.48 2014/03/16 05:20:23 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: maple.c,v 1.49 2014/03/26 16:08:45 christos Exp $");
 
 #include 
 #include 
@@ -111,7 +111,7 @@ __KERNEL_RCSID(0, "$NetBSD: maple.c,v 1.
 static int	maplematch(device_t, cfdata_t, void *);
 static void	mapleattach(device_t, device_t, void *);
 static void	maple_scanbus(struct maple_softc *);
-static char *	maple_unit_name(char *, int port, int subunit);
+static char *	maple_unit_name(char *, size_t, int port, int subunit);
 static void	maple_begin_txbuf(struct maple_softc *);
 static int	maple_end_txbuf(struct maple_softc *);
 static void	maple_queue_command(struct maple_softc *, struct maple_unit *,
@@ -280,7 +280,7 @@ maple_scanbus(struct maple_softc *sc)
 		{
 			char buf[16];
 			printf("%s: queued to probe 1\n",
-			maple_unit_name(buf, u->port, u->subunit));
+			maple_unit_name(buf, sizeof(buf), u->port, u->subunit));
 		}
 #endif
 		TAILQ_INSERT_TAIL(&sc->sc_probeq, u, u_q);
@@ -351,12 +351,11 @@ maple_run_polling(device_t dev)
 }
 
 static char *
-maple_unit_name(char *buf, int port, int subunit)
+maple_unit_name(char *buf, size_t len, int port, int subunit)
 {
-
-	sprintf(buf, "maple%c", port + 'A');
+	int l = snprintf(buf, len, "maple%c", port + 'A');
 	if (subunit)
-		sprintf(buf+6, "%d", subunit);
+		snprintf(buf + l, len - l, "%d", subunit);
 
 	return buf;
 }
@@ -472,8 +471,8 @@ maple_write_command(struct maple_softc *
 	char buf[16];
 
 	if (u->u_retrycnt)
-		printf("%s: retrycnt %d\n",
-		maple_unit_name(buf, u->port, u->subunit), u->u_retrycnt);
+		printf("%s: retrycnt %d\n", maple_unit_name(buf, sizeof(buf),
+		u->port, u->subunit), u->u_retrycnt);
 #endif
 	u->u_retrycnt = 0;
 	u->u_command = command;
@@ -524,7 +523,7 @@ maple_check_subunit_change(struct maple_
 	{
 		char buf[16];
 		printf("%s: unit_map 0x%x -> 0x%x (units 0x%x)\n",
-		maple_unit_name(buf, u->port, u->subunit),
+		maple_unit_name(buf, sizeof(buf), u->port, u->subunit),
 		sc->sc_port_unit_map[port], unit_map, units);
 	}
 #endif
@@ -550,7 +549,8 @@ maple_check_subunit_change(struct maple_
 			{
 char buf[16];
 printf("%s: queued to probe 2\n",
-maple_unit_name(buf, u1->port, u1->subunit));
+maple_unit_name(buf, sizeof(buf),
+u1->port, u1->subunit));
 			}
 #endif
 			TAILQ_INSERT_HEAD(&sc->sc_probeq, u1, u_q);
@@ -579,7 +579,7 @@ out:
 	{
 		char buf[16];
 		printf("%s: queued to ping\n",
-		maple_unit_name(buf, u->port, u->subunit));
+		maple_unit_name(buf, sizeof(buf), u->port, u->subunit));
 	}
 #endif
 	TAILQ_INSERT_TAIL(&sc->sc_pingq, u, u_q);
@@ -598,7 +598,8 @@ maple_print_unit(void *aux, const char *
 	subunit = ma->ma_unit->subun

CVS commit: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm

2014-03-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Mar 26 16:07:15 UTC 2014

Modified Files:
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm: vchiq_2835_arm.c

Log Message:
Correct some bus_dma operations.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c
diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c:1.9 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c:1.10
--- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c:1.9	Sun Apr 28 20:57:26 2013
+++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c	Wed Mar 26 16:07:15 2014
@@ -100,7 +100,7 @@ vchiq_platform_init(VCHIQ_STATE_T *state
 	dma_nsegs = __arraycount(dma_segs);
 	err = bus_dmamem_alloc(&bcm2835_bus_dma_tag,
 	g_slot_mem_size + frag_mem_size, PAGE_SIZE, 0,
-	dma_segs, dma_nsegs, &dma_nsegs, BUS_DMA_COHERENT | BUS_DMA_WAITOK);
+	dma_segs, dma_nsegs, &dma_nsegs, BUS_DMA_WAITOK);
 	if (err) {
 		vchiq_log_error(vchiq_core_log_level, "Unable to allocate channel memory");
 		err = -ENOMEM;
@@ -289,7 +289,7 @@ vchiq_prepare_bulk_data(VCHIQ_BULK_T *bu
 		goto fail1;
 
 	ret = bus_dmamem_map(&bcm2835_bus_dma_tag, bi->pagelist_sgs, nsegs,
-	bi->pagelist_size, &bi->pagelist, BUS_DMA_WAITOK);
+	bi->pagelist_size, &bi->pagelist, BUS_DMA_COHERENT | BUS_DMA_WAITOK);
 	if (ret != 0)
 		goto fail2;
 
@@ -378,7 +378,7 @@ vchiq_prepare_bulk_data(VCHIQ_BULK_T *bu
 	bulk->remote_data = bi;
 
 	bus_dmamap_sync(&bcm2835_bus_dma_tag, bi->pagelist_map, 0,
-	bi->pagelist_size, BUS_DMASYNC_PREREAD);
+	bi->pagelist_size, BUS_DMASYNC_PREWRITE);
 
 	bus_dmamap_sync(&bcm2835_bus_dma_tag, bi->dmamap, 0, bi->size,
 	pagelist->type == PAGELIST_WRITE ?
@@ -420,6 +420,13 @@ vchiq_complete_bulk(VCHIQ_BULK_T *bulk)
 		BULKINFO_T *bi = bulk->remote_data;
 		PAGELIST_T *pagelist = bi->pagelist;
 
+		bus_dmamap_sync(&bcm2835_bus_dma_tag, bi->pagelist_map, 0,
+		bi->pagelist_size, BUS_DMASYNC_POSTWRITE);
+
+		bus_dmamap_sync(&bcm2835_bus_dma_tag, bi->dmamap, 0, bi->size,
+		pagelist->type == PAGELIST_WRITE ?
+		BUS_DMASYNC_POSTWRITE : BUS_DMASYNC_POSTREAD);
+
 		/* Deal with any partial cache lines (fragments) */
 		if (pagelist->type >= PAGELIST_READ_WITH_FRAGMENTS) {
 			FRAGMENTS_T *fragments = g_fragments_base +
@@ -469,13 +476,6 @@ vchiq_complete_bulk(VCHIQ_BULK_T *bulk)
 			up(&g_free_fragments_mutex);
 			up(&g_free_fragments_sema);
 		}
-		bus_dmamap_sync(&bcm2835_bus_dma_tag, bi->pagelist_map, 0,
-		bi->pagelist_size, BUS_DMASYNC_POSTREAD);
-
-		bus_dmamap_sync(&bcm2835_bus_dma_tag, bi->dmamap, 0, bi->size,
-		pagelist->type == PAGELIST_WRITE ?
-		BUS_DMASYNC_POSTWRITE : BUS_DMASYNC_POSTREAD);
-
 		bus_dmamap_unload(&bcm2835_bus_dma_tag, bi->dmamap);
 		bus_dmamap_destroy(&bcm2835_bus_dma_tag, bi->dmamap);
 		if (IS_USER_ADDRESS(bi->buf))



CVS commit: src/sys/arch/prep

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 16:01:43 UTC 2014

Modified Files:
src/sys/arch/prep/pci: pci_machdep.c
src/sys/arch/prep/prep: ibm_machdep.c platform.c residual.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/prep/pci/pci_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/prep/prep/ibm_machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/prep/prep/platform.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/prep/prep/residual.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/prep/pci/pci_machdep.c
diff -u src/sys/arch/prep/pci/pci_machdep.c:1.38 src/sys/arch/prep/pci/pci_machdep.c:1.39
--- src/sys/arch/prep/pci/pci_machdep.c:1.38	Thu Oct 13 15:51:17 2011
+++ src/sys/arch/prep/pci/pci_machdep.c	Wed Mar 26 12:01:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.38 2011/10/13 19:51:17 matt Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.39 2014/03/26 16:01:43 christos Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.38 2011/10/13 19:51:17 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.39 2014/03/26 16:01:43 christos Exp $");
 
 #include 
 #include 
@@ -208,11 +208,11 @@ prep_pci_intr_map(const struct pci_attac
 		goto bad;
 	}
 
-	sprintf(key, "devfunc-%d", dev);
+	snprintf(key, sizeof(key), "devfunc-%d", dev);
 	devsub = prop_dictionary_get(dict, key);
 	if (devsub == NULL)
 		goto bad;
-	sprintf(key, "pin-%c", 'A' + (pin-1));
+	snprintf(key, sizeof(key), "pin-%c", 'A' + (pin-1));
 	pinsub = prop_dictionary_get(devsub, key);
 	if (pinsub == NULL)
 		goto bad;

Index: src/sys/arch/prep/prep/ibm_machdep.c
diff -u src/sys/arch/prep/prep/ibm_machdep.c:1.15 src/sys/arch/prep/prep/ibm_machdep.c:1.16
--- src/sys/arch/prep/prep/ibm_machdep.c:1.15	Mon Apr 28 16:23:33 2008
+++ src/sys/arch/prep/prep/ibm_machdep.c	Wed Mar 26 12:01:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibm_machdep.c,v 1.15 2008/04/28 20:23:33 martin Exp $	*/
+/*	$NetBSD: ibm_machdep.c,v 1.16 2014/03/26 16:01:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@ pci_intr_fixup_ibm_6015(void)
 
 	intr_num = prop_number_create_integer(13);
 	for (j = 0; j < 4; j++) {
-		sprintf(key, "pin-%c", 'A' + j);
+		snprintf(key, sizeof(key), "pin-%c", 'A' + j);
 		prop_dictionary_set(sub, key, intr_num);
 	}
 	prop_object_release(intr_num);
@@ -71,9 +71,9 @@ pci_intr_fixup_ibm_6015(void)
 	for (i = 13; i < 20; i++) {
 		sub = prop_dictionary_create_with_capacity(4);
 		intr_num = prop_number_create_integer(15);
-		sprintf(key, "devfunc-%d", i);
+		snprintf(key, sizeof(key), "devfunc-%d", i);
 		for (j = 0; j < 4; j++) {
-			sprintf(key, "pin-%c", 'A' + j);
+			snprintf(key, sizeof(key), "pin-%c", 'A' + j);
 			prop_dictionary_set(sub, key, intr_num);
 		}
 		prop_dictionary_set(dict, key, sub);

Index: src/sys/arch/prep/prep/platform.c
diff -u src/sys/arch/prep/prep/platform.c:1.26 src/sys/arch/prep/prep/platform.c:1.27
--- src/sys/arch/prep/prep/platform.c:1.26	Mon Jun 20 03:18:07 2011
+++ src/sys/arch/prep/prep/platform.c	Wed Mar 26 12:01:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: platform.c,v 1.26 2011/06/20 07:18:07 matt Exp $	*/
+/*	$NetBSD: platform.c,v 1.27 2014/03/26 16:01:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.26 2011/06/20 07:18:07 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.27 2014/03/26 16:01:43 christos Exp $");
 
 #include 
 #include 
@@ -266,11 +266,11 @@ create_intr_map(void *v, prop_dictionary
 			else
 intr_num = prop_number_create_integer(
 (line & 0x7fff) + offset);
-			sprintf(key, "pin-%c", 'A' + j);
+			snprintf(key, sizeof(key), "pin-%c", 'A' + j);
 			prop_dictionary_set(sub, key, intr_num);
 			prop_object_release(intr_num);
 		}
-		sprintf(key, "devfunc-%d", dev);
+		snprintf(key, sizeof(key), "devfunc-%d", dev);
 		prop_dictionary_set(dict, key, sub);
 		prop_object_release(sub);
 	}

Index: src/sys/arch/prep/prep/residual.c
diff -u src/sys/arch/prep/prep/residual.c:1.16 src/sys/arch/prep/prep/residual.c:1.17
--- src/sys/arch/prep/prep/residual.c:1.16	Mon Apr 28 16:23:33 2008
+++ src/sys/arch/prep/prep/residual.c	Wed Mar 26 12:01:43 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: residual.c,v 1.16 2008/04/28 20:23:33 martin Exp $ */
+/*  $NetBSD: residual.c,v 1.17 2014/03/26 16:01:43 christos Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: residual.c,v 1.16 2008/04/28 20:23:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: residual.c,v 1.17 2014/03/26 16:01:43 christos Exp $");
 
 #include 
 #include 
@@ -913,7 +913,7 @@ static void
 large_vendor_pc

CVS commit: src/sys/arch/sparc

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 15:55:44 UTC 2014

Modified Files:
src/sys/arch/sparc/sparc: cpu.c pci_machdep.c promlib.c
src/sys/arch/sparc/stand/common: mmu.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.241 -r1.242 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/sparc/sparc/pci_machdep.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/sparc/sparc/promlib.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc/stand/common/mmu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc/sparc/cpu.c
diff -u src/sys/arch/sparc/sparc/cpu.c:1.241 src/sys/arch/sparc/sparc/cpu.c:1.242
--- src/sys/arch/sparc/sparc/cpu.c:1.241	Mon Mar 24 16:06:32 2014
+++ src/sys/arch/sparc/sparc/cpu.c	Wed Mar 26 11:55:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.241 2014/03/24 20:06:32 christos Exp $ */
+/*	$NetBSD: cpu.c,v 1.242 2014/03/26 15:55:43 christos Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.241 2014/03/24 20:06:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.242 2014/03/26 15:55:43 christos Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_lockdebug.h"
@@ -954,7 +954,8 @@ fpu_init(struct cpu_info *sc)
 	sc->fpupresent = 1;
 	sc->fpu_name = fsrtoname(sc->cpu_impl, sc->cpu_vers, fpuvers);
 	if (sc->fpu_name == NULL) {
-		sprintf(sc->fpu_namebuf, "version 0x%x", fpuvers);
+		snprintf(sc->fpu_namebuf, sizeof(sc->fpu_namebuf),
+		"version 0x%x", fpuvers);
 		sc->fpu_name = sc->fpu_namebuf;
 	}
 }

Index: src/sys/arch/sparc/sparc/pci_machdep.c
diff -u src/sys/arch/sparc/sparc/pci_machdep.c:1.18 src/sys/arch/sparc/sparc/pci_machdep.c:1.19
--- src/sys/arch/sparc/sparc/pci_machdep.c:1.18	Tue Apr 16 02:57:06 2013
+++ src/sys/arch/sparc/sparc/pci_machdep.c	Wed Mar 26 11:55:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.18 2013/04/16 06:57:06 jdc Exp $ */
+/*	$NetBSD: pci_machdep.c,v 1.19 2014/03/26 15:55:43 christos Exp $ */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.18 2013/04/16 06:57:06 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.19 2014/03/26 15:55:43 christos Exp $");
 
 #if defined(DEBUG) && !defined(SPARC_PCI_DEBUG)
 #define SPARC_PCI_DEBUG
@@ -496,7 +496,7 @@ pci_intr_string(pci_chipset_tag_t pc, pc
 	int pil;
 
 	pil = mspcic_assigned_interrupt(ih);
-	sprintf(str, "line %d (pil %d)", ih, pil);
+	snprintf(str, sizeof(str), "line %d (pil %d)", ih, pil);
 	return str;
 }
 

Index: src/sys/arch/sparc/sparc/promlib.c
diff -u src/sys/arch/sparc/sparc/promlib.c:1.43 src/sys/arch/sparc/sparc/promlib.c:1.44
--- src/sys/arch/sparc/sparc/promlib.c:1.43	Sun Jul 17 16:54:47 2011
+++ src/sys/arch/sparc/sparc/promlib.c	Wed Mar 26 11:55:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: promlib.c,v 1.43 2011/07/17 20:54:47 joerg Exp $ */
+/*	$NetBSD: promlib.c,v 1.44 2014/03/26 15:55:43 christos Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: promlib.c,v 1.43 2011/07/17 20:54:47 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: promlib.c,v 1.44 2014/03/26 15:55:43 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_sparc_arch.h"
@@ -149,8 +149,9 @@ notimplemented(void)
 	char str[64];
 	int n;
 
-	n = sprintf(str, "Operation not implemented on ROM version %d\r\n",
-		promops.po_version);
+	n = snprintf(str, sizeof(str),
+	"Operation not implemented on ROM version %d\r\n",
+	promops.po_version);
 
 	/*
 	 * Use PROM vector directly, in case we're called before prom_init().

Index: src/sys/arch/sparc/stand/common/mmu.c
diff -u src/sys/arch/sparc/stand/common/mmu.c:1.8 src/sys/arch/sparc/stand/common/mmu.c:1.9
--- src/sys/arch/sparc/stand/common/mmu.c:1.8	Mon Apr 28 16:23:36 2008
+++ src/sys/arch/sparc/stand/common/mmu.c	Wed Mar 26 11:55:44 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mmu.c,v 1.8 2008/04/28 20:23:36 martin Exp $	*/
+/*	$NetBSD: mmu.c,v 1.9 2014/03/26 15:55:44 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@ int mmu_init(void)
 		char buf[32];
 		pmap_map = pmap_map_srmmu;
 		pmap_extract = pmap_extract_srmmu;
-		sprintf(buf, "obmem %lx L!", (u_long)&obmem);
+		snprintf(buf, sizeof(buf), "obmem %lx L!", (u_long)&obmem);
 		prom_interpret(buf);
 	} else
 		return (ENOTSUP);
@@ -143,7 +143,8 @@ int pmap_map_srmmu(vaddr_t va, paddr_t p
 {
 	char buf[64];
 
-	sprintf(buf, "%lx %x %lx %lx map-pages", pa, obmem, va, size);
+	snprintf(buf, sizeof(buf), "%lx %x %lx %lx map-pages",
+	pa, obmem, va, size);
 
 	if (boothowto & AB_VERBOSE)
 		printf("Mapping kernel: %s\n", buf);
@@ -158,7 +159,7 @@ int pmap_extract_srmmu(vaddr_t va, paddr
 	u_int pte;
 
 	va &= -NBPG;
-	sprintf(buf, "%lx pgmap@ %lx L!", va, (u_lon

CVS commit: src/sys/arch

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 15:55:31 UTC 2014

Modified Files:
src/sys/arch/sparc/sparc: autoconf.c
src/sys/arch/sparc64/sparc64: autoconf.c

Log Message:
simplify snprintf.


To generate a diff of this commit:
cvs rdiff -u -r1.251 -r1.252 src/sys/arch/sparc/sparc/autoconf.c
cvs rdiff -u -r1.194 -r1.195 src/sys/arch/sparc64/sparc64/autoconf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc/sparc/autoconf.c
diff -u src/sys/arch/sparc/sparc/autoconf.c:1.251 src/sys/arch/sparc/sparc/autoconf.c:1.252
--- src/sys/arch/sparc/sparc/autoconf.c:1.251	Tue Apr 16 02:57:06 2013
+++ src/sys/arch/sparc/sparc/autoconf.c	Wed Mar 26 11:55:31 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.251 2013/04/16 06:57:06 jdc Exp $ */
+/*	$NetBSD: autoconf.c,v 1.252 2014/03/26 15:55:31 christos Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.251 2013/04/16 06:57:06 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.252 2014/03/26 15:55:31 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -673,9 +673,11 @@ bootpath_fake(struct bootpath *bp, const
 			} else {
 BP_APPEND(bp, "vme", -1, 0, 0);
 			}
-			sprintf(tmpname,"x%cc", cp[1]); /* e.g. `xdc' */
+			/* e.g. `xdc' */
+			snprintf(tmpname, sizeof(tmpname), "x%cc", cp[1]);
 			BP_APPEND(bp, tmpname, -1, v0val[0], 0);
-			sprintf(tmpname,"x%c", cp[1]); /* e.g. `xd' */
+			/* e.g. `xd' */
+			snprintf(tmpname, sizeof(tmpname), "x%c", cp[1]);
 			BP_APPEND(bp, tmpname, v0val[1], v0val[2], 0);
 			return;
 		}
@@ -686,7 +688,7 @@ bootpath_fake(struct bootpath *bp, const
 		 */
 		if ((cp[0] == 'i' || cp[0] == 'l') && cp[1] == 'e')  {
 			BP_APPEND(bp, "obio", -1, 0, 0);
-			sprintf(tmpname,"%c%c", cp[0], cp[1]);
+			snprintf(tmpname, sizeof(tmpname), "%c%c", cp[0], cp[1]);
 			BP_APPEND(bp, tmpname, -1, 0, 0);
 			return;
 		}
@@ -735,7 +737,8 @@ bootpath_fake(struct bootpath *bp, const
 target = v0val[1] >> 2; /* old format */
 lun= v0val[1] & 0x3;
 			}
-			sprintf(tmpname, "%c%c", cp[0], cp[1]);
+			snprintf(tmpname, sizeof(tmpname),
+			"%c%c", cp[0], cp[1]);
 			BP_APPEND(bp, tmpname, target, lun, v0val[2]);
 			return;
 		}
@@ -786,9 +789,9 @@ bootpath_fake(struct bootpath *bp, const
 		BP_APPEND(bp, "sbus", -1, 0, 0);
 		BP_APPEND(bp, "esp", -1, v0val[0], 0);
 		if (cp[1] == 'r')
-			sprintf(tmpname, "cd"); /* netbsd uses 'cd', not 'sr'*/
+			snprintf(tmpname, sizeof(tmpname), "cd"); /* netbsd uses 'cd', not 'sr'*/
 		else
-			sprintf(tmpname,"%c%c", cp[0], cp[1]);
+			snprintf(tmpname, sizeof(tmpname), "%c%c", cp[0], cp[1]);
 		/* XXX - is TARGET/LUN encoded in v0val[1]? */
 		target = v0val[1];
 		lun = 0;
@@ -1030,17 +1033,15 @@ sync_crash(void)
 char *
 clockfreq(int freq)
 {
-	char *p;
 	static char buf[10];
+	size_t len;
 
 	freq /= 1000;
-	sprintf(buf, "%d", freq / 1000);
+	len = snprintf(buf, sizeof(buf), "%d", freq / 1000);
 	freq %= 1000;
 	if (freq) {
 		freq += 1000;	/* now in 1000..1999 */
-		p = buf + strlen(buf);
-		sprintf(p, "%d", freq);
-		*p = '.';	/* now buf = %d.%3d */
+		snprintf(buf + len, sizeof(buf) - len, ".%d", freq);
 	}
 	return (buf);
 }
@@ -1482,11 +1483,11 @@ romgetcursoraddr(int **rowp, int **colp)
 	 * correct cutoff point is unknown, as yet; we use 2.9 here.
 	 */
 	if (prom_version() < 2 || prom_revision() < 0x00020009)
-		sprintf(buf,
+		snprintf(buf, sizeof(buf),
 		"' line# >body >user %lx ! ' column# >body >user %lx !",
 		(u_long)rowp, (u_long)colp);
 	else
-		sprintf(buf,
+		snprintf(buf, sizeof(buf),
 		"stdout @ is my-self addr line# %lx ! addr column# %lx !",
 		(u_long)rowp, (u_long)colp);
 	*rowp = *colp = NULL;

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.194 src/sys/arch/sparc64/sparc64/autoconf.c:1.195
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.194	Wed Mar 26 04:40:58 2014
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Wed Mar 26 11:55:31 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.194 2014/03/26 08:40:58 christos Exp $ */
+/*	$NetBSD: autoconf.c,v 1.195 2014/03/26 15:55:31 christos Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.194 2014/03/26 08:40:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.195 2014/03/26 15:55:31 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -510,7 +510,6 @@ cpu_rootconf(void)
 char *
 clockfreq(long freq)
 {
-	char *p;
 	static char sbuf[10];
 	size_t len;
 
@@ -519,8 +518,7 @@ clockfreq(long freq)
 	freq %= 1000;
 	if (freq) {
 		freq += 1000;	/* now in 1000..1999 */
-		snprintf(sbuf + len, sizeof(sbuf) - len, "%ld", freq);
-		*p = '.';	/* now sbuf = %d.%3d */
+		snprintf(sbuf + len, sizeof(sbuf) - len, ".%ld", freq);
 	}
 	return (sbuf);
 }



CVS commit: src/sys/arch/cobalt/pci

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 15:47:00 UTC 2014

Modified Files:
src/sys/arch/cobalt/pci: pci_machdep.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/cobalt/pci/pci_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/cobalt/pci/pci_machdep.c
diff -u src/sys/arch/cobalt/pci/pci_machdep.c:1.33 src/sys/arch/cobalt/pci/pci_machdep.c:1.34
--- src/sys/arch/cobalt/pci/pci_machdep.c:1.33	Sat Oct 27 13:17:44 2012
+++ src/sys/arch/cobalt/pci/pci_machdep.c	Wed Mar 26 11:47:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.33 2012/10/27 17:17:44 chs Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.34 2014/03/26 15:47:00 christos Exp $	*/
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.33 2012/10/27 17:17:44 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.34 2014/03/26 15:47:00 christos Exp $");
 
 #define _COBALT_BUS_DMA_PRIVATE
 
@@ -188,9 +188,9 @@ pci_intr_string(pci_chipset_tag_t pc, pc
 	static char irqstr[8];
 
 	if (ih >= NICU_INT)
-		sprintf(irqstr, "level %d", ih - NICU_INT);
+		snprintf(irqstr, sizeof(irqstr), "level %d", ih - NICU_INT);
 	else
-		sprintf(irqstr, "irq %d", ih);
+		snprintf(irqstr, sizeof(irqstr), "irq %d", ih);
 
 	return irqstr;
 }



CVS commit: src/sys/arch/arm/omap

2014-03-26 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Mar 26 11:59:05 UTC 2014

Modified Files:
src/sys/arch/arm/omap: ti_iic.c

Log Message:
Add missing 2nd argument to snprintf


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/omap/ti_iic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/omap/ti_iic.c
diff -u src/sys/arch/arm/omap/ti_iic.c:1.6 src/sys/arch/arm/omap/ti_iic.c:1.7
--- src/sys/arch/arm/omap/ti_iic.c:1.6	Wed Mar 26 08:52:00 2014
+++ src/sys/arch/arm/omap/ti_iic.c	Wed Mar 26 11:59:05 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_iic.c,v 1.6 2014/03/26 08:52:00 christos Exp $ */
+/* $NetBSD: ti_iic.c,v 1.7 2014/03/26 11:59:05 ozaki-r Exp $ */
 
 /*
  * Copyright (c) 2013 Manuel Bouyer.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.6 2014/03/26 08:52:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.7 2014/03/26 11:59:05 ozaki-r Exp $");
 
 #include "opt_omap.h"
 #include "locators.h"
@@ -238,7 +238,7 @@ ti_iic_attach(device_t parent, device_t 
 		}
 	}
 	KASSERT(i < __arraycount(am335x_iic));
-	snprintf(buf, "%s_SDA", am335x_iic[i].as_name);
+	snprintf(buf, sizeof(buf), "%s_SDA", am335x_iic[i].as_name);
 	if (sitara_cm_padconf_get(buf, &mode, &state) == 0) {
 		aprint_debug(": SDA mode %s state %d ", mode, state);
 	}



CVS commit: src/sys/arch/arm

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 08:52:00 UTC 2014

Modified Files:
src/sys/arch/arm/at91: at91aic.c
src/sys/arch/arm/ep93xx: ep93xx_intr.c
src/sys/arch/arm/footbridge: footbridge_irqhandler.c footbridge_pci.c
src/sys/arch/arm/footbridge/isa: isa_machdep.c
src/sys/arch/arm/iomd: iomd_irqhandler.c
src/sys/arch/arm/ixp12x0: ixp12x0_intr.c
src/sys/arch/arm/marvell: pci_machdep.c
src/sys/arch/arm/omap: omap_intr.c ti_iic.c
src/sys/arch/arm/s3c2xx0: s3c2xx0_intr.c
src/sys/arch/arm/xscale: ixp425_intr.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/at91/at91aic.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/ep93xx/ep93xx_intr.c
cvs rdiff -u -r1.23 -r1.24 \
src/sys/arch/arm/footbridge/footbridge_irqhandler.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/footbridge/footbridge_pci.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/footbridge/isa/isa_machdep.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/iomd/iomd_irqhandler.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/ixp12x0/ixp12x0_intr.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/marvell/pci_machdep.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/omap/omap_intr.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/omap/ti_iic.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/s3c2xx0/s3c2xx0_intr.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/xscale/ixp425_intr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/at91/at91aic.c
diff -u src/sys/arch/arm/at91/at91aic.c:1.10 src/sys/arch/arm/at91/at91aic.c:1.11
--- src/sys/arch/arm/at91/at91aic.c:1.10	Mon Nov 12 13:00:36 2012
+++ src/sys/arch/arm/at91/at91aic.c	Wed Mar 26 04:51:59 2014
@@ -1,5 +1,5 @@
-/*	$Id: at91aic.c,v 1.10 2012/11/12 18:00:36 skrll Exp $	*/
-/*	$NetBSD: at91aic.c,v 1.10 2012/11/12 18:00:36 skrll Exp $	*/
+/*	$Id: at91aic.c,v 1.11 2014/03/26 08:51:59 christos Exp $	*/
+/*	$NetBSD: at91aic.c,v 1.11 2014/03/26 08:51:59 christos Exp $	*/
 
 /*
  * Copyright (c) 2007 Embedtronics Oy.
@@ -251,7 +251,7 @@ at91aic_init(void)
 		iq = &intrq[i];
 		TAILQ_INIT(&iq->iq_list);
 
-		sprintf(iq->iq_name, "irq %d", i);
+		snprintf(iq->iq_name, sizeof(iq->iq_name), "irq %d", i);
 	}
 
 	/* All interrupts should use IRQ not FIQ */

Index: src/sys/arch/arm/ep93xx/ep93xx_intr.c
diff -u src/sys/arch/arm/ep93xx/ep93xx_intr.c:1.21 src/sys/arch/arm/ep93xx/ep93xx_intr.c:1.22
--- src/sys/arch/arm/ep93xx/ep93xx_intr.c:1.21	Sun Mar  2 08:22:32 2014
+++ src/sys/arch/arm/ep93xx/ep93xx_intr.c	Wed Mar 26 04:51:59 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: ep93xx_intr.c,v 1.21 2014/03/02 13:22:32 joerg Exp $ */
+/* $NetBSD: ep93xx_intr.c,v 1.22 2014/03/26 08:51:59 christos Exp $ */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ep93xx_intr.c,v 1.21 2014/03/02 13:22:32 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ep93xx_intr.c,v 1.22 2014/03/26 08:51:59 christos Exp $");
 
 /*
  * Interrupt support for the Cirrus Logic EP93XX
@@ -255,7 +255,7 @@ ep93xx_intr_init(void)
 		iq = &intrq[i];
 		TAILQ_INIT(&iq->iq_list);
 
-		sprintf(iq->iq_name, "irq %d", i);
+		snprintf(iq->iq_name, sizeof(iq->iq_name), "irq %d", i);
 		evcnt_attach_dynamic(&iq->iq_ev, EVCNT_TYPE_INTR,
  NULL, (i < VIC_NIRQ ? "vic1" : "vic2"),
 		 iq->iq_name);

Index: src/sys/arch/arm/footbridge/footbridge_irqhandler.c
diff -u src/sys/arch/arm/footbridge/footbridge_irqhandler.c:1.23 src/sys/arch/arm/footbridge/footbridge_irqhandler.c:1.24
--- src/sys/arch/arm/footbridge/footbridge_irqhandler.c:1.23	Sun Dec 19 19:25:27 2010
+++ src/sys/arch/arm/footbridge/footbridge_irqhandler.c	Wed Mar 26 04:51:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: footbridge_irqhandler.c,v 1.23 2010/12/20 00:25:27 matt Exp $	*/
+/*	$NetBSD: footbridge_irqhandler.c,v 1.24 2014/03/26 08:51:59 christos Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0,"$NetBSD: footbridge_irqhandler.c,v 1.23 2010/12/20 00:25:27 matt Exp $");
+__KERNEL_RCSID(0,"$NetBSD: footbridge_irqhandler.c,v 1.24 2014/03/26 08:51:59 christos Exp $");
 
 #include "opt_irqstats.h"
 
@@ -196,7 +196,7 @@ footbridge_intr_init(void)
 	for (i = 0, iq = footbridge_intrq; i < NIRQ; i++, iq++) {
 		TAILQ_INIT(&iq->iq_list);
 
-		sprintf(iq->iq_name, "irq %d", i);
+		snprintf(iq->iq_name, sizeof(iq->iq_name), "irq %d", i);
 		evcnt_attach_dynamic(&iq->iq_ev, EVCNT_TYPE_INTR,
 		NULL, "footbridge", iq->iq_name);
 	}

Index: src/sys/arch/arm/footbridge/footbridge_pci.c
diff -u src/sys/arch/arm/footbridge/footbridge_pci.c:1.24 src/sys/arch/arm/footbridge/footbridge_pci.c:1.25
--- src/sys/arch/arm/footbridge/footbridge_pci.c:1.24	Sat Oct 27 13:17:37 2012
+++ src/sys/arch/arm/footbridge/footbridge_pci.c	Wed Mar 26 04:51:59 2

CVS commit: src/sys/arch/sparc64

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 08:40:58 UTC 2014

Modified Files:
src/sys/arch/sparc64/dev: pci_machdep.c
src/sys/arch/sparc64/sparc64: autoconf.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/sparc64/dev/pci_machdep.c
cvs rdiff -u -r1.193 -r1.194 src/sys/arch/sparc64/sparc64/autoconf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc64/dev/pci_machdep.c
diff -u src/sys/arch/sparc64/dev/pci_machdep.c:1.75 src/sys/arch/sparc64/dev/pci_machdep.c:1.76
--- src/sys/arch/sparc64/dev/pci_machdep.c:1.75	Sat Oct 27 13:18:12 2012
+++ src/sys/arch/sparc64/dev/pci_machdep.c	Wed Mar 26 04:40:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.75 2012/10/27 17:18:12 chs Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.76 2014/03/26 08:40:58 christos Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.75 2012/10/27 17:18:12 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.76 2014/03/26 08:40:58 christos Exp $");
 
 #include 
 #include 
@@ -371,7 +371,7 @@ pci_intr_string(pci_chipset_tag_t pc, pc
 {
 	static char str[16];
 
-	sprintf(str, "ivec %x", ih);
+	snprintf(str, sizeof(str), "ivec %x", ih);
 	DPRINTF(SPDB_INTR, ("pci_intr_string: returning %s\n", str));
 
 	return (str);

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.193 src/sys/arch/sparc64/sparc64/autoconf.c:1.194
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.193	Fri Feb 21 13:00:09 2014
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Wed Mar 26 04:40:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.193 2014/02/21 18:00:09 palle Exp $ */
+/*	$NetBSD: autoconf.c,v 1.194 2014/03/26 08:40:58 christos Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.193 2014/02/21 18:00:09 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.194 2014/03/26 08:40:58 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -512,14 +512,14 @@ clockfreq(long freq)
 {
 	char *p;
 	static char sbuf[10];
+	size_t len;
 
 	freq /= 1000;
-	sprintf(sbuf, "%ld", freq / 1000);
+	len = snprintf(sbuf, sizeof(sbuf), "%ld", freq / 1000);
 	freq %= 1000;
 	if (freq) {
 		freq += 1000;	/* now in 1000..1999 */
-		p = sbuf + strlen(sbuf);
-		sprintf(p, "%ld", freq);
+		snprintf(sbuf + len, sizeof(sbuf) - len, "%ld", freq);
 		*p = '.';	/* now sbuf = %d.%3d */
 	}
 	return (sbuf);
@@ -807,10 +807,11 @@ dev_path_drive_match(device_t dev, int c
 		 * what we realy do here is to match "target" and "lun".
 		 */
 		if (wwn)
-			sprintf(buf, "%s@w%016" PRIx64 ",%d", name, wwn,
-			lun);
+			snprintf(buf, sizeof(buf), "%s@w%016" PRIx64 ",%d",
+			name, wwn, lun);
 		else
-			sprintf(buf, "%s@%d,%d", name, target, lun);
+			snprintf(buf, sizeof(buf), "%s@%d,%d",
+			name, target, lun);
 		if (ofboottarget && strcmp(buf, ofboottarget) == 0) {
 			booted_device = dev;
 			if (ofbootpartition)



CVS commit: src/sys/arch/usermode/dev

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 08:29:41 UTC 2014

Modified Files:
src/sys/arch/usermode/dev: vaudio.c

Log Message:
fix sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/usermode/dev/vaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/usermode/dev/vaudio.c
diff -u src/sys/arch/usermode/dev/vaudio.c:1.3 src/sys/arch/usermode/dev/vaudio.c:1.4
--- src/sys/arch/usermode/dev/vaudio.c:1.3	Sun Jan 15 05:51:12 2012
+++ src/sys/arch/usermode/dev/vaudio.c	Wed Mar 26 04:29:41 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: vaudio.c,v 1.3 2012/01/15 10:51:12 jmcneill Exp $ */
+/* $NetBSD: vaudio.c,v 1.4 2014/03/26 08:29:41 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vaudio.c,v 1.3 2012/01/15 10:51:12 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vaudio.c,v 1.4 2014/03/26 08:29:41 christos Exp $");
 
 #include 
 #include 
@@ -396,8 +396,8 @@ vaudio_getdev(void *opaque, struct audio
 {
 	struct vaudio_softc *sc = opaque;
 
-	sprintf(adev->name, "Virtual Audio");
-	sprintf(adev->version, "");
+	snprintf(adev->name, sizeof(adev->name), "Virtual Audio");
+	adev->version[0] = '\0';
 	snprintf(adev->config, sizeof(adev->config), "%s", sc->sc_audiopath);
 
 	return 0;



CVS commit: src/sys/arch/arc/pci

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 08:20:29 UTC 2014

Modified Files:
src/sys/arch/arc/pci: necpb.c

Log Message:
use sprintf.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/arc/pci/necpb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arc/pci/necpb.c
diff -u src/sys/arch/arc/pci/necpb.c:1.39 src/sys/arch/arc/pci/necpb.c:1.40
--- src/sys/arch/arc/pci/necpb.c:1.39	Sat Oct 27 13:17:36 2012
+++ src/sys/arch/arc/pci/necpb.c	Wed Mar 26 04:20:29 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: necpb.c,v 1.39 2012/10/27 17:17:36 chs Exp $	*/
+/*	$NetBSD: necpb.c,v 1.40 2014/03/26 08:20:29 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: necpb.c,v 1.39 2012/10/27 17:17:36 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: necpb.c,v 1.40 2014/03/26 08:20:29 christos Exp $");
 
 #include "opt_pci.h"
 
@@ -386,7 +386,7 @@ necpb_intr_string(pci_chipset_tag_t pc, 
 
 	if (ih >= 4)
 		panic("%s: bogus handle %ld", __func__, ih);
-	sprintf(str, "int %c", 'A' + (int)ih);
+	snprintf(str, sizeof(str), "int %c", 'A' + (int)ih);
 	return str;
 }
 



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 08:19:45 UTC 2014

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: printf.s

Log Message:
mark unused


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amiga/stand/bootblock/boot/printf.s

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amiga/stand/bootblock/boot/printf.s
diff -u src/sys/arch/amiga/stand/bootblock/boot/printf.s:1.9 src/sys/arch/amiga/stand/bootblock/boot/printf.s:1.10
--- src/sys/arch/amiga/stand/bootblock/boot/printf.s:1.9	Fri Mar 21 21:52:44 2014
+++ src/sys/arch/amiga/stand/bootblock/boot/printf.s	Wed Mar 26 04:19:44 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: printf.s,v 1.9 2014/03/22 01:52:44 christos Exp $ */
+/* $NetBSD: printf.s,v 1.10 2014/03/26 08:19:44 christos Exp $ */
 
 /*-
  * Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@ Lstorech:
 	rts
 
 #ifdef notdef
-ENTRY_NOPROFILE(sprintf)
+ENTRY_NOPROFILE(unused_sprintf)
 	movml	#0x0032,%sp@-
 	movl	%sp@(16),%a3
 	lea	%pc@(Lstorech:w),%a2



CVS commit: src/sys/arch/x68k

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 08:17:59 UTC 2014

Modified Files:
src/sys/arch/x68k/dev: fd.c intio_dmac.c ite.c mfp.c mha.c ms.c
neptune.c opm.c par.c rtclock.c scsirom.c vs.c xel.c
src/sys/arch/x68k/stand/newdisk: newdisk.c
src/sys/arch/x68k/x68k: autoconf.c machdep.c

Log Message:
kill sprintf, fix unused.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/x68k/dev/fd.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/x68k/dev/intio_dmac.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/x68k/dev/ite.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/x68k/dev/mfp.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/x68k/dev/mha.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/x68k/dev/ms.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x68k/dev/neptune.c \
src/sys/arch/x68k/dev/opm.c src/sys/arch/x68k/dev/scsirom.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/x68k/dev/par.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/x68k/dev/rtclock.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/x68k/dev/vs.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x68k/dev/xel.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x68k/stand/newdisk/newdisk.c
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/x68k/x68k/autoconf.c
cvs rdiff -u -r1.189 -r1.190 src/sys/arch/x68k/x68k/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x68k/dev/fd.c
diff -u src/sys/arch/x68k/dev/fd.c:1.107 src/sys/arch/x68k/dev/fd.c:1.108
--- src/sys/arch/x68k/dev/fd.c:1.107	Sun Mar 16 01:20:26 2014
+++ src/sys/arch/x68k/dev/fd.c	Wed Mar 26 04:17:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fd.c,v 1.107 2014/03/16 05:20:26 dholland Exp $	*/
+/*	$NetBSD: fd.c,v 1.108 2014/03/26 08:17:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.107 2014/03/16 05:20:26 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.108 2014/03/26 08:17:59 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_m68k_arch.h"
@@ -523,12 +523,12 @@ fdcreset(struct fdc_softc *fdc)
 static int
 fdcpoll(struct fdc_softc *fdc)
 {
-	int i = 25000, n;
+	int i = 25000;
 
 	while (--i > 0) {
 		if ((intio_get_sicilian_intr() & SICILIAN_STAT_FDC) != 0) {
 			out_fdc(fdc->sc_iot, fdc->sc_ioh, NE7CMD_SENSEI);
-			n = fdcresult(fdc);
+			fdcresult(fdc);
 			break;
 		}
 		DELAY(100);

Index: src/sys/arch/x68k/dev/intio_dmac.c
diff -u src/sys/arch/x68k/dev/intio_dmac.c:1.34 src/sys/arch/x68k/dev/intio_dmac.c:1.35
--- src/sys/arch/x68k/dev/intio_dmac.c:1.34	Sun Oct 14 12:36:31 2012
+++ src/sys/arch/x68k/dev/intio_dmac.c	Wed Mar 26 04:17:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: intio_dmac.c,v 1.34 2012/10/14 16:36:31 tsutsui Exp $	*/
+/*	$NetBSD: intio_dmac.c,v 1.35 2014/03/26 08:17:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #include "opt_m68k_arch.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intio_dmac.c,v 1.34 2012/10/14 16:36:31 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intio_dmac.c,v 1.35 2014/03/26 08:17:59 christos Exp $");
 
 #include 
 #include 
@@ -110,7 +110,7 @@ dmac_attach(device_t parent, device_t se
 	struct dmac_softc *sc = device_private(self);
 	struct intio_attach_args *ia = aux;
 	struct intio_softc *intio;
-	int r;
+	int r __diagused;
 
 	sc->sc_dev = self;
 	dmac_attached = 1;

Index: src/sys/arch/x68k/dev/ite.c
diff -u src/sys/arch/x68k/dev/ite.c:1.61 src/sys/arch/x68k/dev/ite.c:1.62
--- src/sys/arch/x68k/dev/ite.c:1.61	Sun Mar 16 01:20:26 2014
+++ src/sys/arch/x68k/dev/ite.c	Wed Mar 26 04:17:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite.c,v 1.61 2014/03/16 05:20:26 dholland Exp $	*/
+/*	$NetBSD: ite.c,v 1.62 2014/03/26 08:17:59 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.61 2014/03/16 05:20:26 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.62 2014/03/26 08:17:59 christos Exp $");
 
 #include "ite.h"
 #if NITE > 0
@@ -508,11 +508,10 @@ void
 itestart(struct tty *tp)
 {
 	struct clist *rbp;
-	struct ite_softc *ip;
 	u_char buf[ITEBURST];
 	int s, len;
 
-	ip = getitesp(tp->t_dev);
+	getitesp(tp->t_dev);
 	/*
 	 * (Potentially) lower priority.  We only need to protect ourselves
 	 * from keyboard interrupts since that is all that can affect the
@@ -1577,8 +1576,9 @@ iteputchar(int c, struct ite_softc *ip)
 	break;
 case 6:
 	/* cursor position report */
-	sprintf(ip->argbuf, "\033[%d;%dR",
-		 ip->cury + 1, ip->curx + 1);
+	snprintf(ip->argbuf, sizeof(ip->argbuf),
+	"\033[%d;%dR",
+	 ip->cury + 1, ip->curx + 1);
 	ite_sendstr(ip, ip->argbuf);
 	break;
 }

Index: src/sys/arch/x68k/dev/mfp.c
diff -u src/sys/arch/x68k/dev/mfp.c:1.25 src/sys/arch/x68k/dev/mfp.c:1.26
--- src/sys/arch/x68k/dev/mfp.c:1.25	Thu May  5 09:44:35 2011
+++ src/sys/arch/x68k/

CVS commit: src/sys/arch/x68k/dev

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 08:17:32 UTC 2014

Modified Files:
src/sys/arch/x68k/dev: zs.c

Log Message:
fix unused, missing splx.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/x68k/dev/zs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x68k/dev/zs.c
diff -u src/sys/arch/x68k/dev/zs.c:1.41 src/sys/arch/x68k/dev/zs.c:1.42
--- src/sys/arch/x68k/dev/zs.c:1.41	Sun May  1 12:19:13 2011
+++ src/sys/arch/x68k/dev/zs.c	Wed Mar 26 04:17:32 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.41 2011/05/01 16:19:13 tsutsui Exp $	*/
+/*	$NetBSD: zs.c,v 1.42 2014/03/26 08:17:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998 Minoura Makoto
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.41 2011/05/01 16:19:13 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.42 2014/03/26 08:17:32 christos Exp $");
 
 #include 
 #include 
@@ -175,12 +175,12 @@ zs_attach(device_t parent, device_t self
 	struct zsc_attach_args zsc_args;
 	volatile struct zschan *zc;
 	struct zs_chanstate *cs;
-	int r, s, zs_unit, channel;
+	int r __diagused;
+	int s, channel;
 
 	zsc->zsc_dev = self;
 	aprint_normal("\n");
 
-	zs_unit = device_unit(self);
 	zsc->zsc_addr = (void *)ia->ia_addr;
 
 	ia->ia_size = 8;
@@ -325,6 +325,7 @@ zshard(void *arg)
 	/* We are at splzs here, so no need to lock. */
 	if (zsc->zsc_cs[0]->cs_softreq || zsc->zsc_cs[1]->cs_softreq)
 		softint_schedule(zsc->zsc_softintr_cookie);
+	splx(s);
 
 	return (rval);
 }



CVS commit: src/sys/arch/alpha

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 08:09:07 UTC 2014

Modified Files:
src/sys/arch/alpha/stand/setnetbootinfo: setnetbootinfo.c
src/sys/arch/alpha/tc: ioasic.c tc_3000_300.c tc_3000_500.c
src/sys/arch/alpha/tlsb: tlsb.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/alpha/tc/ioasic.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/alpha/tc/tc_3000_300.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/alpha/tc/tc_3000_500.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/alpha/tlsb/tlsb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
diff -u src/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c:1.13 src/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c:1.14
--- src/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c:1.13	Sat Mar 14 17:04:03 2009
+++ src/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c	Wed Mar 26 04:09:06 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: setnetbootinfo.c,v 1.13 2009/03/14 21:04:03 dsl Exp $ */
+/* $NetBSD: setnetbootinfo.c,v 1.14 2014/03/26 08:09:06 christos Exp $ */
 
 /*
  * Copyright (c) 1997 Christopher G. Demetriou
@@ -139,10 +139,12 @@ main(int argc, char *argv[])
 		outfilename = outfile;
 	else {
 		/* name + 12 for enet addr + '.' before enet addr + NUL */
-		outfilename = malloc(strlen(netboot) + 14);
+		size_t len = strlen(netboot) + 14;
+		outfilename = malloc(len);
 		if (outfilename == NULL)
 			err(1, "malloc of output file name failed");
-		sprintf(outfilename, "%s.%02x%02x%02x%02x%02x%02x", netboot,
+		snprintf(outfilename, len,
+		"%s.%02x%02x%02x%02x%02x%02x", netboot,
 		ether_addr->ether_addr_octet[0],
 		ether_addr->ether_addr_octet[1],
 		ether_addr->ether_addr_octet[2],

Index: src/sys/arch/alpha/tc/ioasic.c
diff -u src/sys/arch/alpha/tc/ioasic.c:1.45 src/sys/arch/alpha/tc/ioasic.c:1.46
--- src/sys/arch/alpha/tc/ioasic.c:1.45	Sun Feb  5 21:14:16 2012
+++ src/sys/arch/alpha/tc/ioasic.c	Wed Mar 26 04:09:06 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: ioasic.c,v 1.45 2012/02/06 02:14:16 matt Exp $ */
+/* $NetBSD: ioasic.c,v 1.46 2014/03/26 08:09:06 christos Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.45 2012/02/06 02:14:16 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.46 2014/03/26 08:09:06 christos Exp $");
 
 #include 
 #include 
@@ -192,13 +192,14 @@ ioasicattach(device_t parent, device_t s
 	 */
 	pevcnt = tc_intr_evcnt(parent, ta->ta_cookie);
 	for (i = 0; i < IOASIC_NCOOKIES; i++) {
+		static const size_t len = 12;
 		ioasicintrs[i].iai_func = ioasic_intrnull;
 		ioasicintrs[i].iai_arg = (void *)i;
 
-		cp = malloc(12, M_DEVBUF, M_NOWAIT);
+		cp = malloc(len, M_DEVBUF, M_NOWAIT);
 		if (cp == NULL)
 			panic("ioasicattach");
-		sprintf(cp, "slot %lu", i);
+		snprintf(cp, len, "slot %lu", i);
 		evcnt_attach_dynamic(&ioasicintrs[i].iai_evcnt,
 		EVCNT_TYPE_INTR, pevcnt, device_xname(self), cp);
 	}

Index: src/sys/arch/alpha/tc/tc_3000_300.c
diff -u src/sys/arch/alpha/tc/tc_3000_300.c:1.32 src/sys/arch/alpha/tc/tc_3000_300.c:1.33
--- src/sys/arch/alpha/tc/tc_3000_300.c:1.32	Sun Feb  5 21:14:16 2012
+++ src/sys/arch/alpha/tc/tc_3000_300.c	Wed Mar 26 04:09:06 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: tc_3000_300.c,v 1.32 2012/02/06 02:14:16 matt Exp $ */
+/* $NetBSD: tc_3000_300.c,v 1.33 2014/03/26 08:09:06 christos Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: tc_3000_300.c,v 1.32 2012/02/06 02:14:16 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tc_3000_300.c,v 1.33 2014/03/26 08:09:06 christos Exp $");
 
 #include 
 #include 
@@ -107,13 +107,14 @@ tc_3000_300_intr_setup(void)
 	 * Set up interrupt handlers.
 	 */
 	for (i = 0; i < TC_3000_300_NCOOKIES; i++) {
+		static const size_t len = 12;
 	tc_3000_300_intr[i].tci_func = tc_3000_300_intrnull;
 	tc_3000_300_intr[i].tci_arg = (void *)i;
 		
-		cp = malloc(12, M_DEVBUF, M_NOWAIT);
+		cp = malloc(len, M_DEVBUF, M_NOWAIT);
 		if (cp == NULL)
 			panic("tc_3000_300_intr_setup");
-		sprintf(cp, "slot %lu", i);
+		snprintf(cp, len, "slot %lu", i);
 		evcnt_attach_dynamic(&tc_3000_300_intr[i].tci_evcnt,
 		EVCNT_TYPE_INTR, NULL, "tc", cp);
 	}

Index: src/sys/arch/alpha/tc/tc_3000_500.c
diff -u src/sys/arch/alpha/tc/tc_3000_500.c:1.31 src/sys/arch/alpha/tc/tc_3000_500.c:1.32
--- src/sys/arch/alpha/tc/tc_3000_500.c:1.31	Sun Feb  5 21:14:16 2012
+++ src/sys/arch/alpha/tc/tc_3000_500.c	Wed Mar 26 04:09:06 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: tc_3000_500.c,v 1.31 2012/02/06 02:14:16 matt Exp $

CVS commit: src/sys/arch/x86/x86

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 08:04:19 UTC 2014

Modified Files:
src/sys/arch/x86/x86: cpu_ucode_intel.c platform.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x86/x86/cpu_ucode_intel.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/x86/platform.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/cpu_ucode_intel.c
diff -u src/sys/arch/x86/x86/cpu_ucode_intel.c:1.4 src/sys/arch/x86/x86/cpu_ucode_intel.c:1.5
--- src/sys/arch/x86/x86/cpu_ucode_intel.c:1.4	Fri Nov 15 03:47:55 2013
+++ src/sys/arch/x86/x86/cpu_ucode_intel.c	Wed Mar 26 04:04:19 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode_intel.c,v 1.4 2013/11/15 08:47:55 msaitoh Exp $ */
+/* $NetBSD: cpu_ucode_intel.c,v 1.5 2014/03/26 08:04:19 christos Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_intel.c,v 1.4 2013/11/15 08:47:55 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_intel.c,v 1.5 2014/03/26 08:04:19 christos Exp $");
 
 #include "opt_xen.h"
 #include "opt_cpu_ucode.h"
@@ -102,7 +102,8 @@ cpu_ucode_intel_firmware_open(firmware_h
 		return EOPNOTSUPP;
 
 	intel_getcurrentucode(&ucodeversion, &platformid);
-	sprintf(cpuspec, "%08x-%d", cpu_signature, platformid);
+	snprintf(cpuspec, sizeof(cpuspec), "%08x-%d", cpu_signature,
+	platformid);
 
 	return firmware_open(fw_path, cpuspec, fwh);
 }

Index: src/sys/arch/x86/x86/platform.c
diff -u src/sys/arch/x86/x86/platform.c:1.14 src/sys/arch/x86/x86/platform.c:1.15
--- src/sys/arch/x86/x86/platform.c:1.14	Sat Dec  8 07:36:31 2012
+++ src/sys/arch/x86/x86/platform.c	Wed Mar 26 04:04:19 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: platform.c,v 1.14 2012/12/08 12:36:31 kiyohara Exp $ */
+/* $NetBSD: platform.c,v 1.15 2014/03/26 08:04:19 christos Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "isa.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.14 2012/12/08 12:36:31 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.15 2014/03/26 08:04:19 christos Exp $");
 
 #include 
 #include 
@@ -242,7 +242,7 @@ platform_add_date(struct smbtable *tbl, 
 		year += 2000;
 	else if (year < 100)
 		year += 1900;
-	sprintf(datestr, "%04u%02u%02u", year, month, day);
+	snprintf(datestr, sizeof(datestr), "%04u%02u%02u", year, month, day);
 	pmf_set_platform(key, datestr);
 	platform_create_sysctl(key);
 }



CVS commit: src/sys/arch/zaurus/stand/zboot

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 08:02:38 UTC 2014

Modified Files:
src/sys/arch/zaurus/stand/zboot: unixcons.c

Log Message:
use snprintf


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/zaurus/stand/zboot/unixcons.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/zaurus/stand/zboot/unixcons.c
diff -u src/sys/arch/zaurus/stand/zboot/unixcons.c:1.2 src/sys/arch/zaurus/stand/zboot/unixcons.c:1.3
--- src/sys/arch/zaurus/stand/zboot/unixcons.c:1.2	Sat Nov 30 21:54:53 2013
+++ src/sys/arch/zaurus/stand/zboot/unixcons.c	Wed Mar 26 04:02:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: unixcons.c,v 1.2 2013/12/01 02:54:53 joerg Exp $	*/
+/*	$NetBSD: unixcons.c,v 1.3 2014/03/26 08:02:38 christos Exp $	*/
 
 /*
  * Copyright (c) 2009 NONAKA Kimihiro 
@@ -170,8 +170,7 @@ awaitkey(int timeout, int tell)
 			char numbuf[20];
 			int len, j;
 
-			sprintf(numbuf, "%d ", i);
-			len = strlen(numbuf);
+			len = snprintf(numbuf, sizeof(numbuf), "%d ", i);
 			for (j = 0; j < len; j++)
 numbuf[len + j] = '\b';
 			numbuf[len + j] = '\0';



CVS commit: src/sys/arch/vax/vax

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 08:01:21 UTC 2014

Modified Files:
src/sys/arch/vax/vax: db_disasm.c ka6400.c ka820.c ka88.c

Log Message:
fix printf issues


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/vax/vax/db_disasm.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/vax/vax/ka6400.c \
src/sys/arch/vax/vax/ka88.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/vax/vax/ka820.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/vax/vax/db_disasm.c
diff -u src/sys/arch/vax/vax/db_disasm.c:1.20 src/sys/arch/vax/vax/db_disasm.c:1.21
--- src/sys/arch/vax/vax/db_disasm.c:1.20	Thu Feb  2 09:29:25 2012
+++ src/sys/arch/vax/vax/db_disasm.c	Wed Mar 26 04:01:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_disasm.c,v 1.20 2012/02/02 14:29:25 matt Exp $ */
+/*	$NetBSD: db_disasm.c,v 1.21 2014/03/26 08:01:21 christos Exp $ */
 /*
  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.20 2012/02/02 14:29:25 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.21 2014/03/26 08:01:21 christos Exp $");
 
 #include 
 #include 
@@ -321,7 +321,7 @@ get_operand(inst_buffer *ib, int size)
 		break;
 
 	case 4:		/* indexed */
-		sprintf(buf, "[%s]", my_db_regs[reg].name);
+		snprintf(buf, sizeof(buf), "[%s]", my_db_regs[reg].name);
 		get_operand(ib, 0);
 		add_str(ib, buf);
 		break;
@@ -477,9 +477,9 @@ add_int(inst_buffer *ib, int i)
 {
 	char buf[32];
 	if (i < 100 && i > -100)
-		sprintf(ib->curp, "%d", i);
+		snprintf(ib->curp, sizeof(buf), "%d", i);
 	else
-		sprintf(buf, "0x%x", i);
+		snprintf(buf, sizeof(buf), "0x%x", i);
 	add_str(ib, buf);
 }
 
@@ -487,7 +487,7 @@ void
 add_xint(inst_buffer *ib, int val)
 {
 	char buf[32];
-	sprintf(buf, "0x%x", val);
+	snprintf(buf, sizeof(buf), "0x%x", val);
 	add_str(ib, buf);
 }
 

Index: src/sys/arch/vax/vax/ka6400.c
diff -u src/sys/arch/vax/vax/ka6400.c:1.17 src/sys/arch/vax/vax/ka6400.c:1.18
--- src/sys/arch/vax/vax/ka6400.c:1.17	Mon Mar 24 16:06:33 2014
+++ src/sys/arch/vax/vax/ka6400.c	Wed Mar 26 04:01:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ka6400.c,v 1.17 2014/03/24 20:06:33 christos Exp $	*/
+/*	$NetBSD: ka6400.c,v 1.18 2014/03/26 08:01:21 christos Exp $	*/
 
 /*
  * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ka6400.c,v 1.17 2014/03/24 20:06:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ka6400.c,v 1.18 2014/03/26 08:01:21 christos Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -92,7 +92,7 @@ const struct cpu_dep ka6400_calls = {
 
 #if defined(MULTIPROCESSOR)
 static void ka6400_startslave(struct cpu_info *);
-static void ka6400_txrx(int, const char *, int);
+static void ka6400_txrx(int, const char *, ...) __printflike(2, 3);
 static void ka6400_sendstr(int, const char *);
 static void ka6400_sergeant(int);
 static int rxchar(void);
@@ -345,8 +345,8 @@ ka6400_startslave(struct cpu_info *ci)
 	for (i = 0; i < 1; i++)
 		if (rxchar())
 			i = 0;
-	ka6400_txrx(id, "\020", 0);		/* Send ^P to get attention */
-	ka6400_txrx(id, "I\r", 0);			/* Init other end */
+	ka6400_txrx(id, "\020");		/* Send ^P to get attention */
+	ka6400_txrx(id, "I\r");			/* Init other end */
 	ka6400_txrx(id, "D/I 4 %x\r", ci->ci_istack);	/* Interrupt stack */
 	ka6400_txrx(id, "D/I C %x\r", mfpr(PR_SBR));	/* SBR */
 	ka6400_txrx(id, "D/I D %x\r", mfpr(PR_SLR));	/* SLR */
@@ -363,11 +363,15 @@ ka6400_startslave(struct cpu_info *ci)
 }
 
 void
-ka6400_txrx(int id, const char *fmt, int arg)
+ka6400_txrx(int id, const char *fmt, ...)
 {
 	char buf[20];
+	va_list ap;
+	
+	va_start(ap, fmt);
+	vsnprintf(buf, sizeof(buf), fmt, ap);
+	va_end(ap);
 
-	sprintf(buf, fmt, arg);
 	ka6400_sendstr(id, buf);
 	ka6400_sergeant(id);
 }
Index: src/sys/arch/vax/vax/ka88.c
diff -u src/sys/arch/vax/vax/ka88.c:1.17 src/sys/arch/vax/vax/ka88.c:1.18
--- src/sys/arch/vax/vax/ka88.c:1.17	Mon Mar 24 16:06:33 2014
+++ src/sys/arch/vax/vax/ka88.c	Wed Mar 26 04:01:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ka88.c,v 1.17 2014/03/24 20:06:33 christos Exp $	*/
+/*	$NetBSD: ka88.c,v 1.18 2014/03/26 08:01:21 christos Exp $	*/
 
 /*
  * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ka88.c,v 1.17 2014/03/24 20:06:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ka88.c,v 1.18 2014/03/26 08:01:21 christos Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -93,7 +93,7 @@ const struct cpu_dep ka88_calls = {
 
 #if defined(MULTIPROCESSOR)
 static void ka88_startslave(struct cpu_info *);
-static void ka88_txrx(int, const char *, int);
+static void ka88_txrx(int, const char *, ...) __printflike(2, 3);
 static void ka88_sendstr(int, const char *);
 static void ka88_sergeant(int);
 static int