CVS commit: xsrc/external/mit/xf86-video-intel/dist/src

2013-10-17 Thread Martin Husemann
Module Name:xsrc
Committed By:   martin
Date:   Thu Oct 17 06:40:02 UTC 2013

Modified Files:
xsrc/external/mit/xf86-video-intel/dist/src: i810_dri.c

Log Message:
Fix memset size argument, found by coverity.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/xf86-video-intel/dist/src/i810_dri.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-intel/dist/src/i810_dri.c
diff -u xsrc/external/mit/xf86-video-intel/dist/src/i810_dri.c:1.1.1.1 xsrc/external/mit/xf86-video-intel/dist/src/i810_dri.c:1.2
--- xsrc/external/mit/xf86-video-intel/dist/src/i810_dri.c:1.1.1.1	Sat Aug  2 05:12:40 2008
+++ xsrc/external/mit/xf86-video-intel/dist/src/i810_dri.c	Thu Oct 17 06:40:02 2013
@@ -1117,7 +1117,7 @@ I810DRIFinishScreenInit(ScreenPtr pScree
ScrnInfoPtrpScrn = xf86Screens[pScreen-myNum];
I810Ptr info  = I810PTR(pScrn);
 
-   memset(sPriv, 0, sizeof(sPriv));
+   memset(sPriv, 0, sizeof(*sPriv));
 
/* Have shadow run only while there is 3d active.
 */



CVS commit: src/libexec/httpd

2013-10-17 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Thu Oct 17 07:31:31 UTC 2013

Modified Files:
src/libexec/httpd: lua-bozo.c

Log Message:
zero allocated memory buffers


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/libexec/httpd/lua-bozo.c

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

Modified files:

Index: src/libexec/httpd/lua-bozo.c
diff -u src/libexec/httpd/lua-bozo.c:1.1 src/libexec/httpd/lua-bozo.c:1.2
--- src/libexec/httpd/lua-bozo.c:1.1	Sat Oct 12 17:24:07 2013
+++ src/libexec/httpd/lua-bozo.c	Thu Oct 17 07:31:31 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lua-bozo.c,v 1.1 2013/10/12 17:24:07 mbalmer Exp $	*/
+/*	$NetBSD: lua-bozo.c,v 1.2 2013/10/17 07:31:31 mbalmer Exp $	*/
 
 /*
  * Copyright (c) 2013 Marc Balmer m...@msys.ch
@@ -91,6 +91,7 @@ lua_read(lua_State *L)
 
 	len = luaL_checkinteger(L, -1);
 	data = bozomalloc(httpd, len + 1);
+	memset(data, 0, len + 1);
 	bozo_read(httpd, STDIN_FILENO, data, len);
 	lua_pushstring(L, data);
 	free(data);
@@ -406,7 +407,8 @@ bozo_process_lua(bozo_httpreq_t *request
 	if (clen  *clen  atol(clen)  0) {
 		length = atol(clen);
 		content = bozomalloc(httpd,
-		length);
+		length + 1);
+		memset(content, 0, length + 1);
 		bozo_read(httpd, STDIN_FILENO,
 		content, length);
 		lua_decode_query(map-L,



CVS commit: src/libexec/httpd

2013-10-17 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Thu Oct 17 07:49:06 UTC 2013

Modified Files:
src/libexec/httpd: lua-bozo.c

Log Message:
plug a memory leak


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/libexec/httpd/lua-bozo.c

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

Modified files:

Index: src/libexec/httpd/lua-bozo.c
diff -u src/libexec/httpd/lua-bozo.c:1.2 src/libexec/httpd/lua-bozo.c:1.3
--- src/libexec/httpd/lua-bozo.c:1.2	Thu Oct 17 07:31:31 2013
+++ src/libexec/httpd/lua-bozo.c	Thu Oct 17 07:49:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lua-bozo.c,v 1.2 2013/10/17 07:31:31 mbalmer Exp $	*/
+/*	$NetBSD: lua-bozo.c,v 1.3 2013/10/17 07:49:06 mbalmer Exp $	*/
 
 /*
  * Copyright (c) 2013 Marc Balmer m...@msys.ch
@@ -254,8 +254,10 @@ lua_url_decode(lua_State *L, char *s)
 	for (p = v, q = val; *p; p++) {
 		switch (*p) {
 		case '%':
-			if (*(p + 1) == '\0' || *(p + 2) == '\0')
+			if (*(p + 1) == '\0' || *(p + 2) == '\0') {
+free(val);
 return;
+			}
 			buf[0] = *++p;
 			buf[1] = *++p;
 			buf[2] = '\0';



CVS commit: src/libexec/httpd

2013-10-17 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Thu Oct 17 07:54:19 UTC 2013

Modified Files:
src/libexec/httpd: lua-bozo.c

Log Message:
better approach to NUL terminate strings


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/libexec/httpd/lua-bozo.c

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

Modified files:

Index: src/libexec/httpd/lua-bozo.c
diff -u src/libexec/httpd/lua-bozo.c:1.3 src/libexec/httpd/lua-bozo.c:1.4
--- src/libexec/httpd/lua-bozo.c:1.3	Thu Oct 17 07:49:06 2013
+++ src/libexec/httpd/lua-bozo.c	Thu Oct 17 07:54:19 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lua-bozo.c,v 1.3 2013/10/17 07:49:06 mbalmer Exp $	*/
+/*	$NetBSD: lua-bozo.c,v 1.4 2013/10/17 07:54:19 mbalmer Exp $	*/
 
 /*
  * Copyright (c) 2013 Marc Balmer m...@msys.ch
@@ -81,7 +81,7 @@ static int
 lua_read(lua_State *L)
 {
 	bozohttpd_t *httpd;
-	int len;
+	int n, len;
 	char *data;
 
 	lua_pushstring(L, bozohttpd);
@@ -91,9 +91,12 @@ lua_read(lua_State *L)
 
 	len = luaL_checkinteger(L, -1);
 	data = bozomalloc(httpd, len + 1);
-	memset(data, 0, len + 1);
-	bozo_read(httpd, STDIN_FILENO, data, len);
-	lua_pushstring(L, data);
+	n = bozo_read(httpd, STDIN_FILENO, data, len);
+	if (n = 0) {
+		data[n] = '\0';
+		lua_pushstring(L, data);
+	} else
+		lua_pushnil(L);
 	free(data);
 	return 1;
 }
@@ -294,7 +297,7 @@ bozo_process_lua(bozo_httpreq_t *request
 	bozohttpd_t *httpd = request-hr_httpd;
 	lua_state_map_t *map;
 	lua_handler_t *hndlr;
-	int ret, length;
+	int n, ret, length;
 	char date[40];
 	bozoheaders_t *headp;
 	char *s, *query, *uri, *file, *command, *info, *content;
@@ -410,11 +413,14 @@ bozo_process_lua(bozo_httpreq_t *request
 		length = atol(clen);
 		content = bozomalloc(httpd,
 		length + 1);
-		memset(content, 0, length + 1);
-		bozo_read(httpd, STDIN_FILENO,
-		content, length);
-		lua_decode_query(map-L,
-		content);
+		n = bozo_read(httpd,
+		STDIN_FILENO, content,
+		length);
+		if (n = 0) {
+			content[n] = '\0';
+			lua_decode_query(map-L,
+			content);
+		}
 		free(content);
 	}
 }



CVS commit: src/libexec/httpd

2013-10-17 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Thu Oct 17 08:07:54 UTC 2013

Modified Files:
src/libexec/httpd: lua-bozo.c

Log Message:
fold long line in a readable way; pass nil as query table if reading form data 
fails


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/libexec/httpd/lua-bozo.c

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

Modified files:

Index: src/libexec/httpd/lua-bozo.c
diff -u src/libexec/httpd/lua-bozo.c:1.4 src/libexec/httpd/lua-bozo.c:1.5
--- src/libexec/httpd/lua-bozo.c:1.4	Thu Oct 17 07:54:19 2013
+++ src/libexec/httpd/lua-bozo.c	Thu Oct 17 08:07:54 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lua-bozo.c,v 1.4 2013/10/17 07:54:19 mbalmer Exp $	*/
+/*	$NetBSD: lua-bozo.c,v 1.5 2013/10/17 08:07:54 mbalmer Exp $	*/
 
 /*
  * Copyright (c) 2013 Marc Balmer m...@msys.ch
@@ -403,8 +403,8 @@ bozo_process_lua(bozo_httpreq_t *request
 headp-h_value);
 
 			/* Pass the query variables */
-			if ((query  *query) || (type  *type
-			 !strcmp(type, FORM))) {
+			if ((query  *query) ||
+			(type  *type  !strcmp(type, FORM))) {
 lua_newtable(map-L);
 if (query  *query)
 	lua_decode_query(map-L, query);
@@ -420,6 +420,9 @@ bozo_process_lua(bozo_httpreq_t *request
 			content[n] = '\0';
 			lua_decode_query(map-L,
 			content);
+		} else {
+			lua_pop(map-L, 1);
+			lua_pushnil(map-L);
 		}
 		free(content);
 	}



CVS commit: src/sbin/luactl

2013-10-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Oct 17 08:21:03 UTC 2013

Modified Files:
src/sbin/luactl: luactl.8

Log Message:
More markup, typo fixes, update date and NetBSD version for import.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/luactl/luactl.8

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

Modified files:

Index: src/sbin/luactl/luactl.8
diff -u src/sbin/luactl/luactl.8:1.1 src/sbin/luactl/luactl.8:1.2
--- src/sbin/luactl/luactl.8:1.1	Wed Oct 16 19:48:21 2013
+++ src/sbin/luactl/luactl.8	Thu Oct 17 08:21:03 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: luactl.8,v 1.1 2013/10/16 19:48:21 mbalmer Exp $
+.\ $NetBSD: luactl.8,v 1.2 2013/10/17 08:21:03 wiz Exp $
 .\
 .\ Copyright (c) 2011 Marc Balmer m...@msys.ch
 .\
@@ -14,52 +14,52 @@
 .\ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\
-.Dd August 26, 2011
+.Dd October 17, 2013
 .Dt LUACTL 8
 .Os
 .Sh NAME
 .Nm luactl
 .Nd control kernel Lua states
 .Sh SYNOPSIS
-.Nm luactl
+.Nm
 .Op Fl cq
-.Nm luactl
+.Nm
 .Op Fl cq
-create
+.Cm create
 .Ar name
 .Op desc
-.Nm luactl
+.Nm
 .Op Fl cq
-destroy
+.Cm destroy
 .Ar name
-.Nm luactl
+.Nm
 .Op Fl cq
-require
+.Cm require
 .Ar name module
-.Nm luactl
+.Nm
 .Op Fl cq
-load
+.Cm load
 .Ar name path
 .Sh DESCRIPTION
 The
 .Nm
 program allows the manipulation of Lua states in the kernel.
 Lua states are created using the
-.Sq create
+.Dq Cm create
 command (see below),
 Lua bindings are provided as modules.
 To make a Lua binding available to a state, it must be
-.Sq required .
+.Dq required .
 If a kernel subsystem is to use a Lua state, a state has to be
-.Sq assigned
+.Dq assigned
 to it.
 Once a module has been
-.Sq required
+.Dq required
 by a state, it can not be unloaded from memory using the
 .Xr modunload 8
 command until the state using it has been destroyed.
 .Pp
-Lua code can be loaded from the filesystem into a state at anytime, please
+Lua code can be loaded from the file system into a state at anytime, please
 note that code loaded into a state is immediately executed.
 .Pp
 When executed without a command,
@@ -72,22 +72,22 @@ The options are as follows:
 .Bl -tag -width Ds
 .It Fl c
 Create a Lua state before executing the command.
-This flag is used for the require, assing, and, load commands only, it
+This flag is used for the require, assign, and, load commands only, it
 is ignored for all other commands.
 .It Fl q
 Operate quietly i.e. nothing is printed to stdout.
 .El
 .Sh COMMANDS
 .Bl -tag -width Ds
-.It create Ar name Op Ar desc
+.It Cm create Ar name Op Ar desc
 Create a Lua state with name
 .Ar name
 and optional description
 .Ar desc .
-.It destroy Ar name
+.It Cm destroy Ar name
 Destroy the Lua state
 .Ar name .
-.It require Ar name module
+.It Cm require Ar name module
 Let the Lua state
 .Ar name
 use the bindings provided in module
@@ -95,7 +95,7 @@ use the bindings provided in module
 This is the equivalent of userland Lua code calling the
 .Sq require
 function.
-.It load Ar name Pa path
+.It Cm load Ar name Pa path
 Load Lua code in file
 .Pa path
 into the Lua state
@@ -110,17 +110,17 @@ Lua device file.
 .El
 .Sh SEE ALSO
 .Xr lua 4 ,
-.Xr lua 9 ,
-.Xr modload 8 ,
 .Xr module 7 ,
-.Xr modunload 8
+.Xr modload 8 ,
+.Xr modunload 8 ,
+.Xr lua 9
 .Sh HISTORY
 The
 .Nm
 command first appeared in
-.Nx 6.0 .
+.Nx 7.0 .
 .Sh AUTHORS
 The
 .Nm
 program was written by
-.An Marc Balmer Aq m...@msys.ch .
+.An Marc Balmer Aq Mt m...@msys.ch .



CVS commit: src/sbin/luactl

2013-10-17 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Thu Oct 17 09:33:40 UTC 2013

Modified Files:
src/sbin/luactl: luactl.8

Log Message:
there is no assign command


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/luactl/luactl.8

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

Modified files:

Index: src/sbin/luactl/luactl.8
diff -u src/sbin/luactl/luactl.8:1.2 src/sbin/luactl/luactl.8:1.3
--- src/sbin/luactl/luactl.8:1.2	Thu Oct 17 08:21:03 2013
+++ src/sbin/luactl/luactl.8	Thu Oct 17 09:33:40 2013
@@ -1,6 +1,6 @@
-.\ $NetBSD: luactl.8,v 1.2 2013/10/17 08:21:03 wiz Exp $
+.\ $NetBSD: luactl.8,v 1.3 2013/10/17 09:33:40 mbalmer Exp $
 .\
-.\ Copyright (c) 2011 Marc Balmer m...@msys.ch
+.\ Copyright (c) 2011, 2013 Marc Balmer m...@msys.ch
 .\
 .\ Permission to use, copy, modify, and distribute this software for any
 .\ purpose with or without fee is hereby granted, provided that the above
@@ -50,9 +50,6 @@ command (see below),
 Lua bindings are provided as modules.
 To make a Lua binding available to a state, it must be
 .Dq required .
-If a kernel subsystem is to use a Lua state, a state has to be
-.Dq assigned
-to it.
 Once a module has been
 .Dq required
 by a state, it can not be unloaded from memory using the
@@ -72,7 +69,7 @@ The options are as follows:
 .Bl -tag -width Ds
 .It Fl c
 Create a Lua state before executing the command.
-This flag is used for the require, assign, and, load commands only, it
+This flag is used for the require, and, load commands only, it
 is ignored for all other commands.
 .It Fl q
 Operate quietly i.e. nothing is printed to stdout.



CVS commit: src/sbin/luactl

2013-10-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Oct 17 09:44:22 UTC 2013

Modified Files:
src/sbin/luactl: luactl.8

Log Message:
Still more markup. Sort.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sbin/luactl/luactl.8

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

Modified files:

Index: src/sbin/luactl/luactl.8
diff -u src/sbin/luactl/luactl.8:1.3 src/sbin/luactl/luactl.8:1.4
--- src/sbin/luactl/luactl.8:1.3	Thu Oct 17 09:33:40 2013
+++ src/sbin/luactl/luactl.8	Thu Oct 17 09:44:22 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: luactl.8,v 1.3 2013/10/17 09:33:40 mbalmer Exp $
+.\ $NetBSD: luactl.8,v 1.4 2013/10/17 09:44:22 wiz Exp $
 .\
 .\ Copyright (c) 2011, 2013 Marc Balmer m...@msys.ch
 .\
@@ -34,12 +34,12 @@
 .Ar name
 .Nm
 .Op Fl cq
-.Cm require
-.Ar name module
-.Nm
-.Op Fl cq
 .Cm load
 .Ar name path
+.Nm
+.Op Fl cq
+.Cm require
+.Ar name module
 .Sh DESCRIPTION
 The
 .Nm
@@ -49,9 +49,9 @@ Lua states are created using the
 command (see below),
 Lua bindings are provided as modules.
 To make a Lua binding available to a state, it must be
-.Dq required .
+.Dq Em required .
 Once a module has been
-.Dq required
+.Dq Em required
 by a state, it can not be unloaded from memory using the
 .Xr modunload 8
 command until the state using it has been destroyed.
@@ -69,7 +69,11 @@ The options are as follows:
 .Bl -tag -width Ds
 .It Fl c
 Create a Lua state before executing the command.
-This flag is used for the require, and, load commands only, it
+This flag is used for the
+.Cm require
+and
+.Cm load
+commands only, it
 is ignored for all other commands.
 .It Fl q
 Operate quietly i.e. nothing is printed to stdout.
@@ -84,6 +88,13 @@ and optional description
 .It Cm destroy Ar name
 Destroy the Lua state
 .Ar name .
+.It Cm load Ar name Pa path
+Load Lua code in file
+.Pa path
+into the Lua state
+.Ar name .
+Note that the path name must contain at least one path separation character
+.Pq Sq / .
 .It Cm require Ar name module
 Let the Lua state
 .Ar name
@@ -92,13 +103,6 @@ use the bindings provided in module
 This is the equivalent of userland Lua code calling the
 .Sq require
 function.
-.It Cm load Ar name Pa path
-Load Lua code in file
-.Pa path
-into the Lua state
-.Ar name .
-Note that the path name must contain at least one path separation character
-.Pq Sq / .
 .El
 .Sh FILES
 .Bl -tag -width /dev/lua -compact



CVS commit: src/tests/net/net

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 12:52:09 UTC 2013

Modified Files:
src/tests/net/net: t_unix.c

Log Message:
CID 1107550: resource leak


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/net/net/t_unix.c

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

Modified files:

Index: src/tests/net/net/t_unix.c
diff -u src/tests/net/net/t_unix.c:1.8 src/tests/net/net/t_unix.c:1.9
--- src/tests/net/net/t_unix.c:1.8	Thu Oct 10 12:01:55 2013
+++ src/tests/net/net/t_unix.c	Thu Oct 17 08:52:09 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_unix.c,v 1.8 2013/10/10 16:01:55 christos Exp $	*/
+/*	$NetBSD: t_unix.c,v 1.9 2013/10/17 12:52:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include sys/cdefs.h
 #ifdef __RCSID
-__RCSID($Id: t_unix.c,v 1.8 2013/10/10 16:01:55 christos Exp $);
+__RCSID($Id: t_unix.c,v 1.9 2013/10/17 12:52:09 christos Exp $);
 #else
 #define getprogname() argv[0]
 #endif
@@ -65,7 +65,7 @@ __RCSID($Id: t_unix.c,v 1.8 2013/10/10 
 #else
 
 #include atf-c.h
-#define FAIL(msg, ...)	ATF_CHECK_MSG(0, msg, ## __VA_ARGS__)
+#define FAIL(msg, ...)	ATF_CHECK_MSG(0, msg, ## __VA_ARGS__); goto fail
 
 #endif
 
@@ -110,7 +110,9 @@ acc(int s)
 		FAIL(guard1 = '%c', guard1);
 	if (guard2 != 's')
 		FAIL(guard2 = '%c', guard2);
+#ifdef DEBUG
 	print(accept, sun, len);
+#endif
 	if (len != 2)
 		FAIL(len %d != 2, len);
 	if (sun.sun_family != AF_UNIX)
@@ -124,6 +126,10 @@ acc(int s)
 			FAIL(sun.sun_path[%zu] %d != NULL, i,
 			sun.sun_path[i]);
 	return s;
+fail:
+	if (s != -1)
+		close(s);
+	return -1;
 }
 
 static int
@@ -131,8 +137,8 @@ test(bool closeit, size_t len)
 {
 	size_t slen;
 	socklen_t sl;
-	int srvr, clnt, acpt;
-	struct sockaddr_un *sock_addr, *sun;
+	int srvr = -1, clnt = -1, acpt = -1;
+	struct sockaddr_un *sock_addr = NULL, *sun = NULL;
 	socklen_t sock_addrlen;
 
 	srvr = socket(AF_UNIX, SOCK_STREAM, 0);
@@ -228,7 +234,16 @@ test(bool closeit, size_t len)
 	if (!closeit)
 		(void)close(clnt);
 
+	free(sock_addr);
+	free(sun);
 	return 0;
+fail:
+	(void)close(acpt);
+	(void)close(srvr);
+	(void)close(clnt);
+	free(sock_addr);
+	free(sun);
+	return -1;
 }
 
 #ifndef TEST



CVS commit: src/tests/net/net

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 12:53:28 UTC 2013

Modified Files:
src/tests/net/net: t_tcp.c

Log Message:
CID 1107548: resource leak


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/net/net/t_tcp.c

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

Modified files:

Index: src/tests/net/net/t_tcp.c
diff -u src/tests/net/net/t_tcp.c:1.2 src/tests/net/net/t_tcp.c:1.3
--- src/tests/net/net/t_tcp.c:1.2	Sat Oct 12 13:26:32 2013
+++ src/tests/net/net/t_tcp.c	Thu Oct 17 08:53:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_tcp.c,v 1.2 2013/10/12 17:26:32 christos Exp $	*/
+/*	$NetBSD: t_tcp.c,v 1.3 2013/10/17 12:53:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include sys/cdefs.h
 #ifdef __RCSID
-__RCSID($Id: t_tcp.c,v 1.2 2013/10/12 17:26:32 christos Exp $);
+__RCSID($Id: t_tcp.c,v 1.3 2013/10/17 12:53:28 christos Exp $);
 #endif
 
 /* Example code. Should block; does with accept not paccept. */
@@ -58,7 +58,7 @@ __RCSID($Id: t_tcp.c,v 1.2 2013/10/12 1
 #define FAIL(msg, ...)  err(EXIT_FAILURE, msg, ## __VA_ARGS__)
 #else 
 #include atf-c.h 
-#define FAIL(msg, ...)  ATF_CHECK_MSG(0, msg, ## __VA_ARGS__)
+#define FAIL(msg, ...)  ATF_CHECK_MSG(0, msg, ## __VA_ARGS__); goto fail
 #endif
 
 static void
@@ -69,7 +69,7 @@ ding(int al)
 static void 
 paccept_block(bool pacceptblock, bool fcntlblock)
 {
-	int srvr, clnt, as;
+	int srvr = -1, clnt = -1, as = -1;
 	int ok, fl, n;
 	char buf[10];
 	struct sockaddr_in sin, ba;
@@ -153,6 +153,11 @@ paccept_block(bool pacceptblock, bool fc
 		if (n != -1 || errno != EWOULDBLOCK)
 			FAIL(read);
 	}
+	return;
+fail:
+	close(srvr);
+	close(clnt);
+	close(as);
 }
 
 #ifndef TEST



CVS commit: src/share/man/man9

2013-10-17 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Oct 17 13:17:51 UTC 2013

Modified Files:
src/share/man/man9: kpause.9

Log Message:
Don't capitalize it in the middle of a sentence.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man9/kpause.9

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

Modified files:

Index: src/share/man/man9/kpause.9
diff -u src/share/man/man9/kpause.9:1.7 src/share/man/man9/kpause.9:1.8
--- src/share/man/man9/kpause.9:1.7	Wed Jul 20 05:20:54 2011
+++ src/share/man/man9/kpause.9	Thu Oct 17 13:17:50 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: kpause.9,v 1.7 2011/07/20 05:20:54 jruoho Exp $
+.\	$NetBSD: kpause.9,v 1.8 2013/10/17 13:17:50 gson Exp $
 .\
 .\ Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -98,7 +98,7 @@ returns.
 .Fn kpause
 returns 0 when waking up spontaneously.
 Otherwise,
-It returns an error number.
+it returns an error number.
 .\ 
 .Sh ERRORS
 .Bl -tag -width Er



CVS commit: src/share/man/man3

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 16:50:48 UTC 2013

Modified Files:
src/share/man/man3: __CONCAT.3 __UNCONST.3

Log Message:
add non-portability caveat.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man3/__CONCAT.3
cvs rdiff -u -r1.5 -r1.6 src/share/man/man3/__UNCONST.3

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

Modified files:

Index: src/share/man/man3/__CONCAT.3
diff -u src/share/man/man3/__CONCAT.3:1.6 src/share/man/man3/__CONCAT.3:1.7
--- src/share/man/man3/__CONCAT.3:1.6	Thu Dec 16 05:40:04 2010
+++ src/share/man/man3/__CONCAT.3	Thu Oct 17 12:50:48 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: __CONCAT.3,v 1.6 2010/12/16 10:40:04 jruoho Exp $ $
+.\	$NetBSD: __CONCAT.3,v 1.7 2013/10/17 16:50:48 christos Exp $ $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd December 16, 2010
+.Dd October 17, 2013
 .Dt __CONCAT 3
 .Os
 .Sh NAME
@@ -101,3 +101,8 @@ is used.
 It can be also noted that the C preprocessor converts all
 comments to whitespace before any macros are even considered.
 The use of either macro is discouraged in complex constructs.
+.Pp
+Use of this macro is non-portable; this is part of the implementation
+namespace and should only be used in 
+.Nx
+code.

Index: src/share/man/man3/__UNCONST.3
diff -u src/share/man/man3/__UNCONST.3:1.5 src/share/man/man3/__UNCONST.3:1.6
--- src/share/man/man3/__UNCONST.3:1.5	Thu Dec 16 05:40:04 2010
+++ src/share/man/man3/__UNCONST.3	Thu Oct 17 12:50:48 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: __UNCONST.3,v 1.5 2010/12/16 10:40:04 jruoho Exp $
+.\	$NetBSD: __UNCONST.3,v 1.6 2013/10/17 16:50:48 christos Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd December 16, 2010
+.Dd October 17, 2013
 .Dt __UNCONST 3
 .Os
 .Sh NAME
@@ -81,3 +81,8 @@ include passing a
 .Em volatile
 pointer to
 .Xr memset 3 .
+.Pp
+Use of this macro is non-portable; this is part of the implementation
+namespace and should only be used in 
+.Nx
+code.



CVS commit: src/share/man/man3

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 16:50:36 UTC 2013

Modified Files:
src/share/man/man3: Makefile
Added Files:
src/share/man/man3: __USE.3

Log Message:
describe the __USE macro


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/share/man/man3/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3/__USE.3

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

Modified files:

Index: src/share/man/man3/Makefile
diff -u src/share/man/man3/Makefile:1.81 src/share/man/man3/Makefile:1.82
--- src/share/man/man3/Makefile:1.81	Thu Dec  6 20:54:41 2012
+++ src/share/man/man3/Makefile	Thu Oct 17 12:50:36 2013
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile,v 1.81 2012/12/07 01:54:41 christos Exp $
+#	$NetBSD: Makefile,v 1.82 2013/10/17 16:50:36 christos Exp $
 #	@(#)Makefile	8.2 (Berkeley) 12/13/93
 
-MAN=	_DIAGASSERT.3 __CONCAT.3 __UNCONST.3 CMSG_DATA.3 \
+MAN=	_DIAGASSERT.3 __CONCAT.3 __UNCONST.3 __USE.3 CMSG_DATA.3 \
 	__alignof__.3 __arraycount.3 \
 	__builtin_constant_p.3 __builtin_prefetch.3 \
 	__builtin_return_address.3 \

Added files:

Index: src/share/man/man3/__USE.3
diff -u /dev/null src/share/man/man3/__USE.3:1.1
--- /dev/null	Thu Oct 17 12:50:36 2013
+++ src/share/man/man3/__USE.3	Thu Oct 17 12:50:36 2013
@@ -0,0 +1,122 @@
+.\	$NetBSD: __USE.3,v 1.1 2013/10/17 16:50:36 christos Exp $
+.\
+.\ Copyright (c) 2013 The NetBSD Foundation, Inc.
+.\ All rights reserved.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\ POSSIBILITY OF SUCH DAMAGE.
+.\
+.Dd October 17, 2013
+.Dt __USE 3
+.Os
+.Sh NAME
+.Nm __USE
+.Nd compile time macro that marks a variable as being used.
+.Sh SYNOPSIS
+.In sys/cdefs.h
+.Ft void
+.Fn __USE x
+.Sh DESCRIPTION
+The
+.Nm __USE
+macro can be used to omit warnings produced by certain compilers when
+variables are being set, but not used in a function.
+.Pp
+There are cases where it is simpler to mark a variable as used, as opposed
+to ifdef out its use:
+.Bd -literal -offset indent
+#ifdef DEBUG_FOO
+#define DPRINTF(a) printf a
+#else
+#define DPRINTF(a)
+
+void
+foo(void) {
+	int var;
+
+	var = getval();
+
+	DPRINTF((val is %d\n, val));
+}
+.Ed
+.Pp
+In this case, ifdefing the code would make it:
+.Bd -literal -offset indent
+void
+foo(void) {
+#ifdef DEBUG_FOO
+	int var;
+
+	var = getval();
+
+	DPRINTF((val is %d\n, val));
+#else
+	(void)getval();
+#endif
+}
+.Ed
+.Pp
+This is not desirable because it duplicates code.
+With the
+.Nm __USE
+macro this can be written as:
+.Bd -literal -offset indent
+void
+foo(void) {
+	int var;
+
+	var = getval();
+
+#ifdef DEBUG_FOO
+	DPRINTF((val is %d\n, val));
+#else
+	__USE(var);
+#endif
+}
+.Ed
+.Pp
+without producing compiler warnings.
+.Pp
+Although it is simple to write:
+.Bd -literal -offset indent
+	(void)var;
+.Ed
+.Pp
+abstracting this into the macro allows for alternate implementations,
+as well as changing it to an empty implementation so that the liveness
+of the variable can be re-evaluated.
+.Sh IMPLEMENTATION NOTES
+.Nm
+is implemented as:
+.Bd -literal -offset indent
+#define __USE(a)	((void)(a))
+.Ed
+.Sh SEE ALSO
+.Xr cc 1 ,
+.Xr cdefs 3
+.Sh CAVEATS
+.Nm
+should be used sparingly as it can cause valid warnings to be hidden.
+.Pp
+Use of this macro is non-portable; this is part of the implementation
+namespace and should only be used in 
+.Nx
+code.



CVS commit: src/distrib/sets/lists/comp

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 16:52:02 UTC 2013

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
add __USE


To generate a diff of this commit:
cvs rdiff -u -r1.1844 -r1.1845 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1844 src/distrib/sets/lists/comp/mi:1.1845
--- src/distrib/sets/lists/comp/mi:1.1844	Mon Oct 14 12:00:16 2013
+++ src/distrib/sets/lists/comp/mi	Thu Oct 17 12:52:02 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1844 2013/10/14 16:00:16 joerg Exp $
+#	$NetBSD: mi,v 1.1845 2013/10/17 16:52:02 christos Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -4541,6 +4541,7 @@
 ./usr/share/man/cat3/__STRING.0			comp-c-catman		.cat
 ./usr/share/man/cat3/__UNCONST.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__UNVOLATILE.0		comp-c-catman		.cat
+./usr/share/man/cat3/__USE.0			comp-c-catman		.cat
 ./usr/share/man/cat3/__aligned.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__alignof__.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__arraycount.0		comp-c-catman		.cat
@@ -11143,6 +11144,7 @@
 ./usr/share/man/html3/__STRING.html		comp-c-htmlman		html
 ./usr/share/man/html3/__UNCONST.html		comp-c-htmlman		html
 ./usr/share/man/html3/__UNVOLATILE.html		comp-c-htmlman		html
+./usr/share/man/html3/__USE.html		comp-c-htmlman		html
 ./usr/share/man/html3/__aligned.html		comp-c-htmlman		html
 ./usr/share/man/html3/__alignof__.html		comp-c-htmlman		html
 ./usr/share/man/html3/__arraycount.html		comp-c-htmlman		html
@@ -17547,6 +17549,7 @@
 ./usr/share/man/man3/__STRING.3			comp-c-man		.man
 ./usr/share/man/man3/__UNCONST.3		comp-c-man		.man
 ./usr/share/man/man3/__UNVOLATILE.3		comp-c-man		.man
+./usr/share/man/man3/__USE.3			comp-c-man		.man
 ./usr/share/man/man3/__aligned.3		comp-c-man		.man
 ./usr/share/man/man3/__alignof__.3		comp-c-man		.man
 ./usr/share/man/man3/__arraycount.3		comp-c-man		.man



CVS commit: src/usr.sbin/mtree

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 17:22:59 UTC 2013

Modified Files:
src/usr.sbin/mtree: compare.c create.c spec.c

Log Message:
Our sys/param.h ends up calling header files that define intmax_t. This
should not be the case (but sys/param.h is not a standard header so all bets
are off). FreeBSD's does not, so explicitly include stdint.h to get it.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/usr.sbin/mtree/compare.c
cvs rdiff -u -r1.71 -r1.72 src/usr.sbin/mtree/create.c
cvs rdiff -u -r1.87 -r1.88 src/usr.sbin/mtree/spec.c

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

Modified files:

Index: src/usr.sbin/mtree/compare.c
diff -u src/usr.sbin/mtree/compare.c:1.56 src/usr.sbin/mtree/compare.c:1.57
--- src/usr.sbin/mtree/compare.c:1.56	Mon Sep  9 19:27:43 2013
+++ src/usr.sbin/mtree/compare.c	Thu Oct 17 13:22:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: compare.c,v 1.56 2013/09/09 23:27:43 christos Exp $	*/
+/*	$NetBSD: compare.c,v 1.57 2013/10/17 17:22:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = @(#)compare.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: compare.c,v 1.56 2013/09/09 23:27:43 christos Exp $);
+__RCSID($NetBSD: compare.c,v 1.57 2013/10/17 17:22:59 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -48,6 +48,7 @@ __RCSID($NetBSD: compare.c,v 1.56 2013/
 #include errno.h
 #include fcntl.h
 #include stdio.h
+#include stdint.h
 #include stdlib.h
 #include string.h
 #include time.h

Index: src/usr.sbin/mtree/create.c
diff -u src/usr.sbin/mtree/create.c:1.71 src/usr.sbin/mtree/create.c:1.72
--- src/usr.sbin/mtree/create.c:1.71	Wed Oct 16 13:24:20 2013
+++ src/usr.sbin/mtree/create.c	Thu Oct 17 13:22:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: create.c,v 1.71 2013/10/16 17:24:20 christos Exp $	*/
+/*	$NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = @(#)create.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: create.c,v 1.71 2013/10/16 17:24:20 christos Exp $);
+__RCSID($NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -55,6 +55,7 @@ __RCSID($NetBSD: create.c,v 1.71 2013/1
 #include pwd.h
 #include stdio.h
 #include stdarg.h
+#include stdint.h
 #include stdlib.h
 #include string.h
 #include time.h

Index: src/usr.sbin/mtree/spec.c
diff -u src/usr.sbin/mtree/spec.c:1.87 src/usr.sbin/mtree/spec.c:1.88
--- src/usr.sbin/mtree/spec.c:1.87	Wed Oct 16 13:26:14 2013
+++ src/usr.sbin/mtree/spec.c	Thu Oct 17 13:22:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: spec.c,v 1.87 2013/10/16 17:26:14 christos Exp $	*/
+/*	$NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -67,7 +67,7 @@
 #if 0
 static char sccsid[] = @(#)spec.c	8.2 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: spec.c,v 1.87 2013/10/16 17:26:14 christos Exp $);
+__RCSID($NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -81,6 +81,7 @@ __RCSID($NetBSD: spec.c,v 1.87 2013/10/
 #include pwd.h
 #include stdarg.h
 #include stdio.h
+#include stdint.h
 #include stdlib.h
 #include string.h
 #include unistd.h



CVS commit: src/sys

2013-10-17 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Thu Oct 17 18:04:40 UTC 2013

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_sysent.c
src/sys/kern: init_sysent.c syscalls.c
src/sys/rump/include/rump: rump_syscalls.h
src/sys/rump/librump/rumpkern: rump_syscalls.c
src/sys/sys: syscall.h syscallargs.h

Log Message:
Regen for mknodat(2) device argument type change.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/compat/netbsd32/netbsd32_syscall.h \
src/sys/compat/netbsd32/netbsd32_syscallargs.h
cvs rdiff -u -r1.104 -r1.105 src/sys/compat/netbsd32/netbsd32_syscalls.c \
src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.274 -r1.275 src/sys/kern/init_sysent.c
cvs rdiff -u -r1.265 -r1.266 src/sys/kern/syscalls.c
cvs rdiff -u -r1.66 -r1.67 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.91 -r1.92 src/sys/rump/librump/rumpkern/rump_syscalls.c
cvs rdiff -u -r1.261 -r1.262 src/sys/sys/syscall.h
cvs rdiff -u -r1.244 -r1.245 src/sys/sys/syscallargs.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/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.105 src/sys/compat/netbsd32/netbsd32_syscall.h:1.106
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.105	Fri Mar 29 01:14:09 2013
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Thu Oct 17 18:04:40 2013
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.105 2013/03/29 01:14:09 christos Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.106 2013/10/17 18:04:40 njoly Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.97 2013/03/29 01:04:30 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.98 2013/10/17 18:01:11 njoly Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_
@@ -1197,7 +1197,7 @@
 /* syscall: netbsd32_mkfifoat ret: int args: int const netbsd32_charp mode_t */
 #define	NETBSD32_SYS_netbsd32_mkfifoat	459
 
-/* syscall: netbsd32_mknodat ret: int args: int const netbsd32_charp mode_t uint32_t */
+/* syscall: netbsd32_mknodat ret: int args: int const netbsd32_charp mode_t int netbsd32_dev_t */
 #define	NETBSD32_SYS_netbsd32_mknodat	460
 
 /* syscall: netbsd32_mkdirat ret: int args: int const netbsd32_charp mode_t */
Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.105 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.106
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.105	Fri Mar 29 01:14:09 2013
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Thu Oct 17 18:04:40 2013
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.105 2013/03/29 01:14:09 christos Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.106 2013/10/17 18:04:40 njoly Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.97 2013/03/29 01:04:30 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.98 2013/10/17 18:01:11 njoly Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -2337,7 +2337,8 @@ struct netbsd32_mknodat_args {
 	syscallarg(int) fd;
 	syscallarg(const netbsd32_charp) path;
 	syscallarg(mode_t) mode;
-	syscallarg(uint32_t) dev;
+	syscallarg(int) PAD;
+	syscallarg(netbsd32_dev_t) dev;
 };
 check_syscall_args(netbsd32_mknodat)
 

Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.104 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.105
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.104	Fri Mar 29 01:14:09 2013
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Thu Oct 17 18:04:40 2013
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.104 2013/03/29 01:14:09 christos Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.105 2013/10/17 18:04:40 njoly Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.97 2013/03/29 01:04:30 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.98 2013/10/17 18:01:11 njoly Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_syscalls.c,v 1.104 2013/03/29 01:14:09 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_syscalls.c,v 1.105 2013/10/17 18:04:40 njoly Exp $);
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
Index: src/sys/compat/netbsd32/netbsd32_sysent.c
diff -u src/sys/compat/netbsd32/netbsd32_sysent.c:1.104 src/sys/compat/netbsd32/netbsd32_sysent.c:1.105
--- src/sys/compat/netbsd32/netbsd32_sysent.c:1.104	Fri Mar 29 01:14:10 2013
+++ src/sys/compat/netbsd32/netbsd32_sysent.c	Thu Oct 17 18:04:40 2013
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_sysent.c,v 1.104 2013/03/29 01:14:10 christos Exp $ */
+/* $NetBSD: netbsd32_sysent.c,v 

CVS commit: src

2013-10-17 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Thu Oct 17 18:01:11 UTC 2013

Modified Files:
src/lib/libc/sys: Makefile.inc
src/sys/compat/netbsd32: netbsd32_fs.c syscalls.master
src/sys/kern: syscalls.master vfs_syscalls.c
src/sys/sys: stat.h
Added Files:
src/lib/libc/sys: mknodat.c

Log Message:
Change mknodat(2) device argument type from uint32_t to dev_t.
Adds needed extra PAD argument for 64bit alignment, and libc wrapper.


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/lib/libc/sys/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/sys/mknodat.c
cvs rdiff -u -r1.68 -r1.69 src/sys/compat/netbsd32/netbsd32_fs.c
cvs rdiff -u -r1.97 -r1.98 src/sys/compat/netbsd32/syscalls.master
cvs rdiff -u -r1.263 -r1.264 src/sys/kern/syscalls.master
cvs rdiff -u -r1.467 -r1.468 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.67 -r1.68 src/sys/sys/stat.h

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

Modified files:

Index: src/lib/libc/sys/Makefile.inc
diff -u src/lib/libc/sys/Makefile.inc:1.219 src/lib/libc/sys/Makefile.inc:1.220
--- src/lib/libc/sys/Makefile.inc:1.219	Fri Mar 29 02:10:53 2013
+++ src/lib/libc/sys/Makefile.inc	Thu Oct 17 18:01:11 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.219 2013/03/29 02:10:53 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.220 2013/10/17 18:01:11 njoly Exp $
 #	@(#)Makefile.inc	8.3 (Berkeley) 10/24/94
 
 # sys sources
@@ -31,7 +31,7 @@ SRCS+=	posix_fadvise.c posix_madvise.c s
 # glue to provide compatibility between GCC 1.X and 2.X and for compat
 # with old syscall interfaces.
 GLUE+= ftruncate.c lseek.c mmap.c pread.c preadv.c pwrite.c \
-	pwritev.c truncate.c ntp_adjtime.c
+	pwritev.c truncate.c ntp_adjtime.c mknodat.c
 
 GLUE50+= adjtime.c clock_settime.c settimeofday.c
 
@@ -108,7 +108,7 @@ ASM=	access.S acct.S \
 		_lwp_wakeup.S _lwp_detach.S _lwp_setprivate.S \
 		_lwp_setname.S _lwp_getname.S _lwp_ctl.S \
 	madvise.S mincore.S minherit.S mkdir.S mkdirat.S mkfifo.S mkfifoat.S \
-		__mknod50.S mknodat.S mlock.S mlockall.S modctl.S __mount50.S \
+		__mknod50.S mlock.S mlockall.S modctl.S __mount50.S \
 		mprotect.S __msgctl50.S msgget.S munlock.S munlockall.S \
 		munmap.S \
 	nfssvc.S __ntp_gettime50.S \

Index: src/sys/compat/netbsd32/netbsd32_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.68 src/sys/compat/netbsd32/netbsd32_fs.c:1.69
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.68	Tue Jul 30 17:22:31 2013
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Thu Oct 17 18:01:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.68 2013/07/30 17:22:31 njoly Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.69 2013/10/17 18:01:11 njoly Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.68 2013/07/30 17:22:31 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.69 2013/10/17 18:01:11 njoly Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1063,13 +1063,15 @@ netbsd32_mknodat(struct lwp *l, const st
 		syscallarg(int) fd;
 		syscallarg(netbsd32_charp) path;
 		syscallarg(mode_t) mode;
-		syscallarg(uint32_t) dev;
+		syscallarg(int) pad;
+		syscallarg(netbsd32_dev_t) dev;
 	} */
 	struct sys_mknodat_args ua;
 
 	NETBSD32TO64_UAP(fd);
 	NETBSD32TOP_UAP(path, const char);
 	NETBSD32TO64_UAP(mode);
+	NETBSD32TO64_UAP(PAD);
 	NETBSD32TO64_UAP(dev);
 
 	return sys_mknodat(l, ua, retval);

Index: src/sys/compat/netbsd32/syscalls.master
diff -u src/sys/compat/netbsd32/syscalls.master:1.97 src/sys/compat/netbsd32/syscalls.master:1.98
--- src/sys/compat/netbsd32/syscalls.master:1.97	Fri Mar 29 01:04:30 2013
+++ src/sys/compat/netbsd32/syscalls.master	Thu Oct 17 18:01:11 2013
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.97 2013/03/29 01:04:30 christos Exp $
+	$NetBSD: syscalls.master,v 1.98 2013/10/17 18:01:11 njoly Exp $
 
 ;	from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
@@ -976,8 +976,8 @@
 			mode_t mode); }
 460	STD  		{ int|netbsd32||mknodat(int fd, \
 			const netbsd32_charp path, \
-			mode_t mode, \
-			uint32_t dev); }
+			mode_t mode, int PAD, \
+			netbsd32_dev_t dev); }
 461	STD  		{ int|netbsd32||mkdirat(int fd, \
 			const netbsd32_charp path, \
 			mode_t mode); }

