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

2016-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan 18 05:59:37 UTC 2016

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

Log Message:
Add comments. Fix comments. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/x86/procfs_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/x86/procfs_machdep.c
diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.9 src/sys/arch/x86/x86/procfs_machdep.c:1.10
--- src/sys/arch/x86/x86/procfs_machdep.c:1.9	Wed Jan 13 08:05:58 2016
+++ src/sys/arch/x86/x86/procfs_machdep.c	Mon Jan 18 05:59:37 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.9 2016/01/13 08:05:58 msaitoh Exp $ */
+/*	$NetBSD: procfs_machdep.c,v 1.10 2016/01/18 05:59:37 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.9 2016/01/13 08:05:58 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.10 2016/01/18 05:59:37 msaitoh Exp $");
 
 #include 
 #include 
@@ -56,8 +56,12 @@ __KERNEL_RCSID(0, "$NetBSD: procfs_machd
 #include 
 #include 
 
+/*
+ *  The feature table. The order is the saame as Linux's
+ *  x86/include/asm/cpufeatures.h.
+ */
 static const char * const x86_features[][32] = {
-	{ /* Common */
+	{ /* (0) Common */
 	"fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
 	"cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
 	"pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx",
@@ -69,13 +73,13 @@ static const char * const x86_features[]
 	NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL,
 	NULL, "fxsr_opt", "pdpe1gb", "rdtscp", NULL, "lm", "3dnowext","3dnow"},
 
-	{ /* Transmeta-defined (2) */
+	{ /* (2) Transmeta-defined */
 	"recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
-	{ /* Linux-defined (3) */
+	{ /* (3) Linux mapping */
 	"cxmmx", NULL, "cyrix_arr", "centaur_mcr", NULL,
 	"constant_tsc", NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -103,7 +107,7 @@ static const char * const x86_features[]
 	NULL, "tbm", "topoext", "perfctr_core",
 	"perfctr_nb", NULL, "bpext", NULL, "perfctr_l2", "mwaitx", NULL, NULL},
 
-	{ /* (7) Linux-defined */
+	{ /* (7) Linux mapping */
 	"ida", "arat", "cpb", "ebp", NULL, "pln", "pts", "dtherm",
 	"hw_pstate", "proc_feedback", "hwp", "hwp_notify", "hwp_act_window",
 	"hwp_epp", "hwp_pkg_req", "intel_pt",
@@ -126,19 +130,19 @@ static const char * const x86_features[]
 	"clwb", NULL, "avx512pf", "avx512er",
 	"avx512cd", "sha_ni", NULL, NULL},
 
-	{ /* (10) 000d eax*/
+	{ /* (10) 000d eax */
 	"xsaveopt", "xsavec", "xgetbv1", "xsaves", NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
-	{ /* (11) 0x000f:0 edx*/
+	{ /* (11) 0x000f:0 edx */
 	NULL, "cqm_llc", NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
-	{ /* (12) 0x000f:1 edx*/
+	{ /* (12) 0x000f:1 edx */
 	"cqm_occup_llc", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -200,7 +204,7 @@ procfs_getonefeatreg(uint32_t reg, const
 }
 
 /*
- * Print feature bit. The code assume that unused entry of x86_features[]
+ * Print feature bits. The code assume that unused entry of x86_features[]
  * is zero-cleared.
  *
  * XXX This function will be rewritten when all of linux entries are
@@ -241,6 +245,10 @@ procfs_getonecpufeatures(struct cpu_info
 	left);
 	diff = last - *left;
 
+	/* (10) 000d eax */
+	/* (11) 0x000f(ecx=0) edx */
+	/* (12) 0x000f(ecx=1) edx */
+
 	return 0; /* XXX */
 }
 



CVS commit: src/sys

2016-01-17 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Jan 18 06:08:26 UTC 2016

Modified Files:
src/sys/net: if_gif.c
src/sys/netinet: in_gif.c
src/sys/netinet6: in6_gif.c

Log Message:
Refactor protosw codes in gif(4). No functional change.

- remove unnecessary include
- reduce scopes


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/net/if_gif.c
cvs rdiff -u -r1.67 -r1.68 src/sys/netinet/in_gif.c
cvs rdiff -u -r1.64 -r1.65 src/sys/netinet6/in6_gif.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/net/if_gif.c
diff -u src/sys/net/if_gif.c:1.104 src/sys/net/if_gif.c:1.105
--- src/sys/net/if_gif.c:1.104	Fri Jan  8 03:55:39 2016
+++ src/sys/net/if_gif.c	Mon Jan 18 06:08:26 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gif.c,v 1.104 2016/01/08 03:55:39 knakahara Exp $	*/
+/*	$NetBSD: if_gif.c,v 1.105 2016/01/18 06:08:26 knakahara Exp $	*/
 /*	$KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.104 2016/01/08 03:55:39 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.105 2016/01/18 06:08:26 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -49,7 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -77,7 +76,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1
 #include 
 #include 
 #include 
-#include 
 #endif /* INET6 */
 
 #include 

Index: src/sys/netinet/in_gif.c
diff -u src/sys/netinet/in_gif.c:1.67 src/sys/netinet/in_gif.c:1.68
--- src/sys/netinet/in_gif.c:1.67	Fri Dec 25 06:47:56 2015
+++ src/sys/netinet/in_gif.c	Mon Jan 18 06:08:26 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: in_gif.c,v 1.67 2015/12/25 06:47:56 knakahara Exp $	*/
+/*	$NetBSD: in_gif.c,v 1.68 2016/01/18 06:08:26 knakahara Exp $	*/
 /*	$KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.67 2015/12/25 06:47:56 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.68 2016/01/18 06:08:26 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -79,7 +79,7 @@ int ip_gif_ttl = GIF_TTL;
 int ip_gif_ttl = 0;
 #endif
 
-const struct protosw in_gif_protosw = {
+static const struct protosw in_gif_protosw = {
 	.pr_type	= SOCK_RAW,
 	.pr_domain	= ,
 	.pr_protocol	= 0 /* IPPROTO_IPV[46] */,

Index: src/sys/netinet6/in6_gif.c
diff -u src/sys/netinet6/in6_gif.c:1.64 src/sys/netinet6/in6_gif.c:1.65
--- src/sys/netinet6/in6_gif.c:1.64	Fri Dec 25 06:47:57 2015
+++ src/sys/netinet6/in6_gif.c	Mon Jan 18 06:08:26 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_gif.c,v 1.64 2015/12/25 06:47:57 knakahara Exp $	*/
+/*	$NetBSD: in6_gif.c,v 1.65 2016/01/18 06:08:26 knakahara Exp $	*/
 /*	$KAME: in6_gif.c,v 1.62 2001/07/29 04:27:25 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.64 2015/12/25 06:47:57 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.65 2016/01/18 06:08:26 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -79,7 +79,7 @@ int	ip6_gif_hlim = GIF_HLIM;
 
 extern LIST_HEAD(, gif_softc) gif_softc_list;
 
-extern const struct ip6protosw in6_gif_protosw;
+static const struct ip6protosw in6_gif_protosw;
 
 /* 
  * family - family of the packet to be encapsulate. 
@@ -458,7 +458,7 @@ PR_WRAP_CTLOUTPUT(rip6_ctloutput)
 
 extern struct domain inet6domain;
 
-const struct ip6protosw in6_gif_protosw = {
+static const struct ip6protosw in6_gif_protosw = {
 	.pr_type	= SOCK_RAW,
 	.pr_domain	= ,
 	.pr_protocol	= 0 /* IPPROTO_IPV[46] */,



CVS commit: src/sys/dev/usb

2016-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 17 22:32:09 UTC 2016

Modified Files:
src/sys/dev/usb: if_urtwn.c

Log Message:
PR/50672: Andriy Voskoboinyk: fix write to the wrong register.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/usb/if_urtwn.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_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.39 src/sys/dev/usb/if_urtwn.c:1.40
--- src/sys/dev/usb/if_urtwn.c:1.39	Thu Dec 10 09:28:04 2015
+++ src/sys/dev/usb/if_urtwn.c	Sun Jan 17 17:32:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.39 2015/12/10 14:28:04 leot Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.40 2016/01/17 22:32:09 christos Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.39 2015/12/10 14:28:04 leot Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.40 2016/01/17 22:32:09 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -4562,7 +4562,7 @@ urtwn_chip_stop(struct urtwn_softc *sc)
 
 	reg = urtwn_read_2(sc, R92C_GPIO_MUXCFG + 2) & ~0x00f0;
 	reg |= (((reg & 0x000f) << 4) | 0x0780);
-	urtwn_write_2(sc, R92C_GPIO_PIN_CTRL+2, reg);
+	urtwn_write_2(sc, R92C_GPIO_PIN_MUXCFG + 2, reg);
 
 	/* Disable LED0 & 1 */
 	urtwn_write_2(sc, R92C_LEDCFG0, 0x8080);



CVS commit: src/external/gpl2/libmalloc/dist

2016-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 17 22:51:32 UTC 2016

Modified Files:
src/external/gpl2/libmalloc/dist: getpagesize.h

Log Message:
include unistd.h for getpagesize()


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/libmalloc/dist/getpagesize.h

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

Modified files:

Index: src/external/gpl2/libmalloc/dist/getpagesize.h
diff -u src/external/gpl2/libmalloc/dist/getpagesize.h:1.3 src/external/gpl2/libmalloc/dist/getpagesize.h:1.4
--- src/external/gpl2/libmalloc/dist/getpagesize.h:1.3	Fri Jan 15 10:13:28 2016
+++ src/external/gpl2/libmalloc/dist/getpagesize.h	Sun Jan 17 17:51:32 2016
@@ -1,16 +1,17 @@
-/*	$NetBSD: getpagesize.h,v 1.3 2016/01/15 15:13:28 christos Exp $	*/
+/*	$NetBSD: getpagesize.h,v 1.4 2016/01/17 22:51:32 christos Exp $	*/
 
 /* Emulate getpagesize on systems that lack it.  */
 
+#ifdef HAVE_UNISTD_H
+#include 
+#endif
+
 #ifndef HAVE_GETPAGESIZE
 
 #ifdef VMS
 #define getpagesize() 512
 #endif
 
-#ifdef HAVE_UNISTD_H
-#include 
-#endif
 
 #ifdef _SC_PAGESIZE
 #define getpagesize() sysconf(_SC_PAGESIZE)
@@ -22,7 +23,7 @@
 #define getpagesize() EXEC_PAGESIZE
 #else
 #ifdef NBPG
-#define getpagesize() NBPG * CLSIZE
+#define getpagesize() (NBPG * CLSIZE)
 #ifndef CLSIZE
 #define CLSIZE 1
 #endif /* no CLSIZE */



CVS commit: src/sys/sys

2016-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 17 23:16:46 UTC 2016

Modified Files:
src/sys/sys: conf.h

Log Message:
add /dev/full


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/sys/conf.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/sys/conf.h
diff -u src/sys/sys/conf.h:1.145 src/sys/sys/conf.h:1.146
--- src/sys/sys/conf.h:1.145	Fri Jul 25 03:56:14 2014
+++ src/sys/sys/conf.h	Sun Jan 17 18:16:46 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: conf.h,v 1.145 2014/07/25 07:56:14 dholland Exp $	*/
+/*	$NetBSD: conf.h,v 1.146 2016/01/17 23:16:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -235,6 +235,7 @@ int	seltrue_kqfilter(dev_t, struct knote
 #ifdef COMPAT_16
 #define	_DEV_ZERO_oARM	3	/* reserved: old ARM /dev/zero minor */
 #endif
+#define DEV_FULL	11	/* minor device 11 is '\0'/ENOSPC */
 #define	DEV_ZERO	12	/* minor device 12 is '\0'/rathole */
 
 enum devnode_class {



CVS commit: src/sys/dev

2016-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 17 23:17:04 UTC 2016

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

Log Message:
add /dev/full


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/mm.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/mm.c
diff -u src/sys/dev/mm.c:1.19 src/sys/dev/mm.c:1.20
--- src/sys/dev/mm.c:1.19	Fri Jul 25 04:10:35 2014
+++ src/sys/dev/mm.c	Sun Jan 17 18:17:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mm.c,v 1.19 2014/07/25 08:10:35 dholland Exp $	*/
+/*	$NetBSD: mm.c,v 1.20 2016/01/17 23:17:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2008, 2010 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mm.c,v 1.19 2014/07/25 08:10:35 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mm.c,v 1.20 2016/01/17 23:17:04 christos Exp $");
 
 #include "opt_compat_netbsd.h"
 
@@ -337,6 +337,11 @@ mm_readwrite(dev_t dev, struct uio *uio,
 			}
 			/* Break directly out of the loop. */
 			return 0;
+		case DEV_FULL:
+			if (uio->uio_rw == UIO_WRITE) {
+return ENOSPC;
+			}
+			/*FALLTHROUGH*/
 #if defined(COMPAT_16) && defined(__arm)
 		case _DEV_ZERO_oARM:
 #endif



CVS commit: src/etc

2016-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 17 23:18:19 UTC 2016

Modified Files:
src/etc: MAKEDEV.tmpl

Log Message:
Add /dev/full


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/etc/MAKEDEV.tmpl

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

Modified files:

Index: src/etc/MAKEDEV.tmpl
diff -u src/etc/MAKEDEV.tmpl:1.177 src/etc/MAKEDEV.tmpl:1.178
--- src/etc/MAKEDEV.tmpl:1.177	Sat Nov 21 07:11:56 2015
+++ src/etc/MAKEDEV.tmpl	Sun Jan 17 18:18:18 2016
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: MAKEDEV.tmpl,v 1.177 2015/11/21 12:11:56 pgoyette Exp $
+#	$NetBSD: MAKEDEV.tmpl,v 1.178 2016/01/17 23:18:18 christos Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -924,6 +924,7 @@ std)
 	mkdev		kmem	c %mem_chr% 1	640 $g_kmem
 	mkdev		mem	c %mem_chr% 0	640 $g_kmem
 	mkdev		null	c %mem_chr% 2	666
+	mkdev		full	c %mem_chr% 11	666
 	mkdev		zero	c %mem_chr% 12	666
 	mkdev		klog	c %log_chr% 0	600
 	mkdev		ksyms	c %ksyms_chr% 0 444



CVS commit: src/share/man/man4

2016-01-17 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Jan 18 00:34:43 UTC 2016

Modified Files:
src/share/man/man4: Makefile

Log Message:
Add full.4


To generate a diff of this commit:
cvs rdiff -u -r1.626 -r1.627 src/share/man/man4/Makefile

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/man4/Makefile
diff -u src/share/man/man4/Makefile:1.626 src/share/man/man4/Makefile:1.627
--- src/share/man/man4/Makefile:1.626	Tue Jan  5 11:24:43 2016
+++ src/share/man/man4/Makefile	Mon Jan 18 00:34:43 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.626 2016/01/05 11:24:43 msaitoh Exp $
+#	$NetBSD: Makefile,v 1.627 2016/01/18 00:34:43 kamil Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -24,7 +24,8 @@ MAN=	aac.4 ac97.4 acardide.4 aceride.4 a
 	dmphy.4 dpt.4 dpti.4 drm.4 drum.4 drvctl.4 dtv.4 dtviic.4 dwctwo.4 \
 	eap.4 ebus.4 edc.4 elmc.4 emuxki.4 en.4 envsys.4 ep.4 esh.4 \
 	esa.4 esiop.4 esm.4 eso.4 et.4 etherip.4 etphy.4 exphy.4 \
-	fast_ipsec.4 fd.4 filemon.4 finsio.4 flash.4 fpa.4 fms.4 fss.4 fujbp.4 fxp.4 \
+	fast_ipsec.4 fd.4 filemon.4 finsio.4 flash.4 fpa.4 fms.4 fss.4 \
+	fujbp.4 full.4 fxp.4 \
 	gcscaudio.4 gem.4 genfb.4 gentbi.4 geodeide.4 \
 	glxtphy.4 gpib.4 gpio.4 gpiolock.4 gpiopwm.4 gpiosim.4 gre.4 \
 	gphyter.4 gsip.4 \



CVS commit: src/sys/dev/usb

2016-01-17 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Mon Jan 18 02:45:05 UTC 2016

Modified Files:
src/sys/dev/usb: if_urtwn.c

Log Message:
Use correct register definition.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/usb/if_urtwn.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_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.40 src/sys/dev/usb/if_urtwn.c:1.41
--- src/sys/dev/usb/if_urtwn.c:1.40	Sun Jan 17 22:32:09 2016
+++ src/sys/dev/usb/if_urtwn.c	Mon Jan 18 02:45:05 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.40 2016/01/17 22:32:09 christos Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.41 2016/01/18 02:45:05 nonaka Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.40 2016/01/17 22:32:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.41 2016/01/18 02:45:05 nonaka Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -4562,7 +4562,7 @@ urtwn_chip_stop(struct urtwn_softc *sc)
 
 	reg = urtwn_read_2(sc, R92C_GPIO_MUXCFG + 2) & ~0x00f0;
 	reg |= (((reg & 0x000f) << 4) | 0x0780);
-	urtwn_write_2(sc, R92C_GPIO_PIN_MUXCFG + 2, reg);
+	urtwn_write_2(sc, R92C_GPIO_MUXCFG + 2, reg);
 
 	/* Disable LED0 & 1 */
 	urtwn_write_2(sc, R92C_LEDCFG0, 0x8080);



CVS commit: src/sys/arch/alpha/alpha

2016-01-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan 17 10:44:57 UTC 2016

Modified Files:
src/sys/arch/alpha/alpha: interrupt.c

Log Message:
PR port-alpha/50667: add missing va_start/va_end.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/alpha/alpha/interrupt.c

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

Modified files:

Index: src/sys/arch/alpha/alpha/interrupt.c
diff -u src/sys/arch/alpha/alpha/interrupt.c:1.80 src/sys/arch/alpha/alpha/interrupt.c:1.81
--- src/sys/arch/alpha/alpha/interrupt.c:1.80	Mon Feb  6 02:14:11 2012
+++ src/sys/arch/alpha/alpha/interrupt.c	Sun Jan 17 10:44:57 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: interrupt.c,v 1.80 2012/02/06 02:14:11 matt Exp $ */
+/* $NetBSD: interrupt.c,v 1.81 2016/01/17 10:44:57 martin Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.80 2012/02/06 02:14:11 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.81 2016/01/17 10:44:57 martin Exp $");
 
 #include 
 #include 
@@ -518,8 +518,12 @@ rlprintf(struct timeval *t, const char *
 	va_list ap;
 	static const struct timeval msgperiod[1] = {{ 5, 0 }};
 
-	if (ratecheck(t, msgperiod))
-		vprintf(fmt, ap);
+	if (!ratecheck(t, msgperiod))
+		return;
+
+	va_start(ap, fmt);
+	vprintf(fmt, ap);
+	va_end(ap);
 }
 
 const static uint8_t ipl2psl_table[] = {



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

2016-01-17 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 17 08:05:20 UTC 2016

Modified Files:
src/sys/arch/hp300/stand: Makefile.buildboot
src/sys/arch/hp300/stand/inst: version
src/sys/arch/hp300/stand/uboot: version

Log Message:
Enable LIBSA_CREAD_NOCRC.  PR/50638

Bump version to denote user visible change.
Tested on HP9000/382.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/hp300/stand/Makefile.buildboot
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hp300/stand/inst/version
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hp300/stand/uboot/version

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

Modified files:

Index: src/sys/arch/hp300/stand/Makefile.buildboot
diff -u src/sys/arch/hp300/stand/Makefile.buildboot:1.34 src/sys/arch/hp300/stand/Makefile.buildboot:1.35
--- src/sys/arch/hp300/stand/Makefile.buildboot:1.34	Sun Apr 13 15:45:26 2014
+++ src/sys/arch/hp300/stand/Makefile.buildboot	Sun Jan 17 08:05:20 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.buildboot,v 1.34 2014/04/13 15:45:26 tsutsui Exp $
+#	$NetBSD: Makefile.buildboot,v 1.35 2016/01/17 08:05:20 tsutsui Exp $
 
 # RELOC=FFF0 allows for boot prog up to FF000 (1044480) bytes long
 RELOC=	FFF0
@@ -47,6 +47,7 @@ CPPFLAGS+=		-DHIL_KEYBOARD -DUK_KEYBOARD
 CPPFLAGS+=		-DDOMAIN_KEYBOARD
 CPPFLAGS+=		-D_STANDALONE -DCOMPAT_NOLABEL -Dhp300
 CPPFLAGS+=		-DCOMPAT_UFS -DNO_LSEEK
+CPPFLAGS+=		-DLIBSA_CREAD_NOCRC
 
 # if sun bootparams is desired
 #CPPFLAGS+= -DSUN_BOOTPARAMS

Index: src/sys/arch/hp300/stand/inst/version
diff -u src/sys/arch/hp300/stand/inst/version:1.12 src/sys/arch/hp300/stand/inst/version:1.13
--- src/sys/arch/hp300/stand/inst/version:1.12	Sat Apr 26 07:53:41 2014
+++ src/sys/arch/hp300/stand/inst/version	Sun Jan 17 08:05:20 2016
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.12 2014/04/26 07:53:41 tsutsui Exp $
+$NetBSD: version,v 1.13 2016/01/17 08:05:20 tsutsui Exp $
 
 1.1:	Initial version
 1.2:	Added support for HP-IB cartridge tapes
@@ -12,3 +12,4 @@ $NetBSD: version,v 1.12 2014/04/26 07:53
 1.10:	Pull OpenBSD's ite driver reorganization.
 1.11:	Add support for framebuffers on HP362 and HP382.
 1.12:	Add and fix support for HP425e mcclock, sti framebuffer, apci and dnkbd.
+1.13:	Disable slow gunzip CRC32 calculation.

Index: src/sys/arch/hp300/stand/uboot/version
diff -u src/sys/arch/hp300/stand/uboot/version:1.19 src/sys/arch/hp300/stand/uboot/version:1.20
--- src/sys/arch/hp300/stand/uboot/version:1.19	Sat Apr 26 07:53:41 2014
+++ src/sys/arch/hp300/stand/uboot/version	Sun Jan 17 08:05:20 2016
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.19 2014/04/26 07:53:41 tsutsui Exp $
+$NetBSD: version,v 1.20 2016/01/17 08:05:20 tsutsui Exp $
 
 1.1:	Initial version
 1.2:	Added support for network booting
@@ -19,3 +19,4 @@ $NetBSD: version,v 1.19 2014/04/26 07:53
 1.17:	Pull OpenBSD's ite driver reorganization.
 1.18:	Add support for framebuffers on HP362 and HP382.
 1.19:	Add and fix support for HP425e mcclock, sti framebuffer, apci and dnkbd.
+1.20:	Disable slow gunzip CRC32 calculation.



CVS commit: src/usr.bin/m4

2016-01-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Jan 17 11:24:28 UTC 2016

Modified Files:
src/usr.bin/m4: m4.1

Log Message:
Fix some macros. Sort stuff some more.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/m4/m4.1

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

Modified files:

Index: src/usr.bin/m4/m4.1
diff -u src/usr.bin/m4/m4.1:1.26 src/usr.bin/m4/m4.1:1.27
--- src/usr.bin/m4/m4.1:1.26	Sat Jan 16 21:15:51 2016
+++ src/usr.bin/m4/m4.1	Sun Jan 17 11:24:28 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: m4.1,v 1.26 2016/01/16 21:15:51 christos Exp $
+.\"	$NetBSD: m4.1,v 1.27 2016/01/17 11:24:28 wiz Exp $
 .\"	@(#) $OpenBSD: m4.1,v 1.56 2009/10/14 17:19:47 sthen Exp $
 .\"
 .\" Copyright (c) 1989, 1993
@@ -39,7 +39,7 @@
 .Nd macro language processor
 .Sh SYNOPSIS
 .Nm m4
-.Op Fl EgGiPQsv
+.Op Fl EGgiPQsv
 .Oo
 .Sm off
 .Fl D Ar name Op No = Ar value
@@ -134,16 +134,16 @@ turn on all options.
 .Pp
 By default, trace is set to
 .Qq eq .
-.If Fl E , Fl Fl fatal-warnings
+.It Fl E , Fl Fl fatal-warnings
 Warnings make
 .Nm
 exit.
-.If Fl e , Fl Fl error-output Ar filename
+.It Fl e , Fl Fl error-output Ar filename
 Redirect error output to filename.
-.If Fl F , Fl Fl freeze-state Ar filename
+.It Fl F , Fl Fl freeze-state Ar filename
 Save the input state to
 .Ar filename .
-.If Fl G , Fl Fl traditional
+.It Fl G , Fl Fl traditional
 Disable GNU-m4 extensions.
 .It Fl g , Fl Fl gnu
 Activate GNU-m4 compatibility mode.
@@ -161,14 +161,14 @@ Print help message and exit.
 Add directory
 .Ar dirname
 to the include path.
-.It Fl o Ar filename
-Send trace output to
-.Ar filename .
 .It Fl i , Fl Fl interactive
 Set unbuffered output, disable tty signals.
 .It Fl L , Fl Fl nesting-limit
 Set the nesting limit in macro expansions.
 This is unimplemented and unlimited.
+.It Fl o Ar filename
+Send trace output to
+.Ar filename .
 .It Fl P , Fl Fl prefix-builtins
 Prefix all built-in macros with
 .Sq m4_ .



CVS commit: src/usr.sbin/lpr/pac

2016-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 17 14:50:31 UTC 2016

Modified Files:
src/usr.sbin/lpr/pac: pac.c

Log Message:
PR/50666: David Binderman:
He's out of jail and out of bail and that's the way it goes:
free(base);


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/lpr/pac/pac.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/lpr/pac/pac.c
diff -u src/usr.sbin/lpr/pac/pac.c:1.23 src/usr.sbin/lpr/pac/pac.c:1.24
--- src/usr.sbin/lpr/pac/pac.c:1.23	Tue Aug 30 15:27:37 2011
+++ src/usr.sbin/lpr/pac/pac.c	Sun Jan 17 09:50:31 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pac.c,v 1.23 2011/08/30 19:27:37 joerg Exp $	*/
+/*	$NetBSD: pac.c,v 1.24 2016/01/17 14:50:31 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)pac.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: pac.c,v 1.23 2011/08/30 19:27:37 joerg Exp $");
+__RCSID("$NetBSD: pac.c,v 1.24 2016/01/17 14:50:31 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -255,7 +255,7 @@ dumpit(void)
 
 	hp = hashtab[0];
 	hno = 1;
-	base = (struct hent **) calloc(sizeof hp, hcount);
+	base = calloc(sizeof hp, hcount);
 	if (base == NULL)
 		err(1, "calloc");
 	for (ap = base, c = hcount; c--; ap++) {
@@ -284,6 +284,7 @@ dumpit(void)
 		printf("Sum:%7.2f %4d $%7.2f\n", feet, runs, 
 			feet * price * runs);
 	}
+	free(base);
 }
 
 /*



CVS commit: src/usr.bin/make

2016-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 17 15:30:23 UTC 2016

Modified Files:
src/usr.bin/make: job.c meta.c

Log Message:
Use FD_CLOEXEC (Tilman Sauerbeck)


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/usr.bin/make/job.c
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/make/meta.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.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.182 src/usr.bin/make/job.c:1.183
--- src/usr.bin/make/job.c:1.182	Fri Jan  8 19:55:17 2016
+++ src/usr.bin/make/job.c	Sun Jan 17 10:30:23 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.182 2016/01/09 00:55:17 christos Exp $	*/
+/*	$NetBSD: job.c,v 1.183 2016/01/17 15:30:23 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.182 2016/01/09 00:55:17 christos Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.183 2016/01/17 15:30:23 christos Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)job.c	8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: job.c,v 1.182 2016/01/09 00:55:17 christos Exp $");
+__RCSID("$NetBSD: job.c,v 1.183 2016/01/17 15:30:23 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -412,8 +412,8 @@ JobCreatePipe(Job *job, int minfd)
 }
 
 /* Set close-on-exec flag for both */
-(void)fcntl(job->jobPipe[0], F_SETFD, 1);
-(void)fcntl(job->jobPipe[1], F_SETFD, 1);
+(void)fcntl(job->jobPipe[0], F_SETFD, FD_CLOEXEC);
+(void)fcntl(job->jobPipe[1], F_SETFD, FD_CLOEXEC);
 
 /*
  * We mark the input side of the pipe non-blocking; we poll(2) the
@@ -1582,7 +1582,7 @@ JobStart(GNode *gn, int flags)
 	if (job->cmdFILE == NULL) {
 	Punt("Could not fdopen %s", tfile);
 	}
-	(void)fcntl(FILENO(job->cmdFILE), F_SETFD, 1);
+	(void)fcntl(FILENO(job->cmdFILE), F_SETFD, FD_CLOEXEC);
 	/*
 	 * Send the commands to the command file, flush all its buffers then
 	 * rewind and remove the thing.
@@ -2835,8 +2835,8 @@ Job_ServerStart(int max_tokens, int jp_0
 	/* Pipe passed in from parent */
 	tokenWaitJob.inPipe = jp_0;
 	tokenWaitJob.outPipe = jp_1;
-	(void)fcntl(jp_0, F_SETFD, 1);
-	(void)fcntl(jp_1, F_SETFD, 1);
+	(void)fcntl(jp_0, F_SETFD, FD_CLOEXEC);
+	(void)fcntl(jp_1, F_SETFD, FD_CLOEXEC);
 	return;
 }
 

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.41 src/usr.bin/make/meta.c:1.42
--- src/usr.bin/make/meta.c:1.41	Mon Nov 30 18:37:56 2015
+++ src/usr.bin/make/meta.c	Sun Jan 17 10:30:23 2016
@@ -1,4 +1,4 @@
-/*  $NetBSD: meta.c,v 1.41 2015/11/30 23:37:56 sjg Exp $ */
+/*  $NetBSD: meta.c,v 1.42 2016/01/17 15:30:23 christos Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -144,8 +144,8 @@ filemon_open(BuildMon *pbm)
 	err(1, "Could not set filemon file descriptor!");
 }
 /* we don't need these once we exec */
-(void)fcntl(pbm->mon_fd, F_SETFD, 1);
-(void)fcntl(pbm->filemon_fd, F_SETFD, 1);
+(void)fcntl(pbm->mon_fd, F_SETFD, FD_CLOEXEC);
+(void)fcntl(pbm->filemon_fd, F_SETFD, FD_CLOEXEC);
 }
 
 /*
@@ -1423,8 +1423,8 @@ meta_compat_start(void)
 if (pipe(childPipe) < 0)
 	Punt("Cannot create pipe: %s", strerror(errno));
 /* Set close-on-exec flag for both */
-(void)fcntl(childPipe[0], F_SETFD, 1);
-(void)fcntl(childPipe[1], F_SETFD, 1);
+(void)fcntl(childPipe[0], F_SETFD, FD_CLOEXEC);
+(void)fcntl(childPipe[1], F_SETFD, FD_CLOEXEC);
 }
 
 void



CVS commit: src/sbin/route

2016-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 17 15:59:26 UTC 2016

Modified Files:
src/sbin/route: route.c

Log Message:
PR/50671: David Binderman: fix memory leak.


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/sbin/route/route.c

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

Modified files:

Index: src/sbin/route/route.c
diff -u src/sbin/route/route.c:1.151 src/sbin/route/route.c:1.152
--- src/sbin/route/route.c:1.151	Mon Mar 23 14:33:17 2015
+++ src/sbin/route/route.c	Sun Jan 17 10:59:26 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.151 2015/03/23 18:33:17 roy Exp $	*/
+/*	$NetBSD: route.c,v 1.152 2016/01/17 15:59:26 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)route.c	8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.151 2015/03/23 18:33:17 roy Exp $");
+__RCSID("$NetBSD: route.c,v 1.152 2016/01/17 15:59:26 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -660,22 +660,22 @@ newroute(int argc, char *const *argv)
 		} else
 			break;
 	}
-	if (*cmd == 'g')
-		return ret != 0;
-	if (!qflag) {
-		oerrno = errno;
-		(void)printf("%s %s %s", cmd, ishost? "host" : "net", dest);
-		if (*gateway) {
-			(void)printf(": gateway %s", gateway);
-			if (attempts > 1 && ret == 0 && af == AF_INET)
-			(void)printf(" (%s)",
-			inet_ntoa(soup->so_gate->sin.sin_addr));
-		}
-		if (ret == 0)
-			(void)printf("\n");
-		else
-			(void)printf(": %s\n", route_strerror(oerrno));
+	if (*cmd == 'g' || qflag)
+		goto out;
+
+	oerrno = errno;
+	(void)printf("%s %s %s", cmd, ishost? "host" : "net", dest);
+	if (*gateway) {
+		(void)printf(": gateway %s", gateway);
+		if (attempts > 1 && ret == 0 && af == AF_INET)
+		(void)printf(" (%s)",
+			inet_ntoa(soup->so_gate->sin.sin_addr));
 	}
+	if (ret == 0)
+		(void)printf("\n");
+	else
+		(void)printf(": %s\n", route_strerror(oerrno));
+out:
 	free(sou.so_dst);
 	free(sou.so_gate);
 	free(sou.so_mask);



CVS commit: src/libexec/ftpd

2016-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 17 14:46:07 UTC 2016

Modified Files:
src/libexec/ftpd: cmds.c

Log Message:
PR/50665: David Binderman: move "dir" to the outer scope so it stays alive
when the pointer is used later.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/libexec/ftpd/cmds.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/ftpd/cmds.c
diff -u src/libexec/ftpd/cmds.c:1.34 src/libexec/ftpd/cmds.c:1.35
--- src/libexec/ftpd/cmds.c:1.34	Mon Aug 10 03:32:49 2015
+++ src/libexec/ftpd/cmds.c	Sun Jan 17 09:46:07 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmds.c,v 1.34 2015/08/10 07:32:49 shm Exp $	*/
+/*	$NetBSD: cmds.c,v 1.35 2016/01/17 14:46:07 christos Exp $	*/
 
 /*
  * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: cmds.c,v 1.34 2015/08/10 07:32:49 shm Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.35 2016/01/17 14:46:07 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -600,7 +600,7 @@ static void
 fact_perm(const char *fact, FILE *fd, factelem *fe)
 {
 	int		rok, wok, xok, pdirwok;
-	struct stat	*pdir;
+	struct stat	*pdir, dir;
 
 	if (fe->stat->st_uid == geteuid()) {
 		rok = ((fe->stat->st_mode & S_IRUSR) != 0);
@@ -627,7 +627,6 @@ fact_perm(const char *fact, FILE *fd, fa
 	if (pdir == NULL && CURCLASS_FLAGS_ISSET(modify)) {
 		size_t		len;
 		char		realdir[MAXPATHLEN], *p;
-		struct stat	dir;
 
 		len = strlcpy(realdir, fe->path, sizeof(realdir));
 		if (len < sizeof(realdir) - 4) {



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

2016-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 17 14:57:18 UTC 2016

Modified Files:
src/sys/arch/i386/stand/lib/netif: 3c90xb.c etherdrv.h

Log Message:
PR/50668: David Binderman: Don't compare unsigned to -1


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/i386/stand/lib/netif/3c90xb.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/lib/netif/etherdrv.h

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

Modified files:

Index: src/sys/arch/i386/stand/lib/netif/3c90xb.c
diff -u src/sys/arch/i386/stand/lib/netif/3c90xb.c:1.14 src/sys/arch/i386/stand/lib/netif/3c90xb.c:1.15
--- src/sys/arch/i386/stand/lib/netif/3c90xb.c:1.14	Sun Dec 14 13:46:33 2008
+++ src/sys/arch/i386/stand/lib/netif/3c90xb.c	Sun Jan 17 09:57:18 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: 3c90xb.c,v 1.14 2008/12/14 18:46:33 christos Exp $ */
+/* $NetBSD: 3c90xb.c,v 1.15 2016/01/17 14:57:18 christos Exp $ */
 
 /*
  * Copyright (c) 1999
@@ -291,7 +291,7 @@ ex_probemedia(void)
 	}
 	printf("unknown connector\n");
 bad:
-	ether_medium = -1;
+	ether_medium = ETHERMEDIUM_BAD;
 }
 
 int
@@ -346,7 +346,7 @@ found:
 		ether_medium = ETHERMEDIUM_MII;
 	else {
 		ex_probemedia();
-		if (ether_medium < 0)
+		if (ether_medium == ETHERMEDIUM_BAD)
 			return 0;
 	}
 

Index: src/sys/arch/i386/stand/lib/netif/etherdrv.h
diff -u src/sys/arch/i386/stand/lib/netif/etherdrv.h:1.9 src/sys/arch/i386/stand/lib/netif/etherdrv.h:1.10
--- src/sys/arch/i386/stand/lib/netif/etherdrv.h:1.9	Sun Dec 14 13:46:33 2008
+++ src/sys/arch/i386/stand/lib/netif/etherdrv.h	Sun Jan 17 09:57:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: etherdrv.h,v 1.9 2008/12/14 18:46:33 christos Exp $	*/
+/*	$NetBSD: etherdrv.h,v 1.10 2016/01/17 14:57:18 christos Exp $	*/
 
 /*
  * Copyright (c) 1996
@@ -32,6 +32,7 @@ int EtherReceive(char *, int);
 void EtherStop(void);
 
 extern unsigned ether_medium;
+#define ETHERMEDIUM_BAD ((unsigned)-1)
 #define ETHERMEDIUM_BNC 0
 #define ETHERMEDIUM_UTP 1
 #define ETHERMEDIUM_AUI 2



CVS commit: src/sys/netinet

2016-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 17 15:08:10 UTC 2016

Modified Files:
src/sys/netinet: ip_mroute.c

Log Message:
PR/50670: David Binderman: Tidy up debugging printfs to avoid if else confusion.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/netinet/ip_mroute.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/netinet/ip_mroute.c
diff -u src/sys/netinet/ip_mroute.c:1.132 src/sys/netinet/ip_mroute.c:1.133
--- src/sys/netinet/ip_mroute.c:1.132	Mon Aug 24 18:21:26 2015
+++ src/sys/netinet/ip_mroute.c	Sun Jan 17 10:08:10 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_mroute.c,v 1.132 2015/08/24 22:21:26 pooka Exp $	*/
+/*	$NetBSD: ip_mroute.c,v 1.133 2016/01/17 15:08:10 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -93,7 +93,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.132 2015/08/24 22:21:26 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.133 2016/01/17 15:08:10 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -182,8 +182,11 @@ u_int		mrtdebug = 0;	  /* debug level 	*
 u_int   	tbfdebug = 0; /* tbf debug level 	*/
 #ifdef RSVP_ISI
 u_int		rsvpdebug = 0;	  /* rsvp debug level   */
+#define	RSVP_DPRINTF(a)	do if (rsvpdebug) printf a; while (/*CONSTCOND*/0)
 extern struct socket *ip_rsvpd;
 extern int rsvp_on;
+#else
+#define	RSVP_DPRINTF(a)	do {} while (/*CONSTCOND*/0)
 #endif /* RSVP_ISI */
 
 /* vif attachment using sys/netinet/ip_encap.c */
@@ -1339,17 +1342,19 @@ ip_mforward(struct mbuf *m, struct ifnet
 	if (imo && ((vifi = imo->imo_multicast_vif) < numvifs)) {
 		if (ip->ip_ttl < MAXTTL)
 			ip->ip_ttl++;	/* compensate for -1 in *_send routines */
-		if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) {
+		if (ip->ip_p == IPPROTO_RSVP) {
 			struct vif *vifp = viftable + vifi;
-			printf("Sending IPPROTO_RSVP from %x to %x on vif %d (%s%s)\n",
+			RSVP_DPRINTF(("%s: Sending IPPROTO_RSVP from %x to %x"
+			" on vif %d (%s%s)\n", __func__,
 			ntohl(ip->ip_src), ntohl(ip->ip_dst), vifi,
 			(vifp->v_flags & VIFF_TUNNEL) ? "tunnel on " : "",
-			vifp->v_ifp->if_xname);
+			vifp->v_ifp->if_xname));
 		}
 		return (ip_mdq(m, ifp, NULL, vifi));
 	}
-	if (rsvpdebug && ip->ip_p == IPPROTO_RSVP) {
-		printf("Warning: IPPROTO_RSVP from %x to %x without vif option\n",
+	if (ip->ip_p == IPPROTO_RSVP) {
+		RSVP_DPRINTF(("%s: Warning: IPPROTO_RSVP from %x to %x"
+		" without vif option\n", __func__,
 		ntohl(ip->ip_src), ntohl(ip->ip_dst));
 	}
 #endif /* RSVP_ISI */
@@ -2207,9 +2212,8 @@ ip_rsvp_vif_init(struct socket *so, stru
 {
 	int vifi, s;
 
-	if (rsvpdebug)
-		printf("ip_rsvp_vif_init: so_type = %d, pr_protocol = %d\n",
-		so->so_type, so->so_proto->pr_protocol);
+	RSVP_DPRINTF(("%s: so_type = %d, pr_protocol = %d\n", __func__
+	so->so_type, so->so_proto->pr_protocol));
 
 	if (so->so_type != SOCK_RAW ||
 	so->so_proto->pr_protocol != IPPROTO_RSVP)
@@ -2221,9 +2225,7 @@ ip_rsvp_vif_init(struct socket *so, stru
 	}
 	vifi = *(mtod(m, int *));
 
-	if (rsvpdebug)
-		printf("ip_rsvp_vif_init: vif = %d rsvp_on = %d\n",
-		   vifi, rsvp_on);
+	RSVP_DPRINTF(("%s: vif = %d rsvp_on = %d\n", __func__, vifi, rsvp_on));
 
 	s = splsoftnet();
 
@@ -2258,9 +2260,8 @@ ip_rsvp_vif_done(struct socket *so, stru
 {
 	int vifi, s;
 
-	if (rsvpdebug)
-		printf("ip_rsvp_vif_done: so_type = %d, pr_protocol = %d\n",
-		so->so_type, so->so_proto->pr_protocol);
+	RSVP_DPRINTF(("%s: so_type = %d, pr_protocol = %d\n", __func__,
+	so->so_type, so->so_proto->pr_protocol));
 
 	if (so->so_type != SOCK_RAW ||
 	so->so_proto->pr_protocol != IPPROTO_RSVP)
@@ -2280,9 +2281,8 @@ ip_rsvp_vif_done(struct socket *so, stru
 		return (EADDRNOTAVAIL);
 	}
 
-	if (rsvpdebug)
-		printf("ip_rsvp_vif_done: v_rsvpd = %x so = %x\n",
-		viftable[vifi].v_rsvpd, so);
+	RSVP_DPRINTF(("%s: v_rsvpd = %x so = %x\n", __func__,
+	viftable[vifi].v_rsvpd, so));
 
 	viftable[vifi].v_rsvpd = NULL;
 	/*
@@ -2340,8 +2340,7 @@ rsvp_input(struct mbuf *m, struct ifnet 
 	struct ip *ip = mtod(m, struct ip *);
 	struct sockaddr_in rsvp_src;
 
-	if (rsvpdebug)
-		printf("rsvp_input: rsvp_on %d\n", rsvp_on);
+	RSVP_DPRINTF(("%s: rsvp_on %d\n", __func__, rsvp_on));
 
 	/*
 	 * Can still get packets with rsvp_on = 0 if there is a local member
@@ -2358,17 +2357,15 @@ rsvp_input(struct mbuf *m, struct ifnet 
 	 * it and ignore the new ones.
 	 */
 	if (ip_rsvpd != NULL) {
-		if (rsvpdebug)
-			printf("rsvp_input: "
-			"Sending packet up old-style socket\n");
+		RSVP_DPRINTF(("%s: Sending packet up old-style socket\n",
+		__func__));
 		rip_input(m);	/*XXX*/
 		return;
 	}
 
 	s = splsoftnet();
 
-	if (rsvpdebug)
-		printf("rsvp_input: check vifs\n");
+	RSVP_DPRINTF(("%s: check vifs\n", __func__));
 
 	/* Find which vif the packet arrived on. */
 	for (vifi = 0; vifi < numvifs; vifi++) {
@@ -2378,25 

CVS commit: src/usr.bin/make

2016-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 17 17:45:21 UTC 2016

Modified Files:
src/usr.bin/make: arch.c compat.c cond.c job.c main.c make.c meta.c
parse.c suff.c targ.c

Log Message:
remove free NULL checks (Tilman Sauerbeck)


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.bin/make/arch.c
cvs rdiff -u -r1.102 -r1.103 src/usr.bin/make/compat.c
cvs rdiff -u -r1.72 -r1.73 src/usr.bin/make/cond.c
cvs rdiff -u -r1.184 -r1.185 src/usr.bin/make/job.c
cvs rdiff -u -r1.237 -r1.238 src/usr.bin/make/main.c
cvs rdiff -u -r1.93 -r1.94 src/usr.bin/make/make.c
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/make/meta.c
cvs rdiff -u -r1.208 -r1.209 src/usr.bin/make/parse.c
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/make/suff.c
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/make/targ.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.bin/make/arch.c
diff -u src/usr.bin/make/arch.c:1.66 src/usr.bin/make/arch.c:1.67
--- src/usr.bin/make/arch.c:1.66	Sun Jan 17 10:32:38 2016
+++ src/usr.bin/make/arch.c	Sun Jan 17 12:45:21 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.66 2016/01/17 15:32:38 christos Exp $	*/
+/*	$NetBSD: arch.c,v 1.67 2016/01/17 17:45:21 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.66 2016/01/17 15:32:38 christos Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.67 2016/01/17 17:45:21 christos Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)arch.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: arch.c,v 1.66 2016/01/17 15:32:38 christos Exp $");
+__RCSID("$NetBSD: arch.c,v 1.67 2016/01/17 17:45:21 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -203,8 +203,7 @@ ArchFree(void *ap)
 	free(Hash_GetValue(entry));
 
 free(a->name);
-if (a->fnametab)
-	free(a->fnametab);
+free(a->fnametab);
 Hash_DeleteTable(>members);
 free(a);
 }
@@ -261,8 +260,8 @@ Arch_ParseArchive(char **linePtr, Lst no
 	char	*result;
 
 	result = Var_Parse(cp, ctxt, TRUE, TRUE, FALSE, , );
-	if (freeIt)
-		free(freeIt);
+	free(freeIt);
+
 	if (result == var_Error) {
 		return(FAILURE);
 	} else {
@@ -302,8 +301,8 @@ Arch_ParseArchive(char **linePtr, Lst no
 		char	*result;
 
 		result = Var_Parse(cp, ctxt, TRUE, TRUE, FALSE, , );
-		if (freeIt)
-		free(freeIt);
+		free(freeIt);
+
 		if (result == var_Error) {
 		return(FAILURE);
 		} else {
@@ -710,8 +709,7 @@ ArchStatMember(char *archive, char *memb
 badarch:
 fclose(arch);
 Hash_DeleteTable(>members);
-if (ar->fnametab)
-	free(ar->fnametab);
+free(ar->fnametab);
 free(ar);
 return NULL;
 }
@@ -996,10 +994,10 @@ Arch_Touch(GNode *gn)
 arch = ArchFindMember(Var_Value(ARCHIVE, gn, ),
 			  Var_Value(MEMBER, gn, ),
 			  , "r+");
-if (p1)
-	free(p1);
-if (p2)
-	free(p2);
+
+free(p1);
+free(p2);
+
 snprintf(arh.ar_date, sizeof(arh.ar_date), "%-12ld", (long) now);
 
 if (arch != NULL) {
@@ -1078,10 +1076,9 @@ Arch_MTime(GNode *gn)
 arhPtr = ArchStatMember(Var_Value(ARCHIVE, gn, ),
 			 Var_Value(MEMBER, gn, ),
 			 TRUE);
-if (p1)
-	free(p1);
-if (p2)
-	free(p2);
+
+free(p1);
+free(p2);
 
 if (arhPtr != NULL) {
 	modTime = (time_t)strtol(arhPtr->ar_date, NULL, 10);

Index: src/usr.bin/make/compat.c
diff -u src/usr.bin/make/compat.c:1.102 src/usr.bin/make/compat.c:1.103
--- src/usr.bin/make/compat.c:1.102	Fri Jan  8 19:55:17 2016
+++ src/usr.bin/make/compat.c	Sun Jan 17 12:45:21 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.102 2016/01/09 00:55:17 christos Exp $	*/
+/*	$NetBSD: compat.c,v 1.103 2016/01/17 17:45:21 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: compat.c,v 1.102 2016/01/09 00:55:17 christos Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.103 2016/01/17 17:45:21 christos Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)compat.c	8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: compat.c,v 1.102 2016/01/09 00:55:17 christos Exp $");
+__RCSID("$NetBSD: compat.c,v 1.103 2016/01/17 17:45:21 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -143,8 +143,8 @@ CompatInterrupt(int signo)
 	if (!noExecute && eunlink(file) != -1) {
 	Error("*** %s removed", file);
 	}
-	if (p1)
-	free(p1);
+
+	free(p1);
 
 	/*
 	 * Run .INTERRUPT only if hit with interrupt signal
@@ -371,10 +371,10 @@ again:
 	execError("exec", av[0]);
 	_exit(1);
 }
-if (mav)
-	free(mav);
-if (bp)
-	free(bp);
+
+free(mav);
+free(bp);
+
 Lst_Replace(cmdNode, NULL);
 
 #ifdef USE_META
@@ -513,8 +513,7 @@ Compat_Make(void *gnp, void *pgnp)
 	if (Lst_Member(gn->iParents, pgn) != NULL) {
 	   

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

2016-01-17 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 17 17:49:55 UTC 2016

Modified Files:
src/sys/arch/hp300/hp300: intr.c

Log Message:
Fix fatal "intr_dispatch: stray level 6 interrupt" panic by the GENERIC
kernel on machines without arcofi(4) audio (i.e. all hp300 except HP425e).

I failed to pull all necessary changes for arcofi(4) from OpenBSD
and I should have tested 7.0_RC kernels on my HP382 too :-(

Should be pulled up to netbsd-7 and netbsd-7-0.


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

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

Modified files:

Index: src/sys/arch/hp300/hp300/intr.c
diff -u src/sys/arch/hp300/hp300/intr.c:1.41 src/sys/arch/hp300/hp300/intr.c:1.42
--- src/sys/arch/hp300/hp300/intr.c:1.41	Sun Aug 24 08:17:44 2014
+++ src/sys/arch/hp300/hp300/intr.c	Sun Jan 17 17:49:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.41 2014/08/24 08:17:44 tsutsui Exp $	*/
+/*	$NetBSD: intr.c,v 1.42 2016/01/17 17:49:55 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.41 2014/08/24 08:17:44 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.42 2016/01/17 17:49:55 tsutsui Exp $");
 
 #define _HP300_INTR_H_PRIVATE
 
@@ -199,9 +199,12 @@ intr_dispatch(int evec /* format | vecto
 
 	list = _intr_list[ipl];
 	if (LIST_FIRST(>hi_q) == NULL) {
-		printf("intr_dispatch: ipl %d unexpected\n", ipl);
-		if (++unexpected > 10)
-			panic("intr_dispatch: too many unexpected interrupts");
+		if (ipl != 6) {
+			printf("intr_dispatch: ipl %d unexpected\n", ipl);
+			if (++unexpected > 10)
+panic("intr_dispatch:"
+" too many unexpected interrupts");
+		}
 		return;
 	}