Index: src/sys/kern/syscalls.master
diff -u src/sys/kern/syscalls.master:1.263 src/sys/kern/syscalls.master:1.264
--- src/sys/kern/syscalls.master:1.263	Fri Aug 30 10:33:10 2013
+++ src/sys/kern/syscalls.master	Thu Oct 17 18:01:11 2013
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.263 2013/08/30 10:33:10 pooka Exp $
+	$NetBSD: syscalls.master,v 1.264 2013/10/17 18:01:11 njoly Exp $
 
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
 
@@ -902,7 +902,7 @@
 459	STD  RUMP	{ int|sys||mkfifoat(int fd, const char *path, \
 			mode_t mode); }
 460	STD  RUMP	{ int|sys||mknodat(int 

CVS commit: src/usr.sbin/ldpd

2013-10-17 Thread Mihai Chelaru
Module Name:src
Committed By:   kefren
Date:   Thu Oct 17 18:10:23 UTC 2013

Modified Files:
src/usr.sbin/ldpd: conffile.c conffile.h socketops.c

Log Message:
allow setting transport addresses for interfaces into config file
also move passive-interface functionality under interface block
report the correct line for config parsing errors


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/ldpd/conffile.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/ldpd/conffile.h
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/ldpd/socketops.c

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

Modified files:

Index: src/usr.sbin/ldpd/conffile.c
diff -u src/usr.sbin/ldpd/conffile.c:1.6 src/usr.sbin/ldpd/conffile.c:1.7
--- src/usr.sbin/ldpd/conffile.c:1.6	Thu Jul 11 10:46:19 2013
+++ src/usr.sbin/ldpd/conffile.c	Thu Oct 17 18:10:23 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: conffile.c,v 1.6 2013/07/11 10:46:19 kefren Exp $ */
+/* $NetBSD: conffile.c,v 1.7 2013/10/17 18:10:23 kefren Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -63,13 +63,21 @@ static int Fneighbour(char*);
 static int Gneighbour(struct conf_neighbour *, char *);
 static int Fnodefault(char*);
 static int Floopdetection(char*);
-static int Fpassiveif(char*);
+static int Finterface(char*);
+static int Ginterface(struct conf_interface *, char *);
+static int Ipassive(struct conf_interface *, char *);
+static int Itaddr(struct conf_interface *, char *);
 
 struct conf_func {
 	char com[64];
 	int (* func)(char *);
 };
 
+struct intf_func {
+	char com[64];
+	int (* func)(struct conf_interface *, char *);
+};
+
 struct conf_func main_commands[] = {
 	{ hello-time, Fhellotime },
 	{ keepalive-time, Fkeepalive },
@@ -77,26 +85,33 @@ struct conf_func main_commands[] = {
 	{ command-port, Fport },
 	{ min-label, Fminlabel },
 	{ max-label, Fmaxlabel },
-	{ LDP-ID, Fldpid },
+	{ ldp-id, Fldpid },
 	{ neighbor, Fneighbour },
 	{ neighbour, Fneighbour },
 	{ no-default-route, Fnodefault },
 	{ loop-detection, Floopdetection },
-	{ passive-if, Fpassiveif },
+	{ interface, Finterface },
 	{ , NULL },
 };
 
+struct intf_func intf_commands[] = {
+	{ passive, Ipassive },
+	{ transport-address, Itaddr },
+	{ , NULL },
+};
+
+static int parseline;
+
 /*
  * Parses config file
  */
 int
 conf_parsefile(const char *fname)
 {
-	int i;
 	char buf[LINEMAXSIZE + 1];
 
 	SLIST_INIT(conei_head);
-	SLIST_INIT(passifs_head);
+	SLIST_INIT(coifs_head);
 	conf_ldp_id.s_addr = 0;
 
 	confh = open(fname, O_RDONLY, 0);
@@ -104,10 +119,10 @@ conf_parsefile(const char *fname)
 	if (confh == -1)
 		return E_CONF_IO;
 
-	for (i = 1; conf_readline(buf, sizeof(buf)) = 0; i++)
+	for (parseline = 1; conf_readline(buf, sizeof(buf)) = 0; parseline++)
 		if (conf_dispatch(buf) != 0) {
 			close(confh);
-			return i;
+			return parseline;
 		}
 
 	close(confh);
@@ -155,7 +170,7 @@ conf_dispatch(char *line)
 	command = NextCommand(nline);
 	for (i = 0; main_commands[i].func != NULL; i++)
 		if (strncasecmp(main_commands[i].com, command,
-		strlen(command)) == 0) {
+		strlen(main_commands[i].com)) == 0) {
 			matched++;
 			last_match = i;
 		}
@@ -287,6 +302,7 @@ Fneighbour(char *line)
 	SLIST_INSERT_HEAD(conei_head, nei, neilist);
 
 	while (conf_readline(buf, sizeof(buf)) = 0) {
+		parseline++;
 		if (buf[0] == '}')
 			return 0;
 		if (Gneighbour(nei, buf) == -1)
@@ -328,15 +344,59 @@ Floopdetection(char *line)
 	return 0;
 }
 
+/*
+ * Interface sub-commands
+ */
 int
-Fpassiveif(char *line)
+Finterface(char *line)
 {
-	struct passive_if *pif;
+	char *ifname;
+	struct conf_interface *conf_if = calloc(1, sizeof(*conf_if));
+	char buf[1024];
 
-	if (strlen(line)  IF_NAMESIZE - 1)
-		return E_CONF_PARAM;
-	pif = calloc(1, sizeof(*pif));
-	strlcpy(pif-if_name, line, IF_NAMESIZE);
-	SLIST_INSERT_HEAD(passifs_head, pif, listentry);
+	ifname = NextCommand(line);
+	if (conf_if == NULL || ifname == NULL)
+		return -1;
+	strlcpy(conf_if-if_name, ifname, IF_NAMESIZE);
+	SLIST_INSERT_HEAD(coifs_head, conf_if, iflist);
+
+	while (conf_readline(buf, sizeof(buf)) = 0) {
+		parseline++;
+		if (buf[0] == '}')
+			return 0;
+		if (Ginterface(conf_if, buf) == -1)
+			return -1;
+	}
+	return -1;
+}
+
+int
+Ginterface(struct conf_interface *conf_if, char *buf)
+{
+	int i;
+
+	for (i = 0; intf_commands[i].func != NULL; i++)
+		if (strncasecmp(buf, intf_commands[i].com,
+		strlen(intf_commands[i].com)) == 0)
+			return intf_commands[i].func(conf_if, buf +
+			strlen(intf_commands[i].com) + 1);
+	/* command not found */
+	return -1;
+}
+
+/* sets transport address */
+int
+Itaddr(struct conf_interface *conf_if, char *buf)
+{
+	if (inet_pton(AF_INET, buf, conf_if-tr_addr) != 1)
+		return -1;
+	return 0;
+}
+
+/* sets passive-interface on */
+int
+Ipassive(struct conf_interface *conf_if, char *buf)
+{
+	conf_if-passive = 1;
 	return 0;
 }

Index: src/usr.sbin/ldpd/conffile.h
diff -u 

CVS commit: src/share/man/man3

2013-10-17 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Thu Oct 17 19:37:56 UTC 2013

Modified Files:
src/share/man/man3: __USE.3

Log Message:
- DPRINTF((val is %d\n, val)); - DPRINTF((val is %d\n, var));
- mdoclint:
  - .Nd should not end with period
  - remove trailing spaces


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man3/__USE.3

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

Modified files:

Index: src/share/man/man3/__USE.3
diff -u src/share/man/man3/__USE.3:1.1 src/share/man/man3/__USE.3:1.2
--- src/share/man/man3/__USE.3:1.1	Thu Oct 17 16:50:36 2013
+++ src/share/man/man3/__USE.3	Thu Oct 17 19:37:56 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: __USE.3,v 1.1 2013/10/17 16:50:36 christos Exp $
+.\	$NetBSD: __USE.3,v 1.2 2013/10/17 19:37:56 jnemeth Exp $
 .\
 .\ Copyright (c) 2013 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -29,7 +29,7 @@
 .Os
 .Sh NAME
 .Nm __USE
-.Nd compile time macro that marks a variable as being used.
+.Nd compile time macro that marks a variable as being used
 .Sh SYNOPSIS
 .In sys/cdefs.h
 .Ft void
@@ -54,7 +54,7 @@ foo(void) {
 
 	var = getval();
 
-	DPRINTF((val is %d\n, val));
+	DPRINTF((val is %d\n, var));
 }
 .Ed
 .Pp
@@ -67,7 +67,7 @@ foo(void) {
 
 	var = getval();
 
-	DPRINTF((val is %d\n, val));
+	DPRINTF((val is %d\n, var));
 #else
 	(void)getval();
 #endif
@@ -86,7 +86,7 @@ foo(void) {
 	var = getval();
 
 #ifdef DEBUG_FOO
-	DPRINTF((val is %d\n, val));
+	DPRINTF((val is %d\n, var));
 #else
 	__USE(var);
 #endif
@@ -117,6 +117,6 @@ is implemented as:
 should be used sparingly as it can cause valid warnings to be hidden.
 .Pp
 Use of this macro is non-portable; this is part of the implementation
-namespace and should only be used in 
+namespace and should only be used in
 .Nx
 code.



CVS commit: src/share/man/man3

2013-10-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Oct 17 20:43:49 UTC 2013

Modified Files:
src/share/man/man3: __CONCAT.3 __UNCONST.3

Log Message:
Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man3/__CONCAT.3
cvs rdiff -u -r1.6 -r1.7 src/share/man/man3/__UNCONST.3

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

Modified files:

Index: src/share/man/man3/__CONCAT.3
diff -u src/share/man/man3/__CONCAT.3:1.7 src/share/man/man3/__CONCAT.3:1.8
--- src/share/man/man3/__CONCAT.3:1.7	Thu Oct 17 16:50:48 2013
+++ src/share/man/man3/__CONCAT.3	Thu Oct 17 20:43:49 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: __CONCAT.3,v 1.7 2013/10/17 16:50:48 christos Exp $ $
+.\	$NetBSD: __CONCAT.3,v 1.8 2013/10/17 20:43:49 wiz Exp $ $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -103,6 +103,6 @@ comments to whitespace before any macros
 The use of either macro is discouraged in complex constructs.
 .Pp
 Use of this macro is non-portable; this is part of the implementation
-namespace and should only be used in 
+namespace and should only be used in
 .Nx
 code.

Index: src/share/man/man3/__UNCONST.3
diff -u src/share/man/man3/__UNCONST.3:1.6 src/share/man/man3/__UNCONST.3:1.7
--- src/share/man/man3/__UNCONST.3:1.6	Thu Oct 17 16:50:48 2013
+++ src/share/man/man3/__UNCONST.3	Thu Oct 17 20:43:49 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: __UNCONST.3,v 1.6 2013/10/17 16:50:48 christos Exp $
+.\	$NetBSD: __UNCONST.3,v 1.7 2013/10/17 20:43:49 wiz Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -83,6 +83,6 @@ pointer to
 .Xr memset 3 .
 .Pp
 Use of this macro is non-portable; this is part of the implementation
-namespace and should only be used in 
+namespace and should only be used in
 .Nx
 code.



CVS commit: src/sys/coda

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 20:54:24 UTC 2013

Modified Files:
src/sys/coda: coda_psdev.c

Log Message:
move module code inside module ifdef


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/coda/coda_psdev.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/coda/coda_psdev.c
diff -u src/sys/coda/coda_psdev.c:1.49 src/sys/coda/coda_psdev.c:1.50
--- src/sys/coda/coda_psdev.c:1.49	Sat Aug  4 08:31:57 2012
+++ src/sys/coda/coda_psdev.c	Thu Oct 17 16:54:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_psdev.c,v 1.49 2012/08/04 12:31:57 christos Exp $	*/
+/*	$NetBSD: coda_psdev.c,v 1.50 2013/10/17 20:54:24 christos Exp $	*/
 
 /*
  *
@@ -54,7 +54,7 @@
 /* These routines are the device entry points for Venus. */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_psdev.c,v 1.49 2012/08/04 12:31:57 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_psdev.c,v 1.50 2013/10/17 20:54:24 christos Exp $);
 
 extern int coda_nc_initialized;/* Set if cache has been initialized */
 
@@ -730,15 +730,15 @@ MODULE(MODULE_CLASS_DRIVER, vcoda, NULL)
 static int
 vcoda_modcmd(modcmd_t cmd, void *arg)
 {
-	int cmajor, dmajor, error = 0;
-
-	dmajor = cmajor = -1;
+	int error = 0;
 
 	switch (cmd) {
 	case MODULE_CMD_INIT:
 #ifdef _MODULE
+		int cmajor, dmajor;
 		vcodaattach(NVCODA);
 
+		dmajor = cmajor = -1;
 		return devsw_attach(vcoda, NULL, dmajor,
 		vcoda_cdevsw, cmajor);
 #endif



CVS commit: src/sys/coda

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 20:55:31 UTC 2013

Modified Files:
src/sys/coda: coda_vnops.c

Log Message:
remove unused code.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/coda/coda_vnops.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/coda/coda_vnops.c
diff -u src/sys/coda/coda_vnops.c:1.90 src/sys/coda/coda_vnops.c:1.91
--- src/sys/coda/coda_vnops.c:1.90	Thu Aug  2 12:06:58 2012
+++ src/sys/coda/coda_vnops.c	Thu Oct 17 16:55:30 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_vnops.c,v 1.90 2012/08/02 16:06:58 christos Exp $	*/
+/*	$NetBSD: coda_vnops.c,v 1.91 2013/10/17 20:55:30 christos Exp $	*/
 
 /*
  *
@@ -46,7 +46,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_vnops.c,v 1.90 2012/08/02 16:06:58 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_vnops.c,v 1.91 2013/10/17 20:55:30 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -897,7 +897,6 @@ coda_lookup(void *v)
 const char *nm = cnp-cn_nameptr;
 int len = cnp-cn_namelen;
 int flags = cnp-cn_flags;
-int isdot;
 CodaFid VFid;
 int	vtype;
 int error = 0;
@@ -937,13 +936,6 @@ coda_lookup(void *v)
 }
 
 /*
- * XXX Check for DOT lookups, and short circuit all the caches,
- * just doing an extra vref.  (venus guarantees that lookup of
- * . returns self.)
- */
-isdot = (len == 1  nm[0] == '.');
-
-/*
  * Try to resolve the lookup in the minicache.  If that fails, ask
  * venus to do the lookup.  XXX The interaction between vnode
  * locking and any locking that coda does is not clear.



CVS commit: src/sys/coda

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 20:56:02 UTC 2013

Modified Files:
src/sys/coda: coda_venus.c

Log Message:
remove unused code from macro


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/coda/coda_venus.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/coda/coda_venus.c
diff -u src/sys/coda/coda_venus.c:1.29 src/sys/coda/coda_venus.c:1.30
--- src/sys/coda/coda_venus.c:1.29	Wed Apr 25 23:04:54 2012
+++ src/sys/coda/coda_venus.c	Thu Oct 17 16:56:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_venus.c,v 1.29 2012/04/26 03:04:54 christos Exp $	*/
+/*	$NetBSD: coda_venus.c,v 1.30 2013/10/17 20:56:02 christos Exp $	*/
 
 /*
  *
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_venus.c,v 1.29 2012/04/26 03:04:54 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_venus.c,v 1.30 2013/10/17 20:56:02 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -79,7 +79,6 @@ __KERNEL_RCSID(0, $NetBSD: coda_venus.c
 
 #define DECL_NO_OUT(name)\
 struct name ## _in *inp;\
-struct coda_out_hdr *outp;\
 int name ## _size = sizeof (struct name ## _in);	\
 int Isize = sizeof (struct name ## _in);		\
 int Osize = sizeof (struct coda_out_hdr);		\
@@ -101,7 +100,6 @@ __KERNEL_RCSID(0, $NetBSD: coda_venus.c
 if (Osize  name ## _size)\
 	name ## _size = Osize;\
 CODA_ALLOC(inp, struct name ## _in *, name ## _size);\
-outp = (struct coda_out_hdr *) inp
 
 #define STRCPY(struc, name, len) \
 memcpy((char *)inp + (int)inp-struc, name, len); \



CVS commit: src/sys/kern

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 20:57:06 UTC 2013

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

Log Message:
initialize a variable, hi gcc again!


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 src/sys/kern/uipc_socket.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/uipc_socket.c
diff -u src/sys/kern/uipc_socket.c:1.218 src/sys/kern/uipc_socket.c:1.219
--- src/sys/kern/uipc_socket.c:1.218	Tue Oct  8 10:54:29 2013
+++ src/sys/kern/uipc_socket.c	Thu Oct 17 16:57:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.218 2013/10/08 14:54:29 seanb Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.219 2013/10/17 20:57:06 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.218 2013/10/08 14:54:29 seanb Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.219 2013/10/17 20:57:06 christos Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_sock_counters.h
@@ -1664,7 +1664,8 @@ sorflush(struct socket *so)
 static int
 sosetopt1(struct socket *so, const struct sockopt *sopt)
 {
-	int error = EINVAL, optval, opt;
+	int error = EINVAL, opt;
+	int optval = 0; /* XXX: gcc */
 	struct linger l;
 	struct timeval tv;
 



CVS commit: src/sys/arch/amd64/amd64

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 20:57:58 UTC 2013

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

Log Message:
remove unused variable, and move variable used only by XEN in the XEN ifdef.


To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/sys/arch/amd64/amd64/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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.195 src/sys/arch/amd64/amd64/machdep.c:1.196
--- src/sys/arch/amd64/amd64/machdep.c:1.195	Wed Jun  5 10:37:04 2013
+++ src/sys/arch/amd64/amd64/machdep.c	Thu Oct 17 16:57:58 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.195 2013/06/05 14:37:04 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.196 2013/10/17 20:57:58 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.195 2013/06/05 14:37:04 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.196 2013/10/17 20:57:58 christos Exp $);
 
 /* #define XENDEBUG_LOW  */
 
@@ -1051,7 +1051,6 @@ cpu_dump_mempagecnt(void)
 int
 cpu_dump(void)
 {
-	int (*dump)(dev_t, daddr_t, void *, size_t);
 	kcore_seg_t seg;
 	cpu_kcore_hdr_t cpuhdr;
 	const struct bdevsw *bdev;
@@ -1060,8 +1059,6 @@ cpu_dump(void)
 	if (bdev == NULL)
 		return (ENXIO);
 
-	dump = bdev-d_dump;
-
 	/*
 	 * Generate a segment header.
 	 */
@@ -1567,7 +1564,6 @@ init_x86_64(paddr_t first_avail)
 	extern void consinit(void);
 	struct region_descriptor region;
 	struct mem_segment_descriptor *ldt_segp;
-	struct pcb *pcb;
 	int x;
 #ifndef XEN
 	int ist;
@@ -1588,11 +1584,11 @@ init_x86_64(paddr_t first_avail)
 
 	cpu_init_msrs(cpu_info_primary, true);
 
-	pcb = lwp_getpcb(lwp0);
 
 	use_pae = 1; /* PAE always enabled in long mode */
 
 #ifdef XEN
+	struct pcb *pcb = lwp_getpcb(lwp0);
 	mutex_init(pte_lock, MUTEX_DEFAULT, IPL_VM);
 	pcb-pcb_cr3 = xen_start_info.pt_base - KERNBASE;
 	__PRINTK((pcb_cr3 0x%lx\n, xen_start_info.pt_base - KERNBASE));



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

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 20:59:16 UTC 2013

Modified Files:
src/sys/arch/x86/include: cpu.h pmap.h

Log Message:
__USE() unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/x86/include/pmap.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/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.53 src/sys/arch/x86/include/cpu.h:1.54
--- src/sys/arch/x86/include/cpu.h:1.53	Sat Oct 27 13:18:13 2012
+++ src/sys/arch/x86/include/cpu.h	Thu Oct 17 16:59:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.53 2012/10/27 17:18:13 chs Exp $	*/
+/*	$NetBSD: cpu.h,v 1.54 2013/10/17 20:59:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -287,7 +287,7 @@ extern struct cpu_info cpu_info_primary;
 extern struct cpu_info *cpu_info_list;
 
 #define	CPU_INFO_ITERATOR		int
-#define	CPU_INFO_FOREACH(cii, ci)	cii = 0, ci = cpu_info_list; \
+#define	CPU_INFO_FOREACH(cii, ci)	__USE(cii), ci = cpu_info_list; \
 	ci != NULL; ci = ci-ci_next
 
 #define CPU_STARTUP(_ci, _target)	((_ci)-ci_func-start(_ci, _target))

Index: src/sys/arch/x86/include/pmap.h
diff -u src/sys/arch/x86/include/pmap.h:1.54 src/sys/arch/x86/include/pmap.h:1.55
--- src/sys/arch/x86/include/pmap.h:1.54	Sun Jun 23 19:49:28 2013
+++ src/sys/arch/x86/include/pmap.h	Thu Oct 17 16:59:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.54 2013/06/23 23:49:28 uebayasi Exp $	*/
+/*	$NetBSD: pmap.h,v 1.55 2013/10/17 20:59:16 christos Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -219,7 +219,7 @@ extern long nkptp[PTP_LEVELS];
 
 #define pmap_clear_modify(pg)		pmap_clear_attrs(pg, PG_M)
 #define pmap_clear_reference(pg)	pmap_clear_attrs(pg, PG_U)
-#define pmap_copy(DP,SP,D,L,S)
+#define pmap_copy(DP,SP,D,L,S)		__USE(L)
 #define pmap_is_modified(pg)		pmap_test_attrs(pg, PG_M)
 #define pmap_is_referenced(pg)		pmap_test_attrs(pg, PG_U)
 #define pmap_move(DP,SP,D,L,S)



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

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 20:58:55 UTC 2013

Modified Files:
src/sys/arch/x86/x86: ipmi.c

Log Message:
__USE a debugging variable


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/x86/x86/ipmi.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/ipmi.c
diff -u src/sys/arch/x86/x86/ipmi.c:1.55 src/sys/arch/x86/x86/ipmi.c:1.56
--- src/sys/arch/x86/x86/ipmi.c:1.55	Mon Aug 12 11:40:34 2013
+++ src/sys/arch/x86/x86/ipmi.c	Thu Oct 17 16:58:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipmi.c,v 1.55 2013/08/12 15:40:34 yamt Exp $ */
+/*	$NetBSD: ipmi.c,v 1.56 2013/10/17 20:58:55 christos Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ipmi.c,v 1.55 2013/08/12 15:40:34 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: ipmi.c,v 1.56 2013/10/17 20:58:55 christos Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -788,6 +788,8 @@ kcs_probe(struct ipmi_softc *sc)
 	printf( C/D: %2x\n, v  KCS_CD);
 	printf( IBF: %2x\n, v  KCS_IBF);
 	printf( OBF: %2x\n, v  KCS_OBF);
+#else
+	__USE(v);
 #endif
 	return (0);
 }



CVS commit: src/sys/ufs/lfs

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:01:08 UTC 2013

Modified Files:
src/sys/ufs/lfs: lfs_inode.c lfs_segment.c lfs_vfsops.c lfs_vnops.c
ulfs_bswap.h ulfs_lookup.c ulfs_readwrite.c

Log Message:
- remove unused variables
- add debug ifdefs for debugging variables
- __USE() where appropriate.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/ufs/lfs/lfs_inode.c
cvs rdiff -u -r1.231 -r1.232 src/sys/ufs/lfs/lfs_segment.c
cvs rdiff -u -r1.314 -r1.315 src/sys/ufs/lfs/lfs_vfsops.c
cvs rdiff -u -r1.257 -r1.258 src/sys/ufs/lfs/lfs_vnops.c
cvs rdiff -u -r1.4 -r1.5 src/sys/ufs/lfs/ulfs_bswap.h
cvs rdiff -u -r1.15 -r1.16 src/sys/ufs/lfs/ulfs_lookup.c
cvs rdiff -u -r1.6 -r1.7 src/sys/ufs/lfs/ulfs_readwrite.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/ufs/lfs/lfs_inode.c
diff -u src/sys/ufs/lfs/lfs_inode.c:1.135 src/sys/ufs/lfs/lfs_inode.c:1.136
--- src/sys/ufs/lfs/lfs_inode.c:1.135	Sat Jul 27 21:25:06 2013
+++ src/sys/ufs/lfs/lfs_inode.c	Thu Oct 17 17:01:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_inode.c,v 1.135 2013/07/28 01:25:06 dholland Exp $	*/
+/*	$NetBSD: lfs_inode.c,v 1.136 2013/10/17 21:01:08 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: lfs_inode.c,v 1.135 2013/07/28 01:25:06 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: lfs_inode.c,v 1.136 2013/10/17 21:01:08 christos Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_quota.h
@@ -627,13 +627,11 @@ static int
 lfs_update_seguse(struct lfs *fs, struct inode *ip, long lastseg, size_t num)
 {
 	struct segdelta *sd;
-	struct vnode *vp;
 
 	ASSERT_SEGLOCK(fs);
 	if (lastseg  0 || num == 0)
 		return 0;
 
-	vp = ITOV(ip);
 	LIST_FOREACH(sd, ip-i_lfs_segdhd, list)
 		if (sd-segnum == lastseg)
 			break;

Index: src/sys/ufs/lfs/lfs_segment.c
diff -u src/sys/ufs/lfs/lfs_segment.c:1.231 src/sys/ufs/lfs/lfs_segment.c:1.232
--- src/sys/ufs/lfs/lfs_segment.c:1.231	Sat Jul 27 21:05:52 2013
+++ src/sys/ufs/lfs/lfs_segment.c	Thu Oct 17 17:01:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_segment.c,v 1.231 2013/07/28 01:05:52 dholland Exp $	*/
+/*	$NetBSD: lfs_segment.c,v 1.232 2013/10/17 21:01:08 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: lfs_segment.c,v 1.231 2013/07/28 01:05:52 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: lfs_segment.c,v 1.232 2013/10/17 21:01:08 christos Exp $);
 
 #ifdef DEBUG
 # define vndebug(vp, str) do {		\
@@ -195,7 +195,6 @@ lfs_vflush(struct vnode *vp)
 	int error;
 	int flushed;
 	int relock;
-	int loopcount;
 
 	ip = VTOI(vp);
 	fs = VFSTOULFS(vp-v_mount)-um_lfs;
@@ -382,7 +381,9 @@ lfs_vflush(struct vnode *vp)
 #endif
 
 	do {
-		loopcount = 0;
+#ifdef DEBUG
+		int loopcount = 0;
+#endif
 		do {
 			if (LIST_FIRST(vp-v_dirtyblkhd) != NULL) {
 relock = lfs_writefile(fs, sp, vp);
@@ -623,7 +624,6 @@ lfs_segwrite(struct mount *mp, int flags
 	int dirty;
 	int redo;
 	int um_error;
-	int loopcount;
 
 	fs = VFSTOULFS(mp)-um_lfs;
 	ASSERT_MAYBE_SEGLOCK(fs);
@@ -734,7 +734,9 @@ lfs_segwrite(struct mount *mp, int flags
 	did_ckp = 0;
 	if (do_ckp || fs-lfs_doifile) {
 		vp = fs-lfs_ivnode;
-		loopcount = 0;
+#ifdef DEBUG
+		int loopcount = 0;
+#endif
 		do {
 #ifdef DEBUG
 			LFS_ENTER_LOG(pretend, __FILE__, __LINE__, 0, 0, curproc-p_pid);
@@ -844,7 +846,6 @@ lfs_segwrite(struct mount *mp, int flags
 int
 lfs_writefile(struct lfs *fs, struct segment *sp, struct vnode *vp)
 {
-	struct finfo *fip;
 	struct inode *ip;
 	int i, frag;
 	int error;
@@ -853,7 +854,6 @@ lfs_writefile(struct lfs *fs, struct seg
 	error = 0;
 	ip = VTOI(vp);
 
-	fip = sp-fip;
 	lfs_acquire_finfo(fs, ip-i_number, ip-i_gen);
 
 	if (vp-v_uflag  VU_DIROP)
@@ -923,7 +923,6 @@ lfs_writefile(struct lfs *fs, struct seg
 		lfs_gather(fs, sp, vp, lfs_match_dindir);
 		lfs_gather(fs, sp, vp, lfs_match_tindir);
 	}
-	fip = sp-fip;
 	lfs_release_finfo(fs);
 
 	return error;
@@ -940,7 +939,7 @@ lfs_update_iaddr(struct lfs *fs, struct 
 	IFILE *ifp;
 	SEGUSE *sup;
 	ino_t ino;
-	int redo_ifile, error;
+	int redo_ifile;
 	u_int32_t sn;
 
 	redo_ifile = 0;
@@ -957,7 +956,7 @@ lfs_update_iaddr(struct lfs *fs, struct 
 		LFS_IENTRY(ifp, fs, ino, bp);
 		daddr = ifp-if_daddr;
 		ifp-if_daddr = LFS_DBTOFSB(fs, ndaddr);
-		error = LFS_BWRITE_LOG(bp); /* Ifile */
+		(void)LFS_BWRITE_LOG(bp); /* Ifile */
 	}
 
 	/*

Index: src/sys/ufs/lfs/lfs_vfsops.c
diff -u src/sys/ufs/lfs/lfs_vfsops.c:1.314 src/sys/ufs/lfs/lfs_vfsops.c:1.315
--- src/sys/ufs/lfs/lfs_vfsops.c:1.314	Mon Sep 30 14:58:00 2013
+++ src/sys/ufs/lfs/lfs_vfsops.c	Thu Oct 17 17:01:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_vfsops.c,v 1.314 2013/09/30 18:58:00 hannken Exp $	*/
+/*	$NetBSD: lfs_vfsops.c,v 

CVS commit: src/sys/fs/puffs

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:03:27 UTC 2013

Modified Files:
src/sys/fs/puffs: puffs_msgif.c puffs_node.c puffs_sys.h puffs_vnops.c

Log Message:
- remove unused variables
- add _NOERROR flavor macros for the case where errors are ignored.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -u -r1.29 -r1.30 src/sys/fs/puffs/puffs_node.c
cvs rdiff -u -r1.83 -r1.84 src/sys/fs/puffs/puffs_sys.h
cvs rdiff -u -r1.176 -r1.177 src/sys/fs/puffs/puffs_vnops.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/puffs/puffs_msgif.c
diff -u src/sys/fs/puffs/puffs_msgif.c:1.93 src/sys/fs/puffs/puffs_msgif.c:1.94
--- src/sys/fs/puffs/puffs_msgif.c:1.93	Mon Nov  5 12:27:38 2012
+++ src/sys/fs/puffs/puffs_msgif.c	Thu Oct 17 17:03:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_msgif.c,v 1.93 2012/11/05 17:27:38 dholland Exp $	*/
+/*	$NetBSD: puffs_msgif.c,v 1.94 2013/10/17 21:03:27 christos Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_msgif.c,v 1.93 2012/11/05 17:27:38 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_msgif.c,v 1.94 2013/10/17 21:03:27 christos Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -336,7 +336,6 @@ void
 puffs_msg_enqueue(struct puffs_mount *pmp, struct puffs_msgpark *park)
 {
 	struct lwp *l = curlwp;
-	struct mount *mp;
 	struct puffs_req *preq, *creq;
 	ssize_t delta;
 
@@ -348,7 +347,6 @@ puffs_msg_enqueue(struct puffs_mount *pm
 	park-park_flags = ~(PARKFLAG_DONE | PARKFLAG_HASERROR);
 	KASSERT((park-park_flags  PARKFLAG_WAITERGONE) == 0);
 
-	mp = PMPTOMP(pmp);
 	preq = park-park_preq;
 
 #if 1
@@ -1218,7 +1216,6 @@ puffs_userdead(struct puffs_mount *pmp)
 
 	/* signal waiters on REQUEST TO file server queue */
 	for (park = TAILQ_FIRST(pmp-pmp_msg_touser); park; park = park_next) {
-		uint8_t opclass;
 
 		mutex_enter(park-park_mtx);
 		puffs_msgpark_reference(park);
@@ -1242,7 +1239,6 @@ puffs_userdead(struct puffs_mount *pmp)
 			puffs_msgpark_release(park);
 
 		} else {
-			opclass = park-park_preq-preq_opclass;
 			park-park_preq-preq_rv = ENXIO;
 
 			if (park-park_flags  PARKFLAG_CALL) {

Index: src/sys/fs/puffs/puffs_node.c
diff -u src/sys/fs/puffs/puffs_node.c:1.29 src/sys/fs/puffs/puffs_node.c:1.30
--- src/sys/fs/puffs/puffs_node.c:1.29	Wed Mar  6 06:40:22 2013
+++ src/sys/fs/puffs/puffs_node.c	Thu Oct 17 17:03:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_node.c,v 1.29 2013/03/06 11:40:22 yamt Exp $	*/
+/*	$NetBSD: puffs_node.c,v 1.30 2013/10/17 21:03:27 christos Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_node.c,v 1.29 2013/03/06 11:40:22 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_node.c,v 1.30 2013/10/17 21:03:27 christos Exp $);
 
 #include sys/param.h
 #include sys/hash.h
@@ -256,10 +256,8 @@ puffs_newnode(struct mount *mp, struct v
 void
 puffs_putvnode(struct vnode *vp)
 {
-	struct puffs_mount *pmp;
 	struct puffs_node *pnode;
 
-	pmp = VPTOPUFFSMP(vp);
 	pnode = VPTOPP(vp);
 
 #ifdef DIAGNOSTIC

Index: src/sys/fs/puffs/puffs_sys.h
diff -u src/sys/fs/puffs/puffs_sys.h:1.83 src/sys/fs/puffs/puffs_sys.h:1.84
--- src/sys/fs/puffs/puffs_sys.h:1.83	Wed Mar  6 06:39:37 2013
+++ src/sys/fs/puffs/puffs_sys.h	Thu Oct 17 17:03:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_sys.h,v 1.83 2013/03/06 11:39:37 yamt Exp $	*/
+/*	$NetBSD: puffs_sys.h,v 1.84 2013/10/17 21:03:27 christos Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006  Antti Kantee.  All Rights Reserved.
@@ -95,7 +95,7 @@ extern int puffsdebug; /* puffs_subr.c *
 #define PUFFS_USE_DOTDOTCACHE(pmp)	\
 ((pmp)-pmp_flags  PUFFS_KFLAG_CACHE_DOTDOT)
 
-#define PUFFS_WCACHEINFO(pmp)	0
+#define PUFFS_WCACHEINFO(pmp)	(__USE(pmp), 0)
 
 struct puffs_newcookie {
 	puffs_cookie_t	pnc_cookie;
@@ -338,6 +338,18 @@ do {	\
 	if (park_##a) puffs_msgmem_release(park_##a);			\
 } while (/*CONSTCOND*/0)
 
+#define PUFFS_MSG_ENQUEUEWAIT_NOERROR(pmp, park)			\
+do {	\
+	puffs_msg_enqueue(pmp, park);	\
+	puffs_msg_wait(pmp, park);	\
+} while (/*CONSTCOND*/0)
+
+#define PUFFS_MSG_ENQUEUEWAIT2_NOERROR(pmp, park, vp1, vp2)		\
+do {	\
+	puffs_msg_enqueue(pmp, park);	\
+	puffs_msg_wait2(pmp, park, vp1, vp2);\
+} while (/*CONSTCOND*/0)
+
 #define PUFFS_MSG_ENQUEUEWAIT(pmp, park, var)\
 do {	\
 	puffs_msg_enqueue(pmp, park);	\

Index: src/sys/fs/puffs/puffs_vnops.c
diff -u src/sys/fs/puffs/puffs_vnops.c:1.176 src/sys/fs/puffs/puffs_vnops.c:1.177
--- src/sys/fs/puffs/puffs_vnops.c:1.176	Mon Nov  5 12:27:38 2012
+++ src/sys/fs/puffs/puffs_vnops.c	Thu Oct 17 17:03:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vnops.c,v 1.176 2012/11/05 17:27:38 dholland Exp $	

CVS commit: src/sys/fs/ntfs

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:04:12 UTC 2013

Modified Files:
src/sys/fs/ntfs: ntfs_vfsops.c

Log Message:
remove unused code


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/fs/ntfs/ntfs_vfsops.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/ntfs/ntfs_vfsops.c
diff -u src/sys/fs/ntfs/ntfs_vfsops.c:1.88 src/sys/fs/ntfs/ntfs_vfsops.c:1.89
--- src/sys/fs/ntfs/ntfs_vfsops.c:1.88	Mon Sep 30 14:58:00 2013
+++ src/sys/fs/ntfs/ntfs_vfsops.c	Thu Oct 17 17:04:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntfs_vfsops.c,v 1.88 2013/09/30 18:58:00 hannken Exp $	*/
+/*	$NetBSD: ntfs_vfsops.c,v 1.89 2013/10/17 21:04:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 Semen Ustimenko
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ntfs_vfsops.c,v 1.88 2013/09/30 18:58:00 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: ntfs_vfsops.c,v 1.89 2013/10/17 21:04:12 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -307,7 +307,7 @@ ntfs_mountfs(struct vnode *devvp, struct
 	struct buf *bp;
 	struct ntfsmount *ntmp;
 	dev_t dev = devvp-v_rdev;
-	int error, ronly, i;
+	int error, i;
 	struct vnode *vp;
 
 	ntmp = NULL;
@@ -321,8 +321,6 @@ ntfs_mountfs(struct vnode *devvp, struct
 	if (error)
 		return (error);
 
-	ronly = (mp-mnt_flag  MNT_RDONLY) != 0;
-
 	bp = NULL;
 
 	error = bread(devvp, BBLOCK, BBSIZE, NOCRED, 0, bp);



CVS commit: src/sys/fs/union

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:03:50 UTC 2013

Modified Files:
src/sys/fs/union: union_subr.c

Log Message:
remove unused code


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/fs/union/union_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/union/union_subr.c
diff -u src/sys/fs/union/union_subr.c:1.56 src/sys/fs/union/union_subr.c:1.57
--- src/sys/fs/union/union_subr.c:1.56	Mon Nov  5 12:24:11 2012
+++ src/sys/fs/union/union_subr.c	Thu Oct 17 17:03:50 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_subr.c,v 1.56 2012/11/05 17:24:11 dholland Exp $	*/
+/*	$NetBSD: union_subr.c,v 1.57 2013/10/17 21:03:50 christos Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -72,7 +72,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.56 2012/11/05 17:24:11 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.57 2013/10/17 21:03:50 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -598,11 +598,8 @@ found:
 int
 union_freevp(struct vnode *vp)
 {
-	int hash;
 	struct union_node *un = VTOUNION(vp);
 
-	hash = UNION_HASH(un-un_uppervp, un-un_lowervp);
-
 	mutex_enter(uhash_lock);
 	if (un-un_cflags  UN_CACHED) {
 		un-un_cflags = ~UN_CACHED;
@@ -961,7 +958,6 @@ void
 union_removed_upper(struct union_node *un)
 {
 	struct vnode *vp = UNIONTOV(un);
-	int hash;
 
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 #if 1
@@ -979,7 +975,6 @@ union_removed_upper(struct union_node *u
 	union_newupper(un, NULLVP);
 #endif
 
-	hash = UNION_HASH(un-un_uppervp, un-un_lowervp);
 	VOP_UNLOCK(vp);
 
 	mutex_enter(uhash_lock);



CVS commit: src/sys/fs/smbfs

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:04:44 UTC 2013

Modified Files:
src/sys/fs/smbfs: smbfs_kq.c smbfs_vfsops.c

Log Message:
remove usused code


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/fs/smbfs/smbfs_kq.c
cvs rdiff -u -r1.95 -r1.96 src/sys/fs/smbfs/smbfs_vfsops.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/smbfs/smbfs_kq.c
diff -u src/sys/fs/smbfs/smbfs_kq.c:1.25 src/sys/fs/smbfs/smbfs_kq.c:1.26
--- src/sys/fs/smbfs/smbfs_kq.c:1.25	Fri Jan 27 14:48:40 2012
+++ src/sys/fs/smbfs/smbfs_kq.c	Thu Oct 17 17:04:44 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: smbfs_kq.c,v 1.25 2012/01/27 19:48:40 para Exp $	*/
+/*	$NetBSD: smbfs_kq.c,v 1.26 2013/10/17 21:04:44 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: smbfs_kq.c,v 1.25 2012/01/27 19:48:40 para Exp $);
+__KERNEL_RCSID(0, $NetBSD: smbfs_kq.c,v 1.26 2013/10/17 21:04:44 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -387,7 +387,6 @@ filt_smbfsvnode(struct knote *kn, long h
 {
 	struct kevq *ke = (struct kevq *)kn-kn_hook;
 	struct vnode *vp = ke-vp;
-	int fflags;
 
 	switch (hint) {
 	case NOTE_REVOKE:
@@ -398,14 +397,12 @@ filt_smbfsvnode(struct knote *kn, long h
 		return (1);
 	case 0:
 		mutex_enter(vp-v_interlock);
-		fflags = kn-kn_fflags;
 		mutex_exit(vp-v_interlock);
 		break;
 	default:
 		KASSERT(mutex_owned(vp-v_interlock));
 		if ((kn-kn_sfflags  hint) != 0)
 			kn-kn_fflags |= hint;
-		fflags = kn-kn_fflags;
 		break;
 	}
 

Index: src/sys/fs/smbfs/smbfs_vfsops.c
diff -u src/sys/fs/smbfs/smbfs_vfsops.c:1.95 src/sys/fs/smbfs/smbfs_vfsops.c:1.96
--- src/sys/fs/smbfs/smbfs_vfsops.c:1.95	Fri Oct  7 05:35:05 2011
+++ src/sys/fs/smbfs/smbfs_vfsops.c	Thu Oct 17 17:04:44 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: smbfs_vfsops.c,v 1.95 2011/10/07 09:35:05 hannken Exp $	*/
+/*	$NetBSD: smbfs_vfsops.c,v 1.96 2013/10/17 21:04:44 christos Exp $	*/
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: smbfs_vfsops.c,v 1.95 2011/10/07 09:35:05 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: smbfs_vfsops.c,v 1.96 2013/10/17 21:04:44 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -160,14 +160,12 @@ smbfs_mount(struct mount *mp, const char
 	struct smb_vc *vcp;
 	struct smb_share *ssp = NULL;
 	struct smb_cred scred;
-	struct proc *p;
 	char *fromname;
 	int error;
 
 	if (*data_len  sizeof *args)
 		return EINVAL;
 
-	p = l-l_proc;
 	if (mp-mnt_flag  MNT_GETARGS) {
 		smp = VFSTOSMBFS(mp);
 		if (smp == NULL)



CVS commit: src/sys/dev/pci

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:05:41 UTC 2013

Modified Files:
src/sys/dev/pci: yds.c

Log Message:
__USE a debugging var


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/pci/yds.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/dev/pci/yds.c
diff -u src/sys/dev/pci/yds.c:1.53 src/sys/dev/pci/yds.c:1.54
--- src/sys/dev/pci/yds.c:1.53	Mon Jan 30 14:41:23 2012
+++ src/sys/dev/pci/yds.c	Thu Oct 17 17:05:41 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: yds.c,v 1.53 2012/01/30 19:41:23 drochner Exp $	*/
+/*	$NetBSD: yds.c,v 1.54 2013/10/17 21:05:41 christos Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 Kazuki Sakamoto and Minoura Makoto.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: yds.c,v 1.53 2012/01/30 19:41:23 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: yds.c,v 1.54 2013/10/17 21:05:41 christos Exp $);
 
 #include mpu.h
 
@@ -421,6 +421,9 @@ yds_allocate_slots(struct yds_softc *sc)
 	DPRINTF((play control size : %d\n, (unsigned int)pcs));
 	DPRINTF((rec control size : %d\n, (unsigned int)rcs));
 	DPRINTF((eff control size : %d\n, (unsigned int)ecs));
+#ifndef AUDIO_DEBUG
+	__USE(ecs);
+#endif
 	DPRINTF((work size : %d\n, (unsigned int)ws));
 #ifdef DIAGNOSTIC
 	if (pcs != sizeof(struct play_slot_ctrl_bank)) {



CVS commit: src/sys/dev/pcmcia

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:06:47 UTC 2013

Modified Files:
src/sys/dev/pcmcia: if_ne_pcmcia.c

Log Message:
remove unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/dev/pcmcia/if_ne_pcmcia.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/dev/pcmcia/if_ne_pcmcia.c
diff -u src/sys/dev/pcmcia/if_ne_pcmcia.c:1.159 src/sys/dev/pcmcia/if_ne_pcmcia.c:1.160
--- src/sys/dev/pcmcia/if_ne_pcmcia.c:1.159	Fri Nov 25 21:20:29 2011
+++ src/sys/dev/pcmcia/if_ne_pcmcia.c	Thu Oct 17 17:06:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ne_pcmcia.c,v 1.159 2011/11/26 02:20:29 nonaka Exp $	*/
+/*	$NetBSD: if_ne_pcmcia.c,v 1.160 2013/10/17 21:06:47 christos Exp $	*/
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ne_pcmcia.c,v 1.159 2011/11/26 02:20:29 nonaka Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ne_pcmcia.c,v 1.160 2013/10/17 21:06:47 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -583,7 +583,6 @@ ne_pcmcia_attach(device_t parent, device
 	const struct ne2000dev *ne_dev;
 	int i;
 	u_int8_t myea[6], *enaddr;
-	const char *typestr = ;
 	int error;
 
 	aprint_naive(\n);
@@ -628,7 +627,6 @@ ne_pcmcia_attach(device_t parent, device
 	i = 0;
 again:
 	enaddr = NULL;			/* Ask ASIC by default */
-	typestr = ;			/* clear previous card-type */
 	for (; i  NE2000_NDEVS; i++) {
 		ne_dev = ne2000_match(pa-card, pa-pf-number, i);
 		if (ne_dev != NULL) {
@@ -669,10 +667,8 @@ found:
 		type = bus_space_read_1(nsc-sc_asict, nsc-sc_asich, 0x0f);
 		if (type == 0x91 || type == 0x99) {
 			nsc-sc_type = NE2000_TYPE_DL10022;
-			typestr =  (DL10022);
 		} else {
 			nsc-sc_type = NE2000_TYPE_DL10019;
-			typestr =  (DL10019);
 		}
 	}
 
@@ -695,10 +691,8 @@ found:
 		test = bus_space_read_1(nsc-sc_asict, nsc-sc_asich, 0x05);
 		if (test != 0) {
 			nsc-sc_type = NE2000_TYPE_AX88790;
-			typestr =  (AX88790);
 		} else {
 			nsc-sc_type = NE2000_TYPE_AX88190;
-			typestr =  (AX88190);
 		}
 	}
 
@@ -725,7 +719,6 @@ found:
 		NERTL_RTL0_8019ID0) == RTL0_8019ID0 
 		bus_space_read_1(dsc-sc_regt, dsc-sc_regh,
 		NERTL_RTL0_8019ID1) == RTL0_8019ID1) {
-			typestr =  (RTL8019);
 			dsc-sc_mediachange = rtl80x9_mediachange;
 			dsc-sc_mediastatus = rtl80x9_mediastatus;
 			dsc-init_card = rtl80x9_init_card;



CVS commit: src/sys/dev/pci

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:06:15 UTC 2013

Modified Files:
src/sys/dev/pci: if_dge.c if_ipw.c if_iwi.c if_iwn.c if_jme.c ld_twa.c
mly.c mpii.c pccbb.c twa.c viomb.c weasel_pci.c

Log Message:
- remove unused variables
- move debugging code inside debugging sections


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/if_dge.c
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/pci/if_ipw.c
cvs rdiff -u -r1.92 -r1.93 src/sys/dev/pci/if_iwi.c
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/pci/if_iwn.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/if_jme.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/ld_twa.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/pci/mly.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/mpii.c
cvs rdiff -u -r1.204 -r1.205 src/sys/dev/pci/pccbb.c
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pci/twa.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/viomb.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/weasel_pci.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/dev/pci/if_dge.c
diff -u src/sys/dev/pci/if_dge.c:1.35 src/sys/dev/pci/if_dge.c:1.36
--- src/sys/dev/pci/if_dge.c:1.35	Sat Oct 27 13:18:32 2012
+++ src/sys/dev/pci/if_dge.c	Thu Oct 17 17:06:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_dge.c,v 1.35 2012/10/27 17:18:32 chs Exp $ */
+/*	$NetBSD: if_dge.c,v 1.36 2013/10/17 21:06:15 christos Exp $ */
 
 /*
  * Copyright (c) 2004, SUNET, Swedish University Computer Network.
@@ -80,7 +80,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_dge.c,v 1.35 2012/10/27 17:18:32 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_dge.c,v 1.36 2013/10/17 21:06:15 christos Exp $);
 
 
 
@@ -473,7 +473,7 @@ struct rxbugentry {
 static int
 dge_alloc_rcvmem(struct dge_softc *sc)
 {
-	char *ptr, *kva;
+	char *kva;
 	bus_dma_segment_t seg;
 	int i, rseg, state, error;
 	struct rxbugentry *entry;
@@ -519,7 +519,6 @@ dge_alloc_rcvmem(struct dge_softc *sc)
 	 * Now divide it up into DGE_BUFFER_SIZE pieces and save the addresses
 	 * in an array.
 	 */
-	ptr = sc-sc_bugbuf;
 	if ((entry = malloc(sizeof(*entry) * DGE_NBUFFERS,
 	M_DEVBUF, M_NOWAIT)) == NULL) {
 		error = ENOBUFS;

Index: src/sys/dev/pci/if_ipw.c
diff -u src/sys/dev/pci/if_ipw.c:1.54 src/sys/dev/pci/if_ipw.c:1.55
--- src/sys/dev/pci/if_ipw.c:1.54	Sat Oct 27 13:18:32 2012
+++ src/sys/dev/pci/if_ipw.c	Thu Oct 17 17:06:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ipw.c,v 1.54 2012/10/27 17:18:32 chs Exp $	*/
+/*	$NetBSD: if_ipw.c,v 1.55 2013/10/17 21:06:15 christos Exp $	*/
 /*	FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp 	*/
 
 /*-
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ipw.c,v 1.54 2012/10/27 17:18:32 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ipw.c,v 1.55 2013/10/17 21:06:15 christos Exp $);
 
 /*-
  * Intel(R) PRO/Wireless 2100 MiniPCI driver
@@ -886,16 +886,17 @@ ipw_read_prom_word(struct ipw_softc *sc,
 static void
 ipw_command_intr(struct ipw_softc *sc, struct ipw_soft_buf *sbuf)
 {
-	struct ipw_cmd *cmd;
 
 	bus_dmamap_sync(sc-sc_dmat, sbuf-map, 0, sizeof (struct ipw_cmd),
 	BUS_DMASYNC_POSTREAD);
 
-	cmd = mtod(sbuf-m, struct ipw_cmd *);
+#ifdef IPW_DEBUG
+	struct ipw_cmd *cmd = mtod(sbuf-m, struct ipw_cmd *);
 
 	DPRINTFN(2, (cmd ack'ed (%u, %u, %u, %u, %u)\n, le32toh(cmd-type),
 	le32toh(cmd-subtype), le32toh(cmd-seq), le32toh(cmd-len),
 	le32toh(cmd-status)));
+#endif
 
 	wakeup(sc-cmd);
 }
@@ -1152,7 +1153,6 @@ ipw_rx_intr(struct ipw_softc *sc)
 static void
 ipw_release_sbd(struct ipw_softc *sc, struct ipw_soft_bd *sbd)
 {
-	struct ieee80211com *ic;
 	struct ipw_soft_hdr *shdr;
 	struct ipw_soft_buf *sbuf;
 
@@ -1171,7 +1171,6 @@ ipw_release_sbd(struct ipw_softc *sc, st
 		break;
 
 	case IPW_SBD_TYPE_DATA:
-		ic = sc-sc_ic;
 		sbuf = sbd-priv;
 
 		bus_dmamap_sync(sc-sc_dmat, sbuf-map,

Index: src/sys/dev/pci/if_iwi.c
diff -u src/sys/dev/pci/if_iwi.c:1.92 src/sys/dev/pci/if_iwi.c:1.93
--- src/sys/dev/pci/if_iwi.c:1.92	Fri Mar 29 23:21:05 2013
+++ src/sys/dev/pci/if_iwi.c	Thu Oct 17 17:06:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwi.c,v 1.92 2013/03/30 03:21:05 christos Exp $  */
+/*	$NetBSD: if_iwi.c,v 1.93 2013/10/17 21:06:15 christos Exp $  */
 /*	$OpenBSD: if_iwi.c,v 1.111 2010/11/15 19:11:57 damien Exp $	*/
 
 /*-
@@ -19,7 +19,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_iwi.c,v 1.92 2013/03/30 03:21:05 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_iwi.c,v 1.93 2013/10/17 21:06:15 christos Exp $);
 
 /*-
  * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
@@ -1233,25 +1233,29 @@ static void
 iwi_notification_intr(struct iwi_softc *sc, struct iwi_notif *notif)
 {
 	struct ieee80211com *ic = sc-sc_ic;
-	struct iwi_notif_scan_channel *chan;
-	struct iwi_notif_scan_complete *scan;
 	struct iwi_notif_authentication *auth;
 	struct iwi_notif_association *assoc;
 	struct iwi_notif_beacon_state 

CVS commit: src/sys/dev/usb

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:07:37 UTC 2013

Modified Files:
src/sys/dev/usb: if_otus.c if_urndis.c uvideo.c

Log Message:
- remove unused variables
- move ifdef variables inside ifdef sections


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/usb/if_otus.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/usb/if_urndis.c
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/usb/uvideo.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/dev/usb/if_otus.c
diff -u src/sys/dev/usb/if_otus.c:1.24 src/sys/dev/usb/if_otus.c:1.25
--- src/sys/dev/usb/if_otus.c:1.24	Sat Mar 30 10:14:31 2013
+++ src/sys/dev/usb/if_otus.c	Thu Oct 17 17:07:37 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_otus.c,v 1.24 2013/03/30 14:14:31 christos Exp $	*/
+/*	$NetBSD: if_otus.c,v 1.25 2013/10/17 21:07:37 christos Exp $	*/
 /*	$OpenBSD: if_otus.c,v 1.18 2010/08/27 17:08:00 jsg Exp $	*/
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_otus.c,v 1.24 2013/03/30 14:14:31 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_otus.c,v 1.25 2013/10/17 21:07:37 christos Exp $);
 
 #include sys/param.h
 #include sys/sockio.h
@@ -889,14 +889,15 @@ Static void
 otus_get_chanlist(struct otus_softc *sc)
 {
 	struct ieee80211com *ic;
-	uint16_t domain;
 	uint8_t chan;
 	int i;
 
+#ifdef OTUS_DEBUG
 	/* XXX regulatory domain. */
-	domain = le16toh(sc-sc_eeprom.baseEepHeader.regDmn[0]);
+	uint16_t domain = le16toh(sc-sc_eeprom.baseEepHeader.regDmn[0]);
 
 	DPRINTFN(DBG_FN|DBG_INIT, sc, regdomain=0x%04x\n, domain);
+#endif
 
 	ic = sc-sc_ic;
 	if (sc-sc_eeprom.baseEepHeader.opCapFlags  AR5416_OPFLAGS_11G) {
@@ -1335,19 +1336,20 @@ otus_newstate_cb(struct otus_softc *sc, 
 	struct otus_cmd_newstate *cmd;
 	struct ieee80211com *ic;
 	struct ieee80211_node *ni;
-	enum ieee80211_state ostate;
 	enum ieee80211_state nstate;
 	int s;
 
 	cmd = arg;
 	ic = sc-sc_ic;
 	ni = ic-ic_bss;
-	ostate = ic-ic_state;
 	nstate = cmd-state;
 
+#ifdef OTUS_DEBUG
+	enum ieee80211_state ostate = ostate = ic-ic_state;
 	DPRINTFN(DBG_FN|DBG_STM, sc, %s(%d)-%s(%d)\n,
 	ieee80211_state_name[ostate], ostate,
 	ieee80211_state_name[nstate], nstate);
+#endif
 
 	s = splnet();
 
@@ -2195,7 +2197,6 @@ otus_ioctl(struct ifnet *ifp, u_long cmd
 {
 	struct otus_softc *sc;
 	struct ieee80211com *ic;
-	struct ifaddr *ifa;
 	int s, error = 0;
 
 	sc = ifp-if_softc;
@@ -2208,9 +2209,9 @@ otus_ioctl(struct ifnet *ifp, u_long cmd
 
 	switch (cmd) {
 	case SIOCSIFADDR:
-		ifa = (void *)data;
 		ifp-if_flags |= IFF_UP;
 #ifdef INET
+		struct ifaddr *ifa = data;
 		if (ifa-ifa_addr-sa_family == AF_INET)
 			arp_ifinit(ic-ic_ac, ifa);
 #endif
@@ -2788,21 +2789,23 @@ otus_get_delta_slope(uint32_t coeff, uin
 Static int
 otus_set_chan(struct otus_softc *sc, struct ieee80211_channel *c, int assoc)
 {
-	struct ieee80211com *ic;
 	struct ar_cmd_frequency cmd;
 	struct ar_rsp_frequency rsp;
 	const uint32_t *vals;
 	uint32_t coeff, exp, man, tmp;
 	uint8_t code;
-	int error, chan, i;
+	int error, i;
 
 	DPRINTFN(DBG_FN, sc, \n);
 
-	ic = sc-sc_ic;
-	chan = ieee80211_chan2ieee(ic, c);
+
+#ifdef OTUS_DEBUG
+	struct ieee80211com *ic = sc-sc_ic;
+	int chan = ieee80211_chan2ieee(ic, c);
 
 	DPRINTFN(DBG_CHAN, sc, setting channel %d (%dMHz)\n,
 	chan, c-ic_freq);
+#endif
 
 	tmp = IEEE80211_IS_CHAN_2GHZ(c) ? 0x105 : 0x104;
 	otus_write(sc, AR_MAC_REG_DYNAMIC_SIFS_ACK, tmp);

Index: src/sys/dev/usb/if_urndis.c
diff -u src/sys/dev/usb/if_urndis.c:1.5 src/sys/dev/usb/if_urndis.c:1.6
--- src/sys/dev/usb/if_urndis.c:1.5	Fri Mar 29 23:15:53 2013
+++ src/sys/dev/usb/if_urndis.c	Thu Oct 17 17:07:37 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urndis.c,v 1.5 2013/03/30 03:15:53 christos Exp $ */
+/*	$NetBSD: if_urndis.c,v 1.6 2013/10/17 21:07:37 christos Exp $ */
 /*	$OpenBSD: if_urndis.c,v 1.31 2011/07/03 15:47:17 matthew Exp $ */
 
 /*
@@ -21,7 +21,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_urndis.c,v 1.5 2013/03/30 03:15:53 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_urndis.c,v 1.6 2013/10/17 21:07:37 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -968,11 +968,9 @@ static int
 urndis_ioctl(struct ifnet *ifp, unsigned long command, void *data)
 {
 	struct urndis_softc	*sc;
-	struct ifaddr		*ifa;
 	int			 s, error;
 
 	sc = ifp-if_softc;
-	ifa = (struct ifaddr *)data;
 	error = 0;
 
 	if (sc-sc_dying)

Index: src/sys/dev/usb/uvideo.c
diff -u src/sys/dev/usb/uvideo.c:1.38 src/sys/dev/usb/uvideo.c:1.39
--- src/sys/dev/usb/uvideo.c:1.38	Fri Jan  4 20:30:18 2013
+++ src/sys/dev/usb/uvideo.c	Thu Oct 17 17:07:37 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvideo.c,v 1.38 2013/01/05 01:30:18 christos Exp $	*/
+/*	$NetBSD: uvideo.c,v 1.39 2013/10/17 21:07:37 christos Exp $	*/
 
 /*
  * Copyright (c) 2008 Patrick Mahoney
@@ -42,7 +42,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvideo.c,v 1.38 

CVS commit: src/sys/compat/linux/common

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:08:16 UTC 2013

Modified Files:
src/sys/compat/linux/common: linux_futex.c

Log Message:
remove unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/linux/common/linux_futex.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/linux/common/linux_futex.c
diff -u src/sys/compat/linux/common/linux_futex.c:1.31 src/sys/compat/linux/common/linux_futex.c:1.32
--- src/sys/compat/linux/common/linux_futex.c:1.31	Thu Jul 18 13:31:02 2013
+++ src/sys/compat/linux/common/linux_futex.c	Thu Oct 17 17:08:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_futex.c,v 1.31 2013/07/18 17:31:02 njoly Exp $ */
+/*	$NetBSD: linux_futex.c,v 1.32 2013/10/17 21:08:16 christos Exp $ */
 
 /*-
  * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(1, $NetBSD: linux_futex.c,v 1.31 2013/07/18 17:31:02 njoly Exp $);
+__KERNEL_RCSID(1, $NetBSD: linux_futex.c,v 1.32 2013/10/17 21:08:16 christos Exp $);
 
 #include sys/param.h
 #include sys/time.h
@@ -741,10 +741,8 @@ static int
 fetch_robust_entry(struct lwp *l, struct linux_robust_list **entry,
 struct linux_robust_list **head, int *pi)
 {
-	struct linux_emuldata *led;
 	unsigned long uentry;
 
-	led = l-l_emuldata;
 #ifdef __arch64__
 	if (l-l_proc-p_flag  PK_32) {
 		uint32_t u32;



CVS commit: src/sys/arch/amd64/include

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:11:15 UTC 2013

Modified Files:
src/sys/arch/amd64/include: db_machdep.h

Log Message:
use the parameter for instruction macros


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/amd64/include/db_machdep.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/amd64/include/db_machdep.h
diff -u src/sys/arch/amd64/include/db_machdep.h:1.11 src/sys/arch/amd64/include/db_machdep.h:1.12
--- src/sys/arch/amd64/include/db_machdep.h:1.11	Thu May 26 11:34:12 2011
+++ src/sys/arch/amd64/include/db_machdep.h	Thu Oct 17 17:11:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_machdep.h,v 1.11 2011/05/26 15:34:12 joerg Exp $	*/
+/*	$NetBSD: db_machdep.h,v 1.12 2013/10/17 21:11:15 christos Exp $	*/
 
 /* 
  * Mach Operating System
@@ -87,8 +87,8 @@ extern db_regs_t *ddb_regp;
 #define	inst_call(ins)		(((ins)0xff) == I_CALL || \
  (((ins)0xff) == I_CALLI  \
   ((ins)0x3800) == 0x1000))
-#define inst_load(ins)		0
-#define inst_store(ins)		0
+#define inst_load(ins)		__USE(ins)
+#define inst_store(ins)		__USE(ins)
 
 /* access capability and access macros */
 



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

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:12:24 UTC 2013

Modified Files:
src/sys/arch/x86/pci: fwhrng.c pci_machdep.c

Log Message:
remove set but unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/pci/fwhrng.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/x86/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/x86/pci/fwhrng.c
diff -u src/sys/arch/x86/pci/fwhrng.c:1.5 src/sys/arch/x86/pci/fwhrng.c:1.6
--- src/sys/arch/x86/pci/fwhrng.c:1.5	Thu Feb  2 14:43:01 2012
+++ src/sys/arch/x86/pci/fwhrng.c	Thu Oct 17 17:12:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwhrng.c,v 1.5 2012/02/02 19:43:01 tls Exp $	*/
+/*	$NetBSD: fwhrng.c,v 1.6 2013/10/17 21:12:24 christos Exp $	*/
 
 /*
  * Copyright (c) 2000 Michael Shalayeff
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fwhrng.c,v 1.5 2012/02/02 19:43:01 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: fwhrng.c,v 1.6 2013/10/17 21:12:24 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -71,11 +71,8 @@ fwhrng_match(device_t parent, cfdata_t m
 {
 	bus_space_tag_t bst;
 	bus_space_handle_t bsh;
-	int ret;
 	uint8_t id0, id1, data0, data1;
 
-	ret = 0;
-
 	bst = x86_bus_space_mem;
 
 	/* read chip ID */

Index: src/sys/arch/x86/pci/pci_machdep.c
diff -u src/sys/arch/x86/pci/pci_machdep.c:1.61 src/sys/arch/x86/pci/pci_machdep.c:1.62
--- src/sys/arch/x86/pci/pci_machdep.c:1.61	Sat Oct  5 07:20:34 2013
+++ src/sys/arch/x86/pci/pci_machdep.c	Thu Oct 17 17:12:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.61 2013/10/05 11:20:34 gson Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.62 2013/10/17 21:12:24 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.61 2013/10/05 11:20:34 gson Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.62 2013/10/17 21:12:24 christos Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -309,9 +309,7 @@ pci_conf_lock(struct pci_conf_lock *ocl,
 static void
 pci_conf_unlock(struct pci_conf_lock *ocl)
 {
-	uint32_t sel;
-
-	sel = atomic_cas_32_ni(cl-cl_sel, cl-cl_sel, ocl-cl_sel);
+	atomic_cas_32_ni(cl-cl_sel, cl-cl_sel, ocl-cl_sel);
 	pci_conf_select(ocl-cl_sel);
 	if (ocl-cl_cpuno != cl-cl_cpuno)
 		atomic_cas_32(cl-cl_cpuno, cl-cl_cpuno, ocl-cl_cpuno);



CVS commit: src/sys/external/bsd/acpica/dist/utilities

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:12:56 UTC 2013

Modified Files:
src/sys/external/bsd/acpica/dist/utilities: utmutex.c

Log Message:
__USE a debugging variable


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/sys/external/bsd/acpica/dist/utilities/utmutex.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/acpica/dist/utilities/utmutex.c
diff -u src/sys/external/bsd/acpica/dist/utilities/utmutex.c:1.1.1.2 src/sys/external/bsd/acpica/dist/utilities/utmutex.c:1.2
--- src/sys/external/bsd/acpica/dist/utilities/utmutex.c:1.1.1.2	Thu Feb 17 05:01:41 2011
+++ src/sys/external/bsd/acpica/dist/utilities/utmutex.c	Thu Oct 17 17:12:56 2013
@@ -344,6 +344,7 @@ AcpiUtReleaseMutex (
 ThisThreadId = AcpiOsGetThreadId ();
 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, Thread %u releasing Mutex [%s]\n,
 (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId)));
+__USE(ThisThreadId);
 
 if (MutexId  ACPI_MAX_MUTEX)
 {



CVS commit: src/sys/external/bsd/drm/dist/shared-core

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:14:05 UTC 2013

Modified Files:
src/sys/external/bsd/drm/dist/shared-core: savage_bci.c

Log Message:
annotate some unused variables the authors want to keep


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm/dist/shared-core/savage_bci.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/drm/dist/shared-core/savage_bci.c
diff -u src/sys/external/bsd/drm/dist/shared-core/savage_bci.c:1.5 src/sys/external/bsd/drm/dist/shared-core/savage_bci.c:1.6
--- src/sys/external/bsd/drm/dist/shared-core/savage_bci.c:1.5	Tue Sep  1 21:36:41 2009
+++ src/sys/external/bsd/drm/dist/shared-core/savage_bci.c	Thu Oct 17 17:14:05 2013
@@ -631,6 +631,8 @@ int savage_driver_firstopen(struct drm_d
 		aperture_base = drm_get_resource_start(dev, 2);
 		/* Automatic MTRR setup will do the right thing. */
 	}
+	__USE(fb_rsrc);
+	__USE(aper_rsrc);
 
 	ret = drm_addmap(dev, mmio_base, SAVAGE_MMIO_SIZE, _DRM_REGISTERS,
 			 _DRM_READ_ONLY, dev_priv-mmio);



CVS commit: src/sys/external/bsd/drm/dist/shared-core

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:15:00 UTC 2013

Modified Files:
src/sys/external/bsd/drm/dist/shared-core: mach64_drv.h mach64_state.c

Log Message:
define a new macro that does not declare variables used in output.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm/dist/shared-core/mach64_drv.h
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/drm/dist/shared-core/mach64_state.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/drm/dist/shared-core/mach64_drv.h
diff -u src/sys/external/bsd/drm/dist/shared-core/mach64_drv.h:1.5 src/sys/external/bsd/drm/dist/shared-core/mach64_drv.h:1.6
--- src/sys/external/bsd/drm/dist/shared-core/mach64_drv.h:1.5	Thu Feb 24 02:59:44 2011
+++ src/sys/external/bsd/drm/dist/shared-core/mach64_drv.h	Thu Oct 17 17:15:00 2013
@@ -697,9 +697,12 @@ mach64_update_ring_snapshot(drm_mach64_p
  * queuing the buffer in the ring. 
  */
 
-#define DMALOCALS\
+#define DMALOCALS_NOOUT\
 	drm_mach64_freelist_t *_entry = NULL;	\
-	struct drm_buf *_buf = NULL;		\
+	struct drm_buf *_buf = NULL
+
+#define	DMALOCALS\
+	DMALOCALS_NOOUT;			\
 	u32 *_buf_wptr; int _outcount
 
 #define GETBUFPTR( __buf )		\
@@ -735,8 +738,12 @@ static __inline__ int mach64_find_pendin
 	return 0;
 }
 
+#define DMASETPTR_NOOUT( _p )			\
+	_buf = (_p)
+
 #define DMASETPTR( _p )\
 do {		\
+	DMASETPTR_NOOUT( _p );			\
 	_buf = (_p);\
 	_outcount = 0;\
 	_buf_wptr = GETBUFPTR( _buf );		\

Index: src/sys/external/bsd/drm/dist/shared-core/mach64_state.c
diff -u src/sys/external/bsd/drm/dist/shared-core/mach64_state.c:1.1.1.1 src/sys/external/bsd/drm/dist/shared-core/mach64_state.c:1.2
--- src/sys/external/bsd/drm/dist/shared-core/mach64_state.c:1.1.1.1	Sat Jul 19 01:30:41 2008
+++ src/sys/external/bsd/drm/dist/shared-core/mach64_state.c	Thu Oct 17 17:15:00 2013
@@ -560,7 +560,7 @@ static int mach64_dma_dispatch_vertex(st
 	int i = 0;
 	int done = 0;
 	int verify_ret = 0;
-	DMALOCALS;
+	DMALOCALS_NOOUT;
 
 	DRM_DEBUG(buf=%p used=%lu nbox=%d\n,
 		  buf, used, sarea_priv-nbox);
@@ -587,7 +587,7 @@ static int mach64_dma_dispatch_vertex(st
 
 	copy_buf-used = used;
 
-	DMASETPTR(copy_buf);
+	DMASETPTR_NOOUT(copy_buf);
 
 	if (sarea_priv-dirty  ~MACH64_UPLOAD_CLIPRECTS) {
 		ret = mach64_emit_state(file_priv, dev_priv);



CVS commit: src/sys/external/bsd/drm/dist

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:15:18 UTC 2013

Modified Files:
src/sys/external/bsd/drm/dist/bsd-core: drm_memory.c drm_vm.c
via_dmablit.c
src/sys/external/bsd/drm/dist/shared-core: mga_state.c radeon_cs.c
radeon_state.c via_dma.c

Log Message:
remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/sys/external/bsd/drm/dist/bsd-core/drm_memory.c
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm/dist/bsd-core/drm_vm.c
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/drm/dist/bsd-core/via_dmablit.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/drm/dist/shared-core/mga_state.c
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm/dist/shared-core/radeon_cs.c
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/drm/dist/shared-core/radeon_state.c
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm/dist/shared-core/via_dma.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/drm/dist/bsd-core/drm_memory.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/drm_memory.c:1.12 src/sys/external/bsd/drm/dist/bsd-core/drm_memory.c:1.13
--- src/sys/external/bsd/drm/dist/bsd-core/drm_memory.c:1.12	Thu Jun  6 03:55:46 2013
+++ src/sys/external/bsd/drm/dist/bsd-core/drm_memory.c	Thu Oct 17 17:15:18 2013
@@ -96,9 +96,8 @@ static void *
 drm_netbsd_ioremap(struct drm_device *dev, drm_local_map_t *map, int wc)
 {
 	bus_space_handle_t h;
-	int i, reg, reason;
+	int i, reason;
 	for(i = 0; iDRM_MAX_PCI_RESOURCE; i++) {
-		reg = PCI_MAPREG_START + i*4;
 
 		/* Does the requested mapping lie within this resource? */
 		if ((dev-pci_map_data[i].maptype == PCI_MAPREG_TYPE_MEM ||

Index: src/sys/external/bsd/drm/dist/bsd-core/drm_vm.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/drm_vm.c:1.6 src/sys/external/bsd/drm/dist/bsd-core/drm_vm.c:1.7
--- src/sys/external/bsd/drm/dist/bsd-core/drm_vm.c:1.6	Tue Feb 15 09:24:23 2011
+++ src/sys/external/bsd/drm/dist/bsd-core/drm_vm.c	Thu Oct 17 17:15:18 2013
@@ -44,7 +44,6 @@ paddr_t drm_mmap(dev_t kdev, off_t offse
 	int error;
 #elif   defined(__NetBSD__)
 	paddr_t phys;
-	unsigned long map_offs;
 	int flags = 0;
 #endif
 
@@ -126,9 +125,6 @@ paddr_t drm_mmap(dev_t kdev, off_t offse
 		return -1;
 	}
 	type = map-type;
-#if	defined(__NetBSD__)
-	map_offs = map-offset;
-#endif
 	DRM_UNLOCK();
 
 	switch (type) {

Index: src/sys/external/bsd/drm/dist/bsd-core/via_dmablit.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/via_dmablit.c:1.1 src/sys/external/bsd/drm/dist/bsd-core/via_dmablit.c:1.2
--- src/sys/external/bsd/drm/dist/bsd-core/via_dmablit.c:1.1	Fri Feb 18 09:26:09 2011
+++ src/sys/external/bsd/drm/dist/bsd-core/via_dmablit.c	Thu Oct 17 17:15:18 2013
@@ -29,7 +29,7 @@
 /* $FreeBSD: src/sys/dev/drm/via_dmablit.c,v 1.6 2010/12/25 21:26:56 alc Exp $ */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: via_dmablit.c,v 1.1 2011/02/18 14:26:09 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: via_dmablit.c,v 1.2 2013/10/17 21:15:18 christos Exp $);
 
 /*
  * Unmaps the DMA mappings.
@@ -67,7 +67,6 @@ via_unmap_blit_from_device(drm_via_sg_in
 	unsigned descriptor_this_page = num_desc % vsg-descriptors_per_page;
 	drm_via_descriptor_t *desc_ptr = vsg-desc_pages[cur_descriptor_page] +
 		descriptor_this_page;
-	dma_addr_t next = vsg-chain_start;
 
 	while(num_desc--) {
 		if (descriptor_this_page-- == 0) {
@@ -76,7 +75,6 @@ via_unmap_blit_from_device(drm_via_sg_in
 			desc_ptr = vsg-desc_pages[cur_descriptor_page] +
 descriptor_this_page;
 		}
-		next = (dma_addr_t) desc_ptr-next;
 		desc_ptr--;
 	}
 }

Index: src/sys/external/bsd/drm/dist/shared-core/mga_state.c
diff -u src/sys/external/bsd/drm/dist/shared-core/mga_state.c:1.1.1.1 src/sys/external/bsd/drm/dist/shared-core/mga_state.c:1.2
--- src/sys/external/bsd/drm/dist/shared-core/mga_state.c:1.1.1.1	Sat Jul 19 01:30:42 2008
+++ src/sys/external/bsd/drm/dist/shared-core/mga_state.c	Thu Oct 17 17:15:18 2013
@@ -979,7 +979,6 @@ static int mga_dma_iload(struct drm_devi
 	struct drm_device_dma *dma = dev-dma;
 	drm_mga_private_t *dev_priv = dev-dev_private;
 	struct drm_buf *buf;
-	drm_mga_buf_priv_t *buf_priv;
 	drm_mga_iload_t *iload = data;
 	DRM_DEBUG(\n);
 
@@ -996,7 +995,6 @@ static int mga_dma_iload(struct drm_devi
 		return -EINVAL;
 
 	buf = dma-buflist[iload-idx];
-	buf_priv = buf-dev_private;
 
 	if (mga_verify_iload(dev_priv, iload-dstorg, iload-length)) {
 		mga_freelist_put(dev, buf);

Index: src/sys/external/bsd/drm/dist/shared-core/radeon_cs.c
diff -u src/sys/external/bsd/drm/dist/shared-core/radeon_cs.c:1.1 src/sys/external/bsd/drm/dist/shared-core/radeon_cs.c:1.2
--- src/sys/external/bsd/drm/dist/shared-core/radeon_cs.c:1.1	Sun May 23 21:39:06 2010
+++ src/sys/external/bsd/drm/dist/shared-core/radeon_cs.c	Thu Oct 17 17:15:18 2013
@@ -725,7 +725,6 @@ static inline int r600_cs_packet3(struct
 
 

CVS commit: src/sys/dev/i2o

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:16:13 UTC 2013

Modified Files:
src/sys/dev/i2o: iop.c

Log Message:
remove unused variables and __USE a debugging variable


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/i2o/iop.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/dev/i2o/iop.c
diff -u src/sys/dev/i2o/iop.c:1.83 src/sys/dev/i2o/iop.c:1.84
--- src/sys/dev/i2o/iop.c:1.83	Sat Sep 14 09:08:31 2013
+++ src/sys/dev/i2o/iop.c	Thu Oct 17 17:16:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: iop.c,v 1.83 2013/09/14 13:08:31 joerg Exp $	*/
+/*	$NetBSD: iop.c,v 1.84 2013/10/17 21:16:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001, 2002, 2007 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: iop.c,v 1.83 2013/09/14 13:08:31 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: iop.c,v 1.84 2013/10/17 21:16:12 christos Exp $);
 
 #include iop.h
 
@@ -607,14 +607,12 @@ static void
 iop_reconf_thread(void *cookie)
 {
 	struct iop_softc *sc;
-	struct lwp *l;
 	struct i2o_lct lct;
 	u_int32_t chgind;
 	int rv;
 
 	sc = cookie;
 	chgind = sc-sc_chgind + 1;
-	l = curlwp;
 
 	for (;;) {
 		DPRINTF((%s: async reconfig: requested 0x%08x\n,
@@ -2239,11 +2237,13 @@ iop_msg_wait(struct iop_softc *sc, struc
 	if (rv != 0) {
 		printf(iop_msg_wait: tsleep() == %d\n, rv);
 		if (iop_status_get(sc, 0) != 0)
-			printf(iop_msg_wait: unable to retrieve status\n);
+			printf(%s: unable to retrieve status\n, __func__);
 		else
-			printf(iop_msg_wait: IOP state = %d\n,
+			printf(%s: IOP state = %d\n, __func__,
 			(le32toh(sc-sc_status.segnumber)  16)  0xff);
 	}
+#else
+	__USE(rv);
 #endif
 }
 



CVS commit: src/sys/dev/i2c

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:18:43 UTC 2013

Modified Files:
src/sys/dev/i2c: tvpll.c

Log Message:
remove unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/tvpll.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/dev/i2c/tvpll.c
diff -u src/sys/dev/i2c/tvpll.c:1.4 src/sys/dev/i2c/tvpll.c:1.5
--- src/sys/dev/i2c/tvpll.c:1.4	Sun Oct  2 15:03:56 2011
+++ src/sys/dev/i2c/tvpll.c	Thu Oct 17 17:18:43 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: tvpll.c,v 1.4 2011/10/02 19:03:56 jmcneill Exp $ */
+/* $NetBSD: tvpll.c,v 1.5 2013/10/17 21:18:43 christos Exp $ */
 
 /*
  * Copyright (c) 2008, 2011 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tvpll.c,v 1.4 2011/10/02 19:03:56 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: tvpll.c,v 1.5 2013/10/17 21:18:43 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -55,7 +55,6 @@ struct tvpll *
 tvpll_open(device_t parent, i2c_tag_t t, i2c_addr_t a, struct tvpll_data *p)
 {
 	struct tvpll *tvpll;
-	int rv;
 
 	tvpll = kmem_alloc(sizeof(struct tvpll), KM_SLEEP);
 if (tvpll == NULL)
@@ -68,7 +67,7 @@ tvpll_open(device_t parent, i2c_tag_t t,
 
 	if (tvpll-pll-initdata) {
 		iic_acquire_bus(tvpll-tag, I2C_F_POLL);
-		rv = iic_exec(tvpll-tag, I2C_OP_WRITE_WITH_STOP, tvpll-addr,
+		(void)iic_exec(tvpll-tag, I2C_OP_WRITE_WITH_STOP, tvpll-addr,
 		tvpll-pll-initdata[1], tvpll-pll-initdata[0],
 		NULL, 0, I2C_F_POLL);
 		iic_release_bus(tvpll-tag, I2C_F_POLL);



CVS commit: src/sys/dev/acpi

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:19:03 UTC 2013

Modified Files:
src/sys/dev/acpi: pckbc_acpi.c

Log Message:
remove unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/acpi/pckbc_acpi.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/dev/acpi/pckbc_acpi.c
diff -u src/sys/dev/acpi/pckbc_acpi.c:1.33 src/sys/dev/acpi/pckbc_acpi.c:1.34
--- src/sys/dev/acpi/pckbc_acpi.c:1.33	Fri Mar  5 09:00:17 2010
+++ src/sys/dev/acpi/pckbc_acpi.c	Thu Oct 17 17:19:03 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pckbc_acpi.c,v 1.33 2010/03/05 14:00:17 jruoho Exp $	*/
+/*	$NetBSD: pckbc_acpi.c,v 1.34 2013/10/17 21:19:03 christos Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pckbc_acpi.c,v 1.33 2010/03/05 14:00:17 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: pckbc_acpi.c,v 1.34 2013/10/17 21:19:03 christos Exp $);
 
 #include sys/param.h
 #include sys/callout.h
@@ -130,7 +130,6 @@ pckbc_acpi_attach(device_t parent, devic
 	struct pckbc_internal *t;
 	struct acpi_attach_args *aa = aux;
 	bus_space_handle_t ioh_d, ioh_c;
-	pckbc_slot_t peer;
 	struct acpi_resources res;
 	struct acpi_io *io0, *io1, *ioswap;
 	struct acpi_irq *irq;
@@ -141,10 +140,8 @@ pckbc_acpi_attach(device_t parent, devic
 
 	if (acpi_match_hid(aa-aa_node-ad_devinfo, pckbc_acpi_ids_kbd)) {
 		psc-sc_slot = PCKBC_KBD_SLOT;
-		peer = PCKBC_AUX_SLOT;
 	} else if (acpi_match_hid(aa-aa_node-ad_devinfo, pckbc_acpi_ids_ms)) {
 		psc-sc_slot = PCKBC_AUX_SLOT;
-		peer = PCKBC_KBD_SLOT;
 	} else {
 		aprint_error(: unknown port!\n);
 		panic(pckbc_acpi_attach: impossible);



CVS commit: src/sys/dev

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:19:40 UTC 2013

Modified Files:
src/sys/dev: sequencer.c

Log Message:
remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/sequencer.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/dev/sequencer.c
diff -u src/sys/dev/sequencer.c:1.56 src/sys/dev/sequencer.c:1.57
--- src/sys/dev/sequencer.c:1.56	Sat Apr 27 18:12:42 2013
+++ src/sys/dev/sequencer.c	Thu Oct 17 17:19:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sequencer.c,v 1.56 2013/04/27 22:12:42 christos Exp $	*/
+/*	$NetBSD: sequencer.c,v 1.57 2013/10/17 21:19:40 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sequencer.c,v 1.56 2013/04/27 22:12:42 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: sequencer.c,v 1.57 2013/10/17 21:19:40 christos Exp $);
 
 #include sequencer.h
 
@@ -1427,12 +1427,6 @@ midiseq_open(int unit, int flags)
 static void
 midiseq_close(struct midi_dev *md)
 {
-	int major;
-	dev_t dev;
-	
-	major = devsw_name2chr(midi, NULL, 0);
-	dev = makedev(major, md-unit);
-
 	DPRINTFN(2, (midiseq_close: %d\n, md-unit));
 	(void)vn_close(md-vp, 0, kauth_cred_get());
 	kmem_free(md, sizeof(*md));



CVS commit: src/sys/dev

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:20:10 UTC 2013

Modified Files:
src/sys/dev: video.c

Log Message:
- remove unused variables
- moved debugging variable into debugging ifdef


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/video.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/dev/video.c
diff -u src/sys/dev/video.c:1.29 src/sys/dev/video.c:1.30
--- src/sys/dev/video.c:1.29	Mon Jan  7 10:07:40 2013
+++ src/sys/dev/video.c	Thu Oct 17 17:20:10 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: video.c,v 1.29 2013/01/07 15:07:40 prlw1 Exp $ */
+/* $NetBSD: video.c,v 1.30 2013/10/17 21:20:10 christos Exp $ */
 
 /*
  * Copyright (c) 2008 Patrick Mahoney p...@polycrystal.org
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: video.c,v 1.29 2013/01/07 15:07:40 prlw1 Exp $);
+__KERNEL_RCSID(0, $NetBSD: video.c,v 1.30 2013/10/17 21:20:10 christos Exp $);
 
 #include video.h
 #if NVIDEO  0
@@ -315,10 +315,12 @@ static const char *	video_ioctl_str(u_lo
 static int
 video_match(device_t parent, cfdata_t match, void *aux)
 {
+#ifdef VIDEO_DEBUG
 	struct video_attach_args *args;
 
 	args = aux;
 	DPRINTF((video_match: hw=%p\n, args-hw_if));
+#endif
 	return 1;
 }
 
@@ -397,11 +399,8 @@ video_detach(device_t self, int flags)
 static int
 video_print(void *aux, const char *pnp)
 {
-	struct video_attach_args *arg;
-
 	if (pnp != NULL) {
 		DPRINTF((video_print: have pnp\n));
-		arg = aux;
 		aprint_normal(%s at %s\n, video, pnp);
 	} else {
 		DPRINTF((video_print: pnp is NULL\n));



CVS commit: src/sys/dev/bluetooth

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:22:02 UTC 2013

Modified Files:
src/sys/dev/bluetooth: bcsp.c

Log Message:
add __USE for debugging variables


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/bluetooth/bcsp.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/dev/bluetooth/bcsp.c
diff -u src/sys/dev/bluetooth/bcsp.c:1.21 src/sys/dev/bluetooth/bcsp.c:1.22
--- src/sys/dev/bluetooth/bcsp.c:1.21	Sat Jun  2 17:36:43 2012
+++ src/sys/dev/bluetooth/bcsp.c	Thu Oct 17 17:22:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcsp.c,v 1.21 2012/06/02 21:36:43 dsl Exp $	*/
+/*	$NetBSD: bcsp.c,v 1.22 2013/10/17 21:22:01 christos Exp $	*/
 /*
  * Copyright (c) 2007 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcsp.c,v 1.21 2012/06/02 21:36:43 dsl Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcsp.c,v 1.22 2013/10/17 21:22:01 christos Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -722,8 +722,12 @@ bcsp_slip_receive(int c, struct tty *tp)
 	}
 	if (discard) {
 discarded:
+#ifdef BCSP_DEBUG
 		DPRINTFN(4, (%s: receives unexpected byte 0x%02x: %s\n,
 		device_xname(sc-sc_dev), c, errstr));
+#else
+		__USE(errstr);
+#endif
 	}
 	sc-sc_stats.byte_rx++;
 
@@ -782,7 +786,7 @@ bcsp_pktintegrity_receive(struct bcsp_so
 	u_int pldlen;
 	int discard = 0;
 	uint16_t crc = 0x;
-	const char *errstr;
+	const char *errstr 
 
 	DPRINTFN(3, (%s: pi receive\n, device_xname(sc-sc_dev)));
 #ifdef BCSP_DEBUG
@@ -836,8 +840,12 @@ bcsp_pktintegrity_receive(struct bcsp_so
 
 	if (discard) {
 discarded:
+#ifdef BCSP_DEBUG
 		DPRINTFN(3, (%s: receives unexpected packet: %s\n,
 		device_xname(sc-sc_dev), errstr));
+#else
+		__USE(errstr);
+#endif
 		m_freem(m);
 	} else
 		bcsp_mux_receive(sc, m);



CVS commit: src/sys/dev/cardbus

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:22:28 UTC 2013

Modified Files:
src/sys/dev/cardbus: if_rtw_cardbus.c

Log Message:
move notyet variable into notyet section


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/cardbus/if_rtw_cardbus.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/dev/cardbus/if_rtw_cardbus.c
diff -u src/sys/dev/cardbus/if_rtw_cardbus.c:1.42 src/sys/dev/cardbus/if_rtw_cardbus.c:1.43
--- src/sys/dev/cardbus/if_rtw_cardbus.c:1.42	Mon Aug  1 07:20:27 2011
+++ src/sys/dev/cardbus/if_rtw_cardbus.c	Thu Oct 17 17:22:28 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: if_rtw_cardbus.c,v 1.42 2011/08/01 11:20:27 drochner Exp $ */
+/* $NetBSD: if_rtw_cardbus.c,v 1.43 2013/10/17 21:22:28 christos Exp $ */
 
 /*-
  * Copyright (c) 2004, 2005 David Young.  All rights reserved.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_rtw_cardbus.c,v 1.42 2011/08/01 11:20:27 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_rtw_cardbus.c,v 1.43 2013/10/17 21:22:28 christos Exp $);
 
 #include opt_inet.h
 
@@ -203,7 +203,6 @@ rtw_cardbus_attach(device_t parent, devi
 	cardbus_devfunc_t ct = ca-ca_ct;
 	const struct rtw_cardbus_product *rcp;
 	bus_addr_t adr;
-	int rev;
 
 	sc-sc_dev = self;
 	sc-sc_dmat = ca-ca_dmat;
@@ -216,8 +215,10 @@ rtw_cardbus_attach(device_t parent, devi
 		panic(rtw_cardbus_attach: impossible);
 	}
 
+#ifdef notyet
 	/* Get revision info. */
-	rev = PCI_REVISION(ca-ca_class);
+	int rev = PCI_REVISION(ca-ca_class);
+#endif
 
 	printf(: %s\n, rcp-rcp_product_name);
 



CVS commit: src/sys/dev/dtv

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:23:05 UTC 2013

Modified Files:
src/sys/dev/dtv: dtv_demux.c

Log Message:
remove unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/dtv/dtv_demux.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/dev/dtv/dtv_demux.c
diff -u src/sys/dev/dtv/dtv_demux.c:1.4 src/sys/dev/dtv/dtv_demux.c:1.5
--- src/sys/dev/dtv/dtv_demux.c:1.4	Sat Jul 16 08:20:01 2011
+++ src/sys/dev/dtv/dtv_demux.c	Thu Oct 17 17:23:05 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: dtv_demux.c,v 1.4 2011/07/16 12:20:01 jmcneill Exp $ */
+/* $NetBSD: dtv_demux.c,v 1.5 2013/10/17 21:23:05 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill jmcne...@invisible.ca
@@ -52,7 +52,7 @@
  */ 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dtv_demux.c,v 1.4 2011/07/16 12:20:01 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: dtv_demux.c,v 1.5 2013/10/17 21:23:05 christos Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -368,7 +368,6 @@ static int
 dtv_demux_ioctl(struct file *fp, u_long cmd, void *data)
 {
 	struct dtv_demux *demux = fp-f_data;
-	struct dtv_softc *sc;
 	struct dmx_pes_filter_params *pesfilt;
 	struct dmx_sct_filter_params *sctfilt;
 	uint16_t pid;
@@ -376,7 +375,6 @@ dtv_demux_ioctl(struct file *fp, u_long 
 
 	if (demux == NULL)
 		return ENXIO;
-	sc = demux-dd_sc;
 
 	switch (cmd) {
 	case DMX_START:



CVS commit: src/sys/dev/ic

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 21:24:25 UTC 2013

Modified Files:
src/sys/dev/ic: aic79xx.c aic79xx_osm.c arn5008.c arn9003.c arn9285.c
arn9287.c athn.c atw.c bwi.c ciss.c mfi.c mtd803.c rtw.c sl811hs.c
spic.c tpm.c

Log Message:
- remove unused variables
- move variables inside ifdef sections
- ifdef notdef unused code
- use __USE for debugging variables


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/ic/aic79xx.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/ic/aic79xx_osm.c src/sys/dev/ic/ciss.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/arn5008.c src/sys/dev/ic/arn9003.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/arn9285.c src/sys/dev/ic/arn9287.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/athn.c
cvs rdiff -u -r1.154 -r1.155 src/sys/dev/ic/atw.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/ic/bwi.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/ic/mfi.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/mtd803.c
cvs rdiff -u -r1.119 -r1.120 src/sys/dev/ic/rtw.c
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/ic/sl811hs.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/ic/spic.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/tpm.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/dev/ic/aic79xx.c
diff -u src/sys/dev/ic/aic79xx.c:1.45 src/sys/dev/ic/aic79xx.c:1.46
--- src/sys/dev/ic/aic79xx.c:1.45	Sat Jul  2 09:12:44 2011
+++ src/sys/dev/ic/aic79xx.c	Thu Oct 17 17:24:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic79xx.c,v 1.45 2011/07/02 13:12:44 mrg Exp $	*/
+/*	$NetBSD: aic79xx.c,v 1.46 2013/10/17 21:24:24 christos Exp $	*/
 
 /*
  * Core routines and tables shareable across OS platforms.
@@ -49,7 +49,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aic79xx.c,v 1.45 2011/07/02 13:12:44 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: aic79xx.c,v 1.46 2013/10/17 21:24:24 christos Exp $);
 
 #include dev/ic/aic79xx_osm.h
 #include dev/ic/aic79xx_inline.h
@@ -1025,9 +1025,10 @@ ahd_handle_seqint(struct ahd_softc *ahd,
 		{
 			struct	ahd_devinfo devinfo;
 			struct	scb *scb;
+#ifdef notdef
 			struct	ahd_initiator_tinfo *targ_info;
 			struct	ahd_tmode_tstate *tstate;
-			struct	ahd_transinfo *tinfo;
+#endif
 			u_int	scbid;
 
 			/*
@@ -1055,12 +1056,13 @@ ahd_handle_seqint(struct ahd_softc *ahd,
 	SCB_GET_LUN(scb),
 	SCB_GET_CHANNEL(ahd, scb),
 	ROLE_INITIATOR);
+#ifdef notdef
 			targ_info = ahd_fetch_transinfo(ahd,
 			devinfo.channel,
 			devinfo.our_scsiid,
 			devinfo.target,
 			tstate);
-			tinfo = targ_info-curr;
+#endif
 			ahd_set_width(ahd, devinfo, MSG_EXT_WDTR_BUS_8_BIT,
   AHD_TRANS_ACTIVE, /*paused*/TRUE);
 			ahd_set_syncrate(ahd, devinfo, /*period*/0,
@@ -1747,7 +1749,6 @@ ahd_handle_transmission_error(struct ahd
 	struct	scb *scb;
 	u_int	scbid;
 	u_int	lqistat1;
-	u_int	lqistat2;
 	u_int	msg_out;
 	u_int	curphase;
 	u_int	lastphase;
@@ -1758,7 +1759,7 @@ ahd_handle_transmission_error(struct ahd
 	scb = NULL;
 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
 	lqistat1 = ahd_inb(ahd, LQISTAT1)  ~(LQIPHASE_LQ|LQIPHASE_NLQ);
-	lqistat2 = ahd_inb(ahd, LQISTAT2);
+	(void)ahd_inb(ahd, LQISTAT2);
 	if ((lqistat1  (LQICRCI_NLQ|LQICRCI_LQ)) == 0
 	  (ahd-bugs  AHD_NLQICRC_DELAYED_BUG) != 0) {
 		u_int lqistate;
@@ -2657,10 +2658,8 @@ ahd_dump_sglist(struct scb *scb)
 			sg_list = (struct ahd_dma64_seg*)scb-sg_list;
 			for (i = 0; i  scb-sg_count; i++) {
 uint64_t addr;
-uint32_t len;
 
 addr = ahd_le64toh(sg_list[i].addr);
-len = ahd_le32toh(sg_list[i].len);
 printf(sg[%d] - Addr 0x%x%x : Length %d%s\n,
    i,
    (uint32_t)((addr  32)  0x),
@@ -3288,13 +3287,12 @@ ahd_update_pending_scbs(struct ahd_softc
 	LIST_FOREACH(pending_scb, ahd-pending_scbs, pending_links) {
 		struct ahd_devinfo devinfo;
 		struct hardware_scb *pending_hscb;
-		struct ahd_initiator_tinfo *tinfo;
 		struct ahd_tmode_tstate *tstate;
 
 		ahd_scb_devinfo(ahd, devinfo, pending_scb);
-		tinfo = ahd_fetch_transinfo(ahd, devinfo.channel,
-	devinfo.our_scsiid,
-	devinfo.target, tstate);
+		(void)ahd_fetch_transinfo(ahd, devinfo.channel,
+	  devinfo.our_scsiid,
+	  devinfo.target, tstate);
 		pending_hscb = pending_scb-hscb;
 		if ((tstate-auto_negotiate  devinfo.target_mask) == 0
 		  (pending_scb-flags  SCB_AUTO_NEGOTIATE) != 0) {
@@ -7127,7 +7125,6 @@ ahd_search_qinfifo(struct ahd_softc *ahd
 	int		 found;
 	int		 targets;
 	int		 pending_cmds;
-	int		 qincount;
 
 	/* Must be in CCHAN mode */
 	saved_modes = ahd_save_modes(ahd);
@@ -7155,7 +7152,7 @@ ahd_search_qinfifo(struct ahd_softc *ahd
 	LIST_FOREACH(scb, ahd-pending_scbs, pending_links) {
 		pending_cmds++;
 	}
-	qincount = ahd_qinfifo_count(ahd);
+	(void)ahd_qinfifo_count(ahd);
 
 	if (action == SEARCH_PRINT) {
 		printf(qinstart = 0x%x qinfifonext = 0x%x\n,
@@ -7953,7 +7950,6 @@ ahd_handle_scsi_status(struct ahd_softc 
 

CVS commit: src/external/bsd/libc++/include

2013-10-17 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Oct 17 22:07:59 UTC 2013

Modified Files:
src/external/bsd/libc++/include: Makefile

Log Message:
Explicitly include bsd.clean.mk for cleandir.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libc++/include/Makefile

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

Modified files:

Index: src/external/bsd/libc++/include/Makefile
diff -u src/external/bsd/libc++/include/Makefile:1.2 src/external/bsd/libc++/include/Makefile:1.3
--- src/external/bsd/libc++/include/Makefile:1.2	Fri May 17 22:59:29 2013
+++ src/external/bsd/libc++/include/Makefile	Thu Oct 17 22:07:59 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2013/05/17 22:59:29 joerg Exp $
+#	$NetBSD: Makefile,v 1.3 2013/10/17 22:07:59 joerg Exp $
 
 .include bsd.init.mk
 
@@ -118,4 +118,5 @@ DPSRCS+=	cxxabi.h
 CLEANFILES+=	cxxabi.h
 
 .include bsd.inc.mk
+.include bsd.clean.mk
 .include bsd.obj.mk



CVS commit: src/sys/arch/amd64/include

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 23:04:20 UTC 2013

Modified Files:
src/sys/arch/amd64/include: db_machdep.h

Log Message:
we need to return something here.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/amd64/include/db_machdep.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/amd64/include/db_machdep.h
diff -u src/sys/arch/amd64/include/db_machdep.h:1.12 src/sys/arch/amd64/include/db_machdep.h:1.13
--- src/sys/arch/amd64/include/db_machdep.h:1.12	Thu Oct 17 17:11:15 2013
+++ src/sys/arch/amd64/include/db_machdep.h	Thu Oct 17 19:04:20 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_machdep.h,v 1.12 2013/10/17 21:11:15 christos Exp $	*/
+/*	$NetBSD: db_machdep.h,v 1.13 2013/10/17 23:04:20 christos Exp $	*/
 
 /* 
  * Mach Operating System
@@ -87,8 +87,8 @@ extern db_regs_t *ddb_regp;
 #define	inst_call(ins)		(((ins)0xff) == I_CALL || \
  (((ins)0xff) == I_CALLI  \
   ((ins)0x3800) == 0x1000))
-#define inst_load(ins)		__USE(ins)
-#define inst_store(ins)		__USE(ins)
+#define inst_load(ins)		(__USE(ins), 0)
+#define inst_store(ins)		(_USE(ins), 0)
 
 /* access capability and access macros */
 



CVS commit: src/sys/arch/amd64/include

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 23:05:08 UTC 2013

Modified Files:
src/sys/arch/amd64/include: db_machdep.h

Log Message:
add missing _


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/amd64/include/db_machdep.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/amd64/include/db_machdep.h
diff -u src/sys/arch/amd64/include/db_machdep.h:1.13 src/sys/arch/amd64/include/db_machdep.h:1.14
--- src/sys/arch/amd64/include/db_machdep.h:1.13	Thu Oct 17 19:04:20 2013
+++ src/sys/arch/amd64/include/db_machdep.h	Thu Oct 17 19:05:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_machdep.h,v 1.13 2013/10/17 23:04:20 christos Exp $	*/
+/*	$NetBSD: db_machdep.h,v 1.14 2013/10/17 23:05:08 christos Exp $	*/
 
 /* 
  * Mach Operating System
@@ -88,7 +88,7 @@ extern db_regs_t *ddb_regp;
  (((ins)0xff) == I_CALLI  \
   ((ins)0x3800) == 0x1000))
 #define inst_load(ins)		(__USE(ins), 0)
-#define inst_store(ins)		(_USE(ins), 0)
+#define inst_store(ins)		(__USE(ins), 0)
 
 /* access capability and access macros */
 



CVS commit: [rmind-smpnet] src/sys

2013-10-17 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Thu Oct 17 23:52:18 UTC 2013

Modified Files:
src/sys/kern [rmind-smpnet]: uipc_socket2.c
src/sys/netinet [rmind-smpnet]: ip_output.c tcp_usrreq.c udp_usrreq.c

Log Message:
Eliminate some of the splsoftnet() calls, misc clean up.


To generate a diff of this commit:
cvs rdiff -u -r1.112.2.2 -r1.112.2.3 src/sys/kern/uipc_socket2.c
cvs rdiff -u -r1.223.2.2 -r1.223.2.3 src/sys/netinet/ip_output.c
cvs rdiff -u -r1.166.4.3 -r1.166.4.4 src/sys/netinet/tcp_usrreq.c
cvs rdiff -u -r1.190.2.3 -r1.190.2.4 src/sys/netinet/udp_usrreq.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/uipc_socket2.c
diff -u src/sys/kern/uipc_socket2.c:1.112.2.2 src/sys/kern/uipc_socket2.c:1.112.2.3
--- src/sys/kern/uipc_socket2.c:1.112.2.2	Mon Sep 23 00:57:53 2013
+++ src/sys/kern/uipc_socket2.c	Thu Oct 17 23:52:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket2.c,v 1.112.2.2 2013/09/23 00:57:53 rmind Exp $	*/
+/*	$NetBSD: uipc_socket2.c,v 1.112.2.3 2013/10/17 23:52:18 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_socket2.c,v 1.112.2.2 2013/09/23 00:57:53 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_socket2.c,v 1.112.2.3 2013/10/17 23:52:18 rmind Exp $);
 
 #include opt_mbuftrace.h
 #include opt_sb_max.h
@@ -299,7 +299,7 @@ sonewconn(struct socket *head, int conns
 	so-so_snd.sb_flags |= head-so_snd.sb_flags  (SB_AUTOSIZE | SB_ASYNC);
 
 	/*
-	 * Share the lock the listening-socket, it may get unshared
+	 * Share the lock with the listening-socket, it may get unshared
 	 * once the connection is complete.
 	 */
 	mutex_obj_hold(head-so_lock);

Index: src/sys/netinet/ip_output.c
diff -u src/sys/netinet/ip_output.c:1.223.2.2 src/sys/netinet/ip_output.c:1.223.2.3
--- src/sys/netinet/ip_output.c:1.223.2.2	Wed Aug 28 23:59:36 2013
+++ src/sys/netinet/ip_output.c	Thu Oct 17 23:52:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_output.c,v 1.223.2.2 2013/08/28 23:59:36 rmind Exp $	*/
+/*	$NetBSD: ip_output.c,v 1.223.2.3 2013/10/17 23:52:18 rmind Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ip_output.c,v 1.223.2.2 2013/08/28 23:59:36 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: ip_output.c,v 1.223.2.3 2013/10/17 23:52:18 rmind Exp $);
 
 #include opt_inet.h
 #include opt_ipsec.h
@@ -191,6 +191,7 @@ ip_output(struct mbuf *m0, ...)
 
 	MCLAIM(m, ip_tx_mowner);
 
+	KASSERT(solocked(so));
 	KASSERT((m-m_flags  M_PKTHDR) != 0);
 	KASSERT((m-m_pkthdr.csum_flags  (M_CSUM_TCPv6|M_CSUM_UDPv6)) == 0);
 	KASSERT((m-m_pkthdr.csum_flags  (M_CSUM_TCPv4|M_CSUM_UDPv4)) !=
@@ -202,6 +203,7 @@ ip_output(struct mbuf *m0, ...)
 			hlen = len;
 	}
 	ip = mtod(m, struct ip *);
+
 	/*
 	 * Fill in IP header.
 	 */
@@ -214,6 +216,7 @@ ip_output(struct mbuf *m0, ...)
 	} else {
 		hlen = ip-ip_hl  2;
 	}
+
 	/*
 	 * Route packet.
 	 */
@@ -222,17 +225,15 @@ ip_output(struct mbuf *m0, ...)
 		ro = iproute;
 	sockaddr_in_init(u.dst4, ip-ip_dst, 0);
 	dst = satocsin(rtcache_getdst(ro));
+
 	/*
-	 * If there is a cached route,
-	 * check that it is to the same destination
-	 * and is still up.  If not, free it and try again.
-	 * The address family should also be checked in case of sharing the
-	 * cache with IPv6.
+	 * If there is a cached route, check that it is to the same
+	 * destination and is still up.  If not, free it and try again.
+	 * The address family should also be checked in case of sharing
+	 * the cache with IPv6.
 	 */
-	if (dst == NULL)
-		;
-	else if (dst-sin_family != AF_INET ||
-		 !in_hosteq(dst-sin_addr, ip-ip_dst))
+	if (dst  (dst-sin_family != AF_INET ||
+	!in_hosteq(dst-sin_addr, ip-ip_dst)))
 		rtcache_free(ro);
 
 	if ((rt = rtcache_validate(ro)) == NULL 
@@ -240,9 +241,9 @@ ip_output(struct mbuf *m0, ...)
 		dst = u.dst4;
 		rtcache_setdst(ro, u.dst);
 	}
+
 	/*
-	 * If routing to interface only,
-	 * short circuit routing lookup.
+	 * If routing to interface only, short circuit routing lookup.
 	 */
 	if (flags  IP_ROUTETOIF) {
 		if ((ia = ifatoia(ifa_ifwithladdr(sintocsa(dst == NULL) {
@@ -275,6 +276,7 @@ ip_output(struct mbuf *m0, ...)
 		if (rt-rt_flags  RTF_GATEWAY)
 			dst = satosin(rt-rt_gateway);
 	}
+
 	if (IN_MULTICAST(ip-ip_dst.s_addr) ||
 	(ip-ip_dst.s_addr == INADDR_BROADCAST)) {
 		struct in_multi *inm;

Index: src/sys/netinet/tcp_usrreq.c
diff -u src/sys/netinet/tcp_usrreq.c:1.166.4.3 src/sys/netinet/tcp_usrreq.c:1.166.4.4
--- src/sys/netinet/tcp_usrreq.c:1.166.4.3	Mon Sep 23 00:57:53 2013
+++ src/sys/netinet/tcp_usrreq.c	Thu Oct 17 23:52:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_usrreq.c,v 1.166.4.3 2013/09/23 00:57:53 rmind Exp $	*/
+/*	$NetBSD: tcp_usrreq.c,v 1.166.4.4 2013/10/17 23:52:18 rmind Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, 

CVS commit: src/lib/libc/gen

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 23:56:17 UTC 2013

Modified Files:
src/lib/libc/gen: arc4random.c

Log Message:
remove always inline because new gcc bitches.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/gen/arc4random.c

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

Modified files:

Index: src/lib/libc/gen/arc4random.c
diff -u src/lib/libc/gen/arc4random.c:1.20 src/lib/libc/gen/arc4random.c:1.21
--- src/lib/libc/gen/arc4random.c:1.20	Mon Aug 20 17:38:09 2012
+++ src/lib/libc/gen/arc4random.c	Thu Oct 17 19:56:17 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: arc4random.c,v 1.20 2012/08/20 21:38:09 dsl Exp $	*/
+/*	$NetBSD: arc4random.c,v 1.21 2013/10/17 23:56:17 christos Exp $	*/
 /*	$OpenBSD: arc4random.c,v 1.6 2001/06/05 05:05:38 pvalchev Exp $	*/
 
 /*
@@ -27,7 +27,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: arc4random.c,v 1.20 2012/08/20 21:38:09 dsl Exp $);
+__RCSID($NetBSD: arc4random.c,v 1.21 2013/10/17 23:56:17 christos Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -152,7 +152,7 @@ arc4_stir(struct arc4_stream *as)
 	as-stirred = 1;
 }
 
-static __always_inline uint8_t
+static __inline uint8_t
 arc4_getbyte_ij(struct arc4_stream *as, uint8_t *i, uint8_t *j)
 {
 	uint8_t si, sj;



CVS commit: src/lib/libc/rpc

2013-10-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 17 23:58:05 UTC 2013

Modified Files:
src/lib/libc/rpc: clnt_vc.c

Log Message:
Avoid casting gymnastics that lead to pointer aliasing by introducing an
inline function.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/rpc/clnt_vc.c

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

Modified files:

Index: src/lib/libc/rpc/clnt_vc.c
diff -u src/lib/libc/rpc/clnt_vc.c:1.23 src/lib/libc/rpc/clnt_vc.c:1.24
--- src/lib/libc/rpc/clnt_vc.c:1.23	Tue May  7 17:08:45 2013
+++ src/lib/libc/rpc/clnt_vc.c	Thu Oct 17 19:58:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: clnt_vc.c,v 1.23 2013/05/07 21:08:45 christos Exp $	*/
+/*	$NetBSD: clnt_vc.c,v 1.24 2013/10/17 23:58:05 christos Exp $	*/
 
 /*
  * Copyright (c) 2010, Oracle America, Inc.
@@ -38,7 +38,7 @@ static char *sccsid = @(#)clnt_tcp.c 1.
 static char *sccsid = @(#)clnt_tcp.c	2.2 88/08/01 4.0 RPCSRC;
 static char sccsid[] = @(#)clnt_vc.c 1.19 89/03/16 Copyr 1988 Sun Micro;
 #else
-__RCSID($NetBSD: clnt_vc.c,v 1.23 2013/05/07 21:08:45 christos Exp $);
+__RCSID($NetBSD: clnt_vc.c,v 1.24 2013/10/17 23:58:05 christos Exp $);
 #endif
 #endif
  
@@ -144,6 +144,33 @@ static cond_t   *vc_cv;
 #define __rpc_lock_value 0
 #endif
 
+static __inline void
+htonlp(void *dst, const void *src)
+{
+#if 0
+	uint32_t tmp;
+	memcpy(tmp, src, sizeof(tmp));
+	tmp = htonl(tmp);
+	memcpy(dst, tmp, sizeof(tmp));
+#else
+	/* We are aligned, so we think */
+	*(uint32_t *)dst = htonl(*(const uint32_t *)src);
+#endif
+}
+
+static __inline void
+ntohlp(void *dst, const void *src)
+{
+#if 0
+	uint32_t tmp;
+	memcpy(tmp, src, sizeof(tmp));
+	tmp = ntohl(tmp);
+	memcpy(dst, tmp, sizeof(tmp));
+#else
+	/* We are aligned, so we think */
+	*(uint32_t *)dst = htonl(*(const uint32_t *)src);
+#endif
+}
 
 /*
  * Create a client handle for a connection.
@@ -578,13 +605,12 @@ clnt_vc_control(
 		 * first element in the call structure
 		 * This will get the xid of the PREVIOUS call
 		 */
-		*(u_int32_t *)(void *)info =
-		ntohl(*(u_int32_t *)(void *)ct-ct_u.ct_mcalli);
+		ntohlp(info, ct-ct_u.ct_mcalli);
 		break;
 	case CLSET_XID:
 		/* This will set the xid of the NEXT call */
-		*(u_int32_t *)(void *)ct-ct_u.ct_mcalli =
-		htonl(*((u_int32_t *)(void *)info) + 1);
+		htonlp(ct-ct_u.ct_mcalli, (const char *)info +
+		sizeof(uint32_t));
 		/* increment by 1 as clnt_vc_call() decrements once */
 		break;
 	case CLGET_VERS:
@@ -594,15 +620,11 @@ clnt_vc_control(
 		 * begining of the RPC header. MUST be changed if the
 		 * call_struct is changed
 		 */
-		*(u_int32_t *)(void *)info =
-		ntohl(*(u_int32_t *)(void *)(ct-ct_u.ct_mcallc +
-		4 * BYTES_PER_XDR_UNIT));
+		ntohlp(info, ct-ct_u.ct_mcallc + 4 * BYTES_PER_XDR_UNIT);
 		break;
 
 	case CLSET_VERS:
-		*(u_int32_t *)(void *)(ct-ct_u.ct_mcallc +
-		4 * BYTES_PER_XDR_UNIT) =
-		htonl(*(u_int32_t *)(void *)info);
+		htonlp(ct-ct_u.ct_mcallc + 4 * BYTES_PER_XDR_UNIT, info);
 		break;
 
 	case CLGET_PROG:
@@ -612,15 +634,11 @@ clnt_vc_control(
 		 * begining of the RPC header. MUST be changed if the
 		 * call_struct is changed
 		 */
-		*(u_int32_t *)(void *)info =
-		ntohl(*(u_int32_t *)(void *)(ct-ct_u.ct_mcallc +
-		3 * BYTES_PER_XDR_UNIT));
+		ntohlp(info, ct-ct_u.ct_mcallc + 3 * BYTES_PER_XDR_UNIT);
 		break;
 
 	case CLSET_PROG:
-		*(u_int32_t *)(void *)(ct-ct_u.ct_mcallc +
-		3 * BYTES_PER_XDR_UNIT) =
-		htonl(*(u_int32_t *)(void *)info);
+		htonlp(ct-ct_u.ct_mcallc + 3 * BYTES_PER_XDR_UNIT, info);
 		break;
 
 	default:



CVS commit: src/sys/coda

2013-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Oct 18 00:03:35 UTC 2013

Modified Files:
src/sys/coda: coda_psdev.c

Log Message:
C requires a statement after a label, and a declaration is not a
statement, so create a block using {}.  From christos.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/coda/coda_psdev.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/coda/coda_psdev.c
diff -u src/sys/coda/coda_psdev.c:1.50 src/sys/coda/coda_psdev.c:1.51
--- src/sys/coda/coda_psdev.c:1.50	Thu Oct 17 20:54:24 2013
+++ src/sys/coda/coda_psdev.c	Fri Oct 18 00:03:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_psdev.c,v 1.50 2013/10/17 20:54:24 christos Exp $	*/
+/*	$NetBSD: coda_psdev.c,v 1.51 2013/10/18 00:03:35 riz Exp $	*/
 
 /*
  *
@@ -54,7 +54,7 @@
 /* These routines are the device entry points for Venus. */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_psdev.c,v 1.50 2013/10/17 20:54:24 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_psdev.c,v 1.51 2013/10/18 00:03:35 riz Exp $);
 
 extern int coda_nc_initialized;/* Set if cache has been initialized */
 
@@ -735,12 +735,14 @@ vcoda_modcmd(modcmd_t cmd, void *arg)
 	switch (cmd) {
 	case MODULE_CMD_INIT:
 #ifdef _MODULE
+	{
 		int cmajor, dmajor;
 		vcodaattach(NVCODA);
 
 		dmajor = cmajor = -1;
 		return devsw_attach(vcoda, NULL, dmajor,
 		vcoda_cdevsw, cmajor);
+	}
 #endif
 		break;
 



CVS commit: src/external/mit/xorg/lib

2013-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Oct 18 01:12:00 UTC 2013

Modified Files:
src/external/mit/xorg/lib/libX11: Makefile.libx11
src/external/mit/xorg/lib/libXi: Makefile

Log Message:
Before testing the value of HAVE_GCC, test if it's defined.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/mit/xorg/lib/libX11/Makefile.libx11
cvs rdiff -u -r1.10 -r1.11 src/external/mit/xorg/lib/libXi/Makefile

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/xorg/lib/libX11/Makefile.libx11
diff -u src/external/mit/xorg/lib/libX11/Makefile.libx11:1.11 src/external/mit/xorg/lib/libX11/Makefile.libx11:1.12
--- src/external/mit/xorg/lib/libX11/Makefile.libx11:1.11	Mon Jun  3 23:01:12 2013
+++ src/external/mit/xorg/lib/libX11/Makefile.libx11	Fri Oct 18 01:12:00 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.libx11,v 1.11 2013/06/03 23:01:12 christos Exp $
+#	$NetBSD: Makefile.libx11,v 1.12 2013/10/18 01:12:00 riz Exp $
 
 LIB=	X11
 .PATH:	${X11SRCDIR.${LIB}}/src
@@ -462,7 +462,7 @@ COPTS.Font.c+=		-Wno-error	# XXX xf86big
 COPTS.OpenDis.c+=	-Wno-error	# XXX xf86bigfstr.h
 COPTS.XlibInt.c+=	-Wno-error	# XXX xcmiscstr.h
 COPTS.XKBBind.c+=	-Wno-error	# uses XKeycodeToKeysym
-.if ${HAVE_GCC}  45
+.if defined(HAVE_GCC)   ${HAVE_GCC}  45
 COPTS.LiHosts.c+=	-Wno-error	# XXX: old gcc figures out that const
 	# cond because nHosts  max_hosts
 .endif

Index: src/external/mit/xorg/lib/libXi/Makefile
diff -u src/external/mit/xorg/lib/libXi/Makefile:1.10 src/external/mit/xorg/lib/libXi/Makefile:1.11
--- src/external/mit/xorg/lib/libXi/Makefile:1.10	Thu Jun  6 21:42:36 2013
+++ src/external/mit/xorg/lib/libXi/Makefile	Fri Oct 18 01:12:00 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.10 2013/06/06 21:42:36 mrg Exp $
+#	$NetBSD: Makefile,v 1.11 2013/10/18 01:12:00 riz Exp $
 
 .include bsd.own.mk
 
@@ -80,7 +80,7 @@ PKGDIST=	${LIB}
 COPTS.XExtInt.c+=	-Wno-error	# XXX
 COPTS.XSndExEv.c+=	-Wno-error	# XXX
 
-.if ${HAVE_GCC}  45
+.if defined(HAVE_GCC)  ${HAVE_GCC}  45
 COPTS.XGetFCtl.c+=	-Wno-error	# XXX
 .endif
 



CVS commit: [rmind-smpnet] src/sys

2013-10-17 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Fri Oct 18 02:32:12 UTC 2013

Modified Files:
src/sys/kern [rmind-smpnet]: uipc_socket.c
src/sys/sys [rmind-smpnet]: socketvar.h

Log Message:
Add soref() and sounref().


To generate a diff of this commit:
cvs rdiff -u -r1.215.4.2 -r1.215.4.3 src/sys/kern/uipc_socket.c
cvs rdiff -u -r1.130.2.1 -r1.130.2.2 src/sys/sys/socketvar.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/uipc_socket.c
diff -u src/sys/kern/uipc_socket.c:1.215.4.2 src/sys/kern/uipc_socket.c:1.215.4.3
--- src/sys/kern/uipc_socket.c:1.215.4.2	Wed Aug 28 23:59:35 2013
+++ src/sys/kern/uipc_socket.c	Fri Oct 18 02:32:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.215.4.2 2013/08/28 23:59:35 rmind Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.215.4.3 2013/10/18 02:32:12 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.215.4.2 2013/08/28 23:59:35 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.215.4.3 2013/10/18 02:32:12 rmind Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_sock_counters.h
@@ -528,6 +528,8 @@ socreate(int dom, struct socket **aso, i
 	so = soget(true);
 	so-so_type = type;
 	so-so_proto = prp;
+	so-so_refcnt = 1;
+
 	so-so_send = sosend;
 	so-so_receive = soreceive;
 #ifdef MBUFTRACE
@@ -607,6 +609,21 @@ fsocreate(int domain, struct socket **so
 	return error;
 }
 
+void
+soref(struct socket *so)
+{
+	atomic_inc_uint(so-so_refcnt);
+}
+
+void
+sounref(struct socket *so)
+{
+	if (atomic_dec_uint_nv(so-so_refcnt)  0) {
+		return;
+	}
+	soput(so);
+}
+
 int
 sofamily(const struct socket *so)
 {
@@ -661,7 +678,6 @@ solisten(struct socket *so, int backlog,
 void
 sofree(struct socket *so)
 {
-	u_int refs;
 
 	KASSERT(solocked(so));
 
@@ -691,13 +707,13 @@ sofree(struct socket *so)
 	KASSERT(!cv_has_waiters(so-so_rcv.sb_cv));
 	KASSERT(!cv_has_waiters(so-so_snd.sb_cv));
 	sorflush(so);
-	refs = so-so_aborting;	/* XXX */
 	/* Remove acccept filter if one is present. */
 	if (so-so_accf != NULL)
 		(void)accept_filt_clear(so);
 	sounlock(so);
-	if (refs == 0)		/* XXX */
-		soput(so);
+
+	/* Will soput() if the last reference. */
+	sounref(so);
 }
 
 /*
@@ -772,19 +788,23 @@ soabort(struct socket *so)
 {
 	u_int refs;
 	int error;
-	
+
 	KASSERT(solocked(so));
 	KASSERT(so-so_head == NULL);
 
-	so-so_aborting++;		/* XXX */
+	soref(so);
 	error = (*so-so_proto-pr_usrreqs-pr_generic)(so,
 	PRU_ABORT, NULL, NULL, NULL, NULL);
-	refs = --so-so_aborting;	/* XXX */
-	if (error || (refs == 0)) {
+	refs = so-so_refcnt;
+	sounref(so);
+
+	/* XXX: Fix PRU_ABORT to behave consistently. */
+	if (error || refs == 1) {
 		sofree(so);
 	} else {
 		sounlock(so);
 	}
+	sounref(so);
 	return error;
 }
 

Index: src/sys/sys/socketvar.h
diff -u src/sys/sys/socketvar.h:1.130.2.1 src/sys/sys/socketvar.h:1.130.2.2
--- src/sys/sys/socketvar.h:1.130.2.1	Wed Aug 28 15:21:49 2013
+++ src/sys/sys/socketvar.h	Fri Oct 18 02:32:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: socketvar.h,v 1.130.2.1 2013/08/28 15:21:49 rmind Exp $	*/
+/*	$NetBSD: socketvar.h,v 1.130.2.2 2013/10/18 02:32:12 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -128,7 +128,7 @@ struct socket {
 	short		so_options;	/* from socket call, see socket.h */
 	u_short		so_linger;	/* time to linger while closing */
 	short		so_state;	/* internal state flags SS_*, below */
-	int		so_unused;	/* used to be so_nbio */
+	unsigned	so_refcnt;	/* reference count */
 	void		*so_pcb;	/* protocol control block */
 	const struct protosw *so_proto;	/* protocol handle */
 /*
@@ -152,7 +152,7 @@ struct socket {
 	short		so_qlimit;	/* max number queued connections */
 	short		so_timeo;	/* connection timeout */
 	u_short		so_error;	/* error affecting connection */
-	u_short		so_aborting;	/* references from soabort() */
+	u_short		so_unused1;
 	pid_t		so_pgid;	/* pgid for signals */
 	u_long		so_oobmark;	/* chars to oob mark */
 	struct sockbuf	so_snd;		/* send buffer */
@@ -298,6 +298,8 @@ int	socreate(int, struct socket **, int,
 		 struct socket *);
 int	fsocreate(int, struct socket **, int, int, int *);
 int	sodisconnect(struct socket *);
+void	soref(struct socket *);
+void	sounref(struct socket *);
 void	sofree(struct socket *);
 int	sogetopt(struct socket *, struct sockopt *);
 void	sohasoutofband(struct socket *);