CVS commit: src

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 20:55:46 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile varmod-order-numeric.exp
varmod-order-numeric.mk varmod-order.exp varmod-order.mk
Added Files:
src/usr.bin/make/unit-tests: varmod-order-string.exp
varmod-order-string.mk

Log Message:
tests/make: split tests for the variable modifier ':O'

The tests for parse errors are now in varmod-order, which lets the other
tests focus on the desired behavior of the modifiers.


To generate a diff of this commit:
cvs rdiff -u -r1.1097 -r1.1098 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.281 -r1.282 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-order-numeric.exp \
src/usr.bin/make/unit-tests/varmod-order-numeric.mk \
src/usr.bin/make/unit-tests/varmod-order.exp
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/varmod-order-string.exp \
src/usr.bin/make/unit-tests/varmod-order-string.mk
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varmod-order.mk

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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1097 src/distrib/sets/lists/tests/mi:1.1098
--- src/distrib/sets/lists/tests/mi:1.1097	Fri Jul 30 21:29:00 2021
+++ src/distrib/sets/lists/tests/mi	Sat Jul 31 20:55:45 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1097 2021/07/30 21:29:00 rillig Exp $
+# $NetBSD: mi,v 1.1098 2021/07/31 20:55:45 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5815,6 +5815,8 @@
 ./usr/tests/usr.bin/make/unit-tests/varmod-order-reverse.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/varmod-order-shuffle.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/varmod-order-shuffle.mk			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/varmod-order-string.exp			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/varmod-order-string.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/varmod-order.exptests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/varmod-order.mktests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/varmod-path.exptests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.281 src/usr.bin/make/unit-tests/Makefile:1.282
--- src/usr.bin/make/unit-tests/Makefile:1.281	Fri Jul 30 19:55:22 2021
+++ src/usr.bin/make/unit-tests/Makefile	Sat Jul 31 20:55:46 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.281 2021/07/30 19:55:22 sjg Exp $
+# $NetBSD: Makefile,v 1.282 2021/07/31 20:55:46 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -358,6 +358,7 @@ TESTS+=		varmod-order
 TESTS+=		varmod-order-numeric
 TESTS+=		varmod-order-reverse
 TESTS+=		varmod-order-shuffle
+TESTS+=		varmod-order-string
 TESTS+=		varmod-path
 TESTS+=		varmod-quote
 TESTS+=		varmod-quote-dollar

Index: src/usr.bin/make/unit-tests/varmod-order-numeric.exp
diff -u src/usr.bin/make/unit-tests/varmod-order-numeric.exp:1.3 src/usr.bin/make/unit-tests/varmod-order-numeric.exp:1.4
--- src/usr.bin/make/unit-tests/varmod-order-numeric.exp:1.3	Fri Jul 30 23:28:04 2021
+++ src/usr.bin/make/unit-tests/varmod-order-numeric.exp	Sat Jul 31 20:55:46 2021
@@ -1,20 +1 @@
-make: Bad modifier ":Oxn" for variable "NUMBERS"
-make: "varmod-order-numeric.mk" line 32: Malformed conditional (${NUMBERS:Oxn})
-make: Bad modifier ":On_typo" for variable "NUMBERS"
-make: "varmod-order-numeric.mk" line 42: Malformed conditional (${NUMBERS:On_typo})
-make: Bad modifier ":Onr_typo" for variable "NUMBERS"
-make: "varmod-order-numeric.mk" line 51: Malformed conditional (${NUMBERS:Onr_typo})
-make: Bad modifier ":Orn_typo" for variable "NUMBERS"
-make: "varmod-order-numeric.mk" line 60: Malformed conditional (${NUMBERS:Orn_typo})
-make: Bad modifier ":Onn" for variable "NUMBERS"
-make: "varmod-order-numeric.mk" line 71: Malformed conditional (${NUMBERS:Onn})
-make: Bad modifier ":Onrr" for variable "NUMBERS"
-make: "varmod-order-numeric.mk" line 80: Malformed conditional (${NUMBERS:Onrr})
-make: Bad modifier ":Orrn" for variable "NUMBERS"
-make: "varmod-order-numeric.mk" line 89: Malformed conditional (${NUMBERS:Orrn})
-make: Unclosed variable expression, expecting '}' for modifier "O" of variable "NUMBERS" with value "-2G -3m -42 1 1M 1k 3 42 5 5K 7"
-make: Unclosed variable expression, expecting '}' for modifier "On" of variable "NUMBERS" with value "-2G -3m -42 1 3 5 7 42 1k 5K 1M"
-make: Unclosed variable expression, expecting '}' for modifier "Onr" of variable "NUMBERS" with value "1M 5K 1k 42 7 5 3 1 -42 -3m -2G"
-make: Fatal errors 

CVS commit: src

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 20:55:46 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile varmod-order-numeric.exp
varmod-order-numeric.mk varmod-order.exp varmod-order.mk
Added Files:
src/usr.bin/make/unit-tests: varmod-order-string.exp
varmod-order-string.mk

Log Message:
tests/make: split tests for the variable modifier ':O'

The tests for parse errors are now in varmod-order, which lets the other
tests focus on the desired behavior of the modifiers.


To generate a diff of this commit:
cvs rdiff -u -r1.1097 -r1.1098 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.281 -r1.282 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-order-numeric.exp \
src/usr.bin/make/unit-tests/varmod-order-numeric.mk \
src/usr.bin/make/unit-tests/varmod-order.exp
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/varmod-order-string.exp \
src/usr.bin/make/unit-tests/varmod-order-string.mk
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varmod-order.mk

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



CVS commit: src

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 20:51:32 UTC 2021

Modified Files:
src/lib/libc/sys: _lwp_create.2
src/lib/libedit: tty.h
src/sys/arch/atari/pci: pci_vga.c
src/sys/arch/hpcmips/include: sysconf.h
src/sys/dev/hpc: hpcfbio.h
src/sys/dev/isa: tcic2_isa.c

Log Message:
s/dependend/dependent/


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/sys/_lwp_create.2
cvs rdiff -u -r1.23 -r1.24 src/lib/libedit/tty.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/atari/pci/pci_vga.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hpcmips/include/sysconf.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hpc/hpcfbio.h
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/isa/tcic2_isa.c

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



CVS commit: src

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 20:51:32 UTC 2021

Modified Files:
src/lib/libc/sys: _lwp_create.2
src/lib/libedit: tty.h
src/sys/arch/atari/pci: pci_vga.c
src/sys/arch/hpcmips/include: sysconf.h
src/sys/dev/hpc: hpcfbio.h
src/sys/dev/isa: tcic2_isa.c

Log Message:
s/dependend/dependent/


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/sys/_lwp_create.2
cvs rdiff -u -r1.23 -r1.24 src/lib/libedit/tty.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/atari/pci/pci_vga.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hpcmips/include/sysconf.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hpc/hpcfbio.h
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/isa/tcic2_isa.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/sys/_lwp_create.2
diff -u src/lib/libc/sys/_lwp_create.2:1.7 src/lib/libc/sys/_lwp_create.2:1.8
--- src/lib/libc/sys/_lwp_create.2:1.7	Sun Apr 23 11:38:53 2017
+++ src/lib/libc/sys/_lwp_create.2	Sat Jul 31 20:51:32 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: _lwp_create.2,v 1.7 2017/04/23 11:38:53 wiz Exp $
+.\"	$NetBSD: _lwp_create.2,v 1.8 2021/07/31 20:51:32 andvar Exp $
 .\"
 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -50,7 +50,7 @@ signal mask, stack, and machine register
 The signal stack of the newly created light-weight process is reset to
 disabled.
 If this context specifies invalid register values (for example priviledge
-escalation by setting machine dependend bits forbidden for user processes),
+escalation by setting machine dependent bits forbidden for user processes),
 or does not specify cpu register values (uc_flags does not have the
 _UC_CPU bit set), the call will fail and errno will be set to EINVAL.
 .Pp

Index: src/lib/libedit/tty.h
diff -u src/lib/libedit/tty.h:1.23 src/lib/libedit/tty.h:1.24
--- src/lib/libedit/tty.h:1.23	Sun Dec  2 16:58:13 2018
+++ src/lib/libedit/tty.h	Sat Jul 31 20:51:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty.h,v 1.23 2018/12/02 16:58:13 christos Exp $	*/
+/*	$NetBSD: tty.h,v 1.24 2021/07/31 20:51:32 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -432,7 +432,7 @@
 #define	C_SH(A)		((unsigned int)(1 << (A)))
 
 /*
- * Terminal dependend data structures
+ * Terminal dependent data structures
  */
 #define	EX_IO	0	/* while we are executing	*/
 #define	ED_IO	1	/* while we are editing		*/

Index: src/sys/arch/atari/pci/pci_vga.c
diff -u src/sys/arch/atari/pci/pci_vga.c:1.17 src/sys/arch/atari/pci/pci_vga.c:1.18
--- src/sys/arch/atari/pci/pci_vga.c:1.17	Sat May  4 09:03:08 2019
+++ src/sys/arch/atari/pci/pci_vga.c	Sat Jul 31 20:51:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_vga.c,v 1.17 2019/05/04 09:03:08 tsutsui Exp $	*/
+/*	$NetBSD: pci_vga.c,v 1.18 2021/07/31 20:51:32 andvar Exp $	*/
 
 /*
  * Copyright (c) 1999 Leo Weppelman.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_vga.c,v 1.17 2019/05/04 09:03:08 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_vga.c,v 1.18 2021/07/31 20:51:32 andvar Exp $");
 
 #include 
 #include 
@@ -139,7 +139,7 @@ check_for_vga(bus_space_tag_t iot, bus_s
 		switch (id = PCI_PRODUCT(id)) {
 
 			/*
-			 * XXX Make the inclusion of the cases dependend
+			 * XXX Make the inclusion of the cases dependent
 			 * on config options!
 			 */
 			case PCI_PRODUCT_TSENG_ET6000:

Index: src/sys/arch/hpcmips/include/sysconf.h
diff -u src/sys/arch/hpcmips/include/sysconf.h:1.17 src/sys/arch/hpcmips/include/sysconf.h:1.18
--- src/sys/arch/hpcmips/include/sysconf.h:1.17	Wed Mar 16 14:43:36 2011
+++ src/sys/arch/hpcmips/include/sysconf.h	Sat Jul 31 20:51:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysconf.h,v 1.17 2011/03/16 14:43:36 tsutsui Exp $	*/
+/*	$NetBSD: sysconf.h,v 1.18 2021/07/31 20:51:32 andvar Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -55,7 +55,7 @@ struct clock_ymdhms;
 extern struct platform {
 	/*
 	 *	cpu_intr	-	interrupt handler
-	 *	cpu_idle	-	CPU dependend idle routine.
+	 *	cpu_idle	-	CPU dependent idle routine.
 	 *	cons_init 	-	console initialization
 	 *	fb_init -   frame buffer initialization
 	 *  mem_init-   Count available memory

Index: src/sys/dev/hpc/hpcfbio.h
diff -u src/sys/dev/hpc/hpcfbio.h:1.2 src/sys/dev/hpc/hpcfbio.h:1.3
--- src/sys/dev/hpc/hpcfbio.h:1.2	Sun Jul 22 09:56:41 2001
+++ src/sys/dev/hpc/hpcfbio.h	Sat Jul 31 20:51:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpcfbio.h,v 1.2 2001/07/22 09:56:41 takemura Exp $	*/
+/*	$NetBSD: hpcfbio.h,v 1.3 2021/07/31 20:51:32 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1999
@@ -135,7 +135,7 @@ struct hpcfb_fbconf {
 	u_long	hf_reserved[3];
 
 	/*
-	 * class dependend data
+	 * class dependent data
 	 */
 	short	hf_class_data_length;
 	union {

Index: src/sys/dev/isa/tcic2_isa.c
diff -u src/sys/dev/isa/tcic2_isa.c:1.28 src/sys/dev/isa/tcic2_isa.c:1.29

CVS commit: src/sys

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 20:29:37 UTC 2021

Modified Files:
src/sys/arch/hp300/dev: rd.c
src/sys/arch/m68k/fpsp: round.sa
src/sys/arch/mips/sibyte/include: sb1250_mac.h
src/sys/dev/gpib: rd.c
src/sys/dev/ic: cs89x0.c siisatareg.h
src/sys/dev/usb: umcs.h
src/sys/netinet: tcp_congctl.c tcp_input.c tcp_subr.c tcp_var.h
src/sys/ufs/lfs: lfs_vfsops.c

Log Message:
s/threshhold/threshold


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/hp300/dev/rd.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/m68k/fpsp/round.sa
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/sibyte/include/sb1250_mac.h
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/gpib/rd.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/ic/cs89x0.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/ic/siisatareg.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/usb/umcs.h
cvs rdiff -u -r1.27 -r1.28 src/sys/netinet/tcp_congctl.c
cvs rdiff -u -r1.428 -r1.429 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.288 -r1.289 src/sys/netinet/tcp_subr.c
cvs rdiff -u -r1.195 -r1.196 src/sys/netinet/tcp_var.h
cvs rdiff -u -r1.380 -r1.381 src/sys/ufs/lfs/lfs_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/arch/hp300/dev/rd.c
diff -u src/sys/arch/hp300/dev/rd.c:1.109 src/sys/arch/hp300/dev/rd.c:1.110
--- src/sys/arch/hp300/dev/rd.c:1.109	Sun Jul 11 13:00:52 2021
+++ src/sys/arch/hp300/dev/rd.c	Sat Jul 31 20:29:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.109 2021/07/11 13:00:52 tsutsui Exp $	*/
+/*	$NetBSD: rd.c,v 1.110 2021/07/31 20:29:36 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.109 2021/07/11 13:00:52 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.110 2021/07/31 20:29:36 andvar Exp $");
 
 #include "opt_useleds.h"
 
@@ -1238,7 +1238,7 @@ rderror(int unit)
 	}
 	/*
 	 * Only report error if we have reached the error reporting
-	 * threshhold.  By default, this will only report after the
+	 * threshold.  By default, this will only report after the
 	 * retry limit has been exceeded.
 	 */
 	if (sc->sc_errcnt < rderrthresh)

Index: src/sys/arch/m68k/fpsp/round.sa
diff -u src/sys/arch/m68k/fpsp/round.sa:1.3 src/sys/arch/m68k/fpsp/round.sa:1.4
--- src/sys/arch/m68k/fpsp/round.sa:1.3	Wed Oct 26 07:49:24 1994
+++ src/sys/arch/m68k/fpsp/round.sa	Sat Jul 31 20:29:37 2021
@@ -1,4 +1,4 @@
-*	$NetBSD: round.sa,v 1.3 1994/10/26 07:49:24 cgd Exp $
+*	$NetBSD: round.sa,v 1.4 2021/07/31 20:29:37 andvar Exp $
 
 *	MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
 *	M68000 Hi-Performance Microprocessor Division
@@ -507,7 +507,7 @@ no_inex:
 	rts
 
 *
-*	dnrm_lp --- normalize exponent/mantissa to specified threshhold
+*	dnrm_lp --- normalize exponent/mantissa to specified threshold
 *
 * Input:
 *	a0		points to the operand to be denormalized

Index: src/sys/arch/mips/sibyte/include/sb1250_mac.h
diff -u src/sys/arch/mips/sibyte/include/sb1250_mac.h:1.7 src/sys/arch/mips/sibyte/include/sb1250_mac.h:1.8
--- src/sys/arch/mips/sibyte/include/sb1250_mac.h:1.7	Tue May 28 08:59:34 2019
+++ src/sys/arch/mips/sibyte/include/sb1250_mac.h	Sat Jul 31 20:29:37 2021
@@ -228,7 +228,7 @@
 #define G_MAC_TXD_WEIGHT1(x)_SB_GETVALUE(x,S_MAC_TXD_WEIGHT1,M_MAC_TXD_WEIGHT1)
 
 /*
- * MAC Fifo Threshhold registers (Table 9-14)
+ * MAC Fifo Threshold registers (Table 9-14)
  * Register: MAC_THRSH_CFG_0
  * Register: MAC_THRSH_CFG_1
  * Register: MAC_THRSH_CFG_2

Index: src/sys/dev/gpib/rd.c
diff -u src/sys/dev/gpib/rd.c:1.43 src/sys/dev/gpib/rd.c:1.44
--- src/sys/dev/gpib/rd.c:1.43	Tue Sep 29 02:49:56 2020
+++ src/sys/dev/gpib/rd.c	Sat Jul 31 20:29:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.43 2020/09/29 02:49:56 msaitoh Exp $ */
+/*	$NetBSD: rd.c,v 1.44 2021/07/31 20:29:37 andvar Exp $ */
 
 /*-
  * Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.43 2020/09/29 02:49:56 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.44 2021/07/31 20:29:37 andvar Exp $");
 
 #include 
 #include 
@@ -871,7 +871,7 @@ rderror(struct rd_softc *sc)
 	}
 	/*
 	 * Only report error if we have reached the error reporting
-	 * threshhold.  By default, this will only report after the
+	 * threshold.  By default, this will only report after the
 	 * retry limit has been exceeded.
 	 */
 	if (sc->sc_errcnt < rderrthresh)

Index: src/sys/dev/ic/cs89x0.c
diff -u src/sys/dev/ic/cs89x0.c:1.50 src/sys/dev/ic/cs89x0.c:1.51
--- src/sys/dev/ic/cs89x0.c:1.50	Sat Jul 24 21:31:37 2021
+++ src/sys/dev/ic/cs89x0.c	Sat Jul 31 20:29:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cs89x0.c,v 1.50 2021/07/24 21:31:37 andvar Exp $	*/
+/*	$NetBSD: cs89x0.c,v 1.51 2021/07/31 20:29:37 andvar Exp $	*/
 
 /*
  * Copyright (c) 2004 Christopher Gilbert
@@ -212,7 +212,7 @@
 */
 

CVS commit: src/sys

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 20:29:37 UTC 2021

Modified Files:
src/sys/arch/hp300/dev: rd.c
src/sys/arch/m68k/fpsp: round.sa
src/sys/arch/mips/sibyte/include: sb1250_mac.h
src/sys/dev/gpib: rd.c
src/sys/dev/ic: cs89x0.c siisatareg.h
src/sys/dev/usb: umcs.h
src/sys/netinet: tcp_congctl.c tcp_input.c tcp_subr.c tcp_var.h
src/sys/ufs/lfs: lfs_vfsops.c

Log Message:
s/threshhold/threshold


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/hp300/dev/rd.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/m68k/fpsp/round.sa
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/sibyte/include/sb1250_mac.h
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/gpib/rd.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/ic/cs89x0.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/ic/siisatareg.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/usb/umcs.h
cvs rdiff -u -r1.27 -r1.28 src/sys/netinet/tcp_congctl.c
cvs rdiff -u -r1.428 -r1.429 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.288 -r1.289 src/sys/netinet/tcp_subr.c
cvs rdiff -u -r1.195 -r1.196 src/sys/netinet/tcp_var.h
cvs rdiff -u -r1.380 -r1.381 src/sys/ufs/lfs/lfs_vfsops.c

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



CVS commit: src

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 19:52:44 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: op_shl_lp64.c op_shl_lp64.exp
src/usr.bin/xlint/lint1: decl.c emit1.c lint1.h
src/usr.bin/xlint/lint2: read.c

Log Message:
lint: improve support for __int128_t and __uint128_t

For the .ln files, I chose the letter 'J' to represent the 128-bit
integer types since it is close to 'I' for int.  The naming of 'L' for
'long' is obvious, but 'Q' for 64-bit integers is a quad-16-bit word,
which is an unusual measurement unit nowadays.  One benefit of choosing
'J' is that the next letter, 'K' can then be used for 256-bit integer
types.

Support for 128-bit integer types is still very basic.  Plus, it is only
supported on LP64 platforms, which means that lint cannot be
cross-compiled to check for an LP64 platform while running on an ILP32
platform.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/op_shl_lp64.c \
src/tests/usr.bin/xlint/lint1/op_shl_lp64.exp
cvs rdiff -u -r1.214 -r1.215 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.119 -r1.120 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/xlint/lint2/read.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/usr.bin/xlint/lint1/op_shl_lp64.c
diff -u src/tests/usr.bin/xlint/lint1/op_shl_lp64.c:1.1 src/tests/usr.bin/xlint/lint1/op_shl_lp64.c:1.2
--- src/tests/usr.bin/xlint/lint1/op_shl_lp64.c:1.1	Sun Jul  4 20:22:31 2021
+++ src/tests/usr.bin/xlint/lint1/op_shl_lp64.c	Sat Jul 31 19:52:44 2021
@@ -1,18 +1,25 @@
-/*	$NetBSD: op_shl_lp64.c,v 1.1 2021/07/04 20:22:31 rillig Exp $	*/
+/*	$NetBSD: op_shl_lp64.c,v 1.2 2021/07/31 19:52:44 rillig Exp $	*/
 # 3 "op_shl_lp64.c"
 
 /*
- * Test overflow on shl of 128-bit integers, as seen in
- * ecp_nistp256.c(296).
+ * Before decl.c 1.215 from 2021-07-31, lint wrongly treated __uint128_t and
+ * __int128_t as being equivalent to a missing type specifier, thereby
+ * defaulting to int.  This led to warnings like:
+ *
+ *	shift amount 105 is greater than bit-size 32 of 'int' [122]
+ *
+ * These warnings had been discovered in ecp_nistp256.c(296).
  */
 
 /* lint1-only-if lp64 */
 
 const __uint128_t zero105 =
-/* FIXME: 105 is ok for __uint128_t */
-/* expect+1: warning: shift amount 105 is greater than bit-size 32 of 'int' [122] */
 (((__uint128_t)1) << 105)
-/* FIXME: 41 is ok for __uint128_t */
-/* expect+1: warning: shift amount 41 is greater than bit-size 32 of 'int' [122] */
 - (((__uint128_t)1) << 41)
 - (((__uint128_t)1) << 9);
+
+const __uint128_t shl_128_129 =
+/* expect+1: warning: shift equal to size of object [267] */
+(((__uint128_t)1) << 128)
+/* expect+1: warning: shift amount 129 is greater than bit-size 128 of '__uint128_t' [122] */
+- (((__uint128_t)1) << 129);
Index: src/tests/usr.bin/xlint/lint1/op_shl_lp64.exp
diff -u src/tests/usr.bin/xlint/lint1/op_shl_lp64.exp:1.1 src/tests/usr.bin/xlint/lint1/op_shl_lp64.exp:1.2
--- src/tests/usr.bin/xlint/lint1/op_shl_lp64.exp:1.1	Sun Jul  4 20:22:31 2021
+++ src/tests/usr.bin/xlint/lint1/op_shl_lp64.exp	Sat Jul 31 19:52:44 2021
@@ -1,2 +1,2 @@
-op_shl_lp64.c(14): warning: shift amount 105 is greater than bit-size 32 of 'int' [122]
-op_shl_lp64.c(17): warning: shift amount 41 is greater than bit-size 32 of 'int' [122]
+op_shl_lp64.c(23): warning: shift equal to size of object [267]
+op_shl_lp64.c(25): warning: shift amount 129 is greater than bit-size 128 of '__uint128_t' [122]

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.214 src/usr.bin/xlint/lint1/decl.c:1.215
--- src/usr.bin/xlint/lint1/decl.c:1.214	Sat Jul 31 19:20:59 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sat Jul 31 19:52:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.214 2021/07/31 19:20:59 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.215 2021/07/31 19:52:44 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.214 2021/07/31 19:20:59 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.215 2021/07/31 19:52:44 rillig Exp $");
 #endif
 
 #include 
@@ -126,8 +126,8 @@ initdecl(void)
 	typetab[QUAD].t_tspec = QUAD;
 	typetab[UQUAD].t_tspec = UQUAD;
 #ifdef INT128_SIZE
-	/* TODO: add __int128_t */
-	/* TODO: add __uint128_t */
+	typetab[INT128].t_tspec = INT128;
+	typetab[UINT128].t_tspec = UINT128;
 #endif
 	typetab[FLOAT].t_tspec = FLOAT;
 	typetab[DOUBLE].t_tspec = DOUBLE;

Index: src/usr.bin/xlint/lint1/emit1.c
diff -u src/usr.bin/xlint/lint1/emit1.c:1.46 src/usr.bin/xlint/lint1/emit1.c:1.47
--- src/usr.bin/xlint/lint1/emit1.c:1.46	Thu Jul 15 17:03:50 2021
+++ src/usr.bin/xlint/lint1/emit1.c	Sat Jul 31 19:52:44 2021
@@ -1,4 +1,4 

CVS commit: src

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 19:52:44 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: op_shl_lp64.c op_shl_lp64.exp
src/usr.bin/xlint/lint1: decl.c emit1.c lint1.h
src/usr.bin/xlint/lint2: read.c

Log Message:
lint: improve support for __int128_t and __uint128_t

For the .ln files, I chose the letter 'J' to represent the 128-bit
integer types since it is close to 'I' for int.  The naming of 'L' for
'long' is obvious, but 'Q' for 64-bit integers is a quad-16-bit word,
which is an unusual measurement unit nowadays.  One benefit of choosing
'J' is that the next letter, 'K' can then be used for 256-bit integer
types.

Support for 128-bit integer types is still very basic.  Plus, it is only
supported on LP64 platforms, which means that lint cannot be
cross-compiled to check for an LP64 platform while running on an ILP32
platform.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/op_shl_lp64.c \
src/tests/usr.bin/xlint/lint1/op_shl_lp64.exp
cvs rdiff -u -r1.214 -r1.215 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.119 -r1.120 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/xlint/lint2/read.c

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



CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 19:20:59 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: decl.c

Log Message:
lint: initialize shared types in the same order as in tspec_t

This makes it easier to see whether there are any types missing, such as
__uint128_t.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/usr.bin/xlint/lint1/decl.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/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.213 src/usr.bin/xlint/lint1/decl.c:1.214
--- src/usr.bin/xlint/lint1/decl.c:1.213	Sat Jul 31 19:07:52 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sat Jul 31 19:20:59 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.213 2021/07/31 19:07:52 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.214 2021/07/31 19:20:59 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.213 2021/07/31 19:07:52 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.214 2021/07/31 19:20:59 rillig Exp $");
 #endif
 
 #include 
@@ -105,6 +105,14 @@ initdecl(void)
 	typetab = xcalloc(NTSPEC, sizeof(*typetab));
 	for (i = 0; i < NTSPEC; i++)
 		typetab[i].t_tspec = NOTSPEC;
+
+	/*
+	 * The following two are not real types. They are only used by the
+	 * parser to handle the keywords "signed" and "unsigned".
+	 */
+	typetab[SIGNED].t_tspec = SIGNED;
+	typetab[UNSIGN].t_tspec = UNSIGN;
+
 	typetab[BOOL].t_tspec = BOOL;
 	typetab[CHAR].t_tspec = CHAR;
 	typetab[SCHAR].t_tspec = SCHAR;
@@ -117,20 +125,19 @@ initdecl(void)
 	typetab[ULONG].t_tspec = ULONG;
 	typetab[QUAD].t_tspec = QUAD;
 	typetab[UQUAD].t_tspec = UQUAD;
+#ifdef INT128_SIZE
+	/* TODO: add __int128_t */
+	/* TODO: add __uint128_t */
+#endif
 	typetab[FLOAT].t_tspec = FLOAT;
 	typetab[DOUBLE].t_tspec = DOUBLE;
 	typetab[LDOUBLE].t_tspec = LDOUBLE;
+	typetab[VOID].t_tspec = VOID;
+	/* struct, union, enum, ptr, array and func are not shared. */
+	typetab[COMPLEX].t_tspec = COMPLEX;
 	typetab[FCOMPLEX].t_tspec = FCOMPLEX;
 	typetab[DCOMPLEX].t_tspec = DCOMPLEX;
 	typetab[LCOMPLEX].t_tspec = LCOMPLEX;
-	typetab[COMPLEX].t_tspec = COMPLEX;
-	typetab[VOID].t_tspec = VOID;
-	/*
-	 * Next two are not real types. They are only used by the parser
-	 * to return keywords "signed" and "unsigned"
-	 */
-	typetab[SIGNED].t_tspec = SIGNED;
-	typetab[UNSIGN].t_tspec = UNSIGN;
 }
 
 /* Return the name of the "storage class" in the wider sense. */



CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 19:20:59 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: decl.c

Log Message:
lint: initialize shared types in the same order as in tspec_t

This makes it easier to see whether there are any types missing, such as
__uint128_t.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/usr.bin/xlint/lint1/decl.c

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



CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 19:12:35 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: externs1.h

Log Message:
lint: do not evaluate arguments of debug_step

To analyze the unexpected test failure of op_shl_lp64, I had reverted
debug_step to evaluate its arguments.  I then accidentally committed
that without running the tests again.

Anyway, the previous commit can now be used as a demonstration that
initdecl is indeed missing the initialization for __uint128_t, which
leads to the internal error in op_shl_lp64.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/xlint/lint1/externs1.h

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/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.125 src/usr.bin/xlint/lint1/externs1.h:1.126
--- src/usr.bin/xlint/lint1/externs1.h:1.125	Sat Jul 31 19:07:52 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Jul 31 19:12:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.125 2021/07/31 19:07:52 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.126 2021/07/31 19:12:35 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -131,8 +131,7 @@ void	debug_leave(const char *);
 #define	debug_node(tn, indent)	debug_noop()
 #define	debug_printf(...)	debug_noop()
 #define	debug_indent()		debug_noop()
-static inline void __printflike(1, 2) debug_step(const char *fmt, ...) {}
-/*#define	debug_step(...)		debug_noop()*/
+#define	debug_step(...)		debug_noop()
 #define	debug_indent()		debug_noop()
 #define	debug_indent_inc()	debug_noop()
 #define	debug_indent_dec()	debug_noop()



CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 19:12:35 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: externs1.h

Log Message:
lint: do not evaluate arguments of debug_step

To analyze the unexpected test failure of op_shl_lp64, I had reverted
debug_step to evaluate its arguments.  I then accidentally committed
that without running the tests again.

Anyway, the previous commit can now be used as a demonstration that
initdecl is indeed missing the initialization for __uint128_t, which
leads to the internal error in op_shl_lp64.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/xlint/lint1/externs1.h

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



CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 19:07:52 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: decl.c err.c externs1.h func.c init.c lex.c
main1.c

Log Message:
lint: clean up debug logging

The calls to debug_step, unlike printf, don't need a trailing newline.

Remove the debug_step0 macro and its relatives since lint already uses
enough other features from C99 that it essentially requires this
standard, which supports varargs macro arguments.  Among these features
are __func__ and printf("%zu").

In non-debug mode, do not evaluate the arguments of debug_step.
Evaluating the arguments had caused an internal error when running the
test op_shl_lp64.  This is indeed a bug since initdecl should have
initialized the type table for __uint128_t.  This had been forgotten
when support for __uint128_t was added in decl.c 1.69 from 2018-09-07.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.131 -r1.132 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.124 -r1.125 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.116 -r1.117 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.205 -r1.206 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/xlint/lint1/main1.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/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.212 src/usr.bin/xlint/lint1/decl.c:1.213
--- src/usr.bin/xlint/lint1/decl.c:1.212	Sat Jul 31 17:09:21 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sat Jul 31 19:07:52 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.212 2021/07/31 17:09:21 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.213 2021/07/31 19:07:52 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.212 2021/07/31 17:09:21 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.213 2021/07/31 19:07:52 rillig Exp $");
 #endif
 
 #include 
@@ -289,9 +289,8 @@ void
 add_type(type_t *tp)
 {
 	tspec_t	t;
-#ifdef DEBUG
-	printf("%s: %s\n", __func__, type_name(tp));
-#endif
+
+	debug_step("%s: %s", __func__, type_name(tp));
 	if (tp->t_typedef) {
 		/*
 		 * something like "typedef int a; int a b;"
@@ -801,9 +800,7 @@ dcs_merge_declaration_specifiers(void)
 	l = dcs->d_rank_mod;	/* SHORT, LONG or QUAD */
 	tp = dcs->d_type;
 
-#ifdef DEBUG
-	printf("%s: %s\n", __func__, type_name(tp));
-#endif
+	debug_step("%s: %s", __func__, type_name(tp));
 	if (t == NOTSPEC && s == NOTSPEC && l == NOTSPEC && c == NOTSPEC &&
 	tp == NULL)
 		dcs->d_notyp = true;
@@ -3011,17 +3008,13 @@ check_usage(dinfo_t *di)
 	mklwarn = lwarn;
 	lwarn = LWARN_ALL;
 
-#ifdef DEBUG
-	printf("%s, %d: >temp lwarn = %d\n", curr_pos.p_file, curr_pos.p_line,
-	lwarn);
-#endif
+	debug_step("%s, %d: >temp lwarn = %d",
+	curr_pos.p_file, curr_pos.p_line, lwarn);
 	for (sym = di->d_dlsyms; sym != NULL; sym = sym->s_dlnxt)
 		check_usage_sym(di->d_asm, sym);
 	lwarn = mklwarn;
-#ifdef DEBUG
-	printf("%s, %d: 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.131 2021/07/25 10:39:10 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.132 2021/07/31 19:07:52 rillig Exp $");
 #endif
 
 #include 
@@ -511,9 +511,7 @@ vwarning_at(int msgid, const pos_t *pos,
 	if (ERR_ISSET(msgid, ))
 		return;
 
-#ifdef DEBUG
-	printf("%s: lwarn=%d msgid=%d\n", __func__, lwarn, msgid);
-#endif
+	debug_step("%s: lwarn=%d msgid=%d", __func__, lwarn, msgid);
 	if (lwarn == LWARN_NONE || lwarn == msgid)
 		/* this warning is suppressed by a LINTED comment */
 		return;

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.124 src/usr.bin/xlint/lint1/externs1.h:1.125
--- src/usr.bin/xlint/lint1/externs1.h:1.124	Sat Jul 31 18:16:42 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Jul 31 19:07:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.124 2021/07/31 18:16:42 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.125 2021/07/31 19:07:52 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -123,27 +123,20 @@ void	debug_indent_inc(void);
 void	debug_indent_dec(void);
 void	debug_enter(const char *);
 void	debug_step(const char *fmt, ...) __printflike(1, 2);
-#define	debug_step0		debug_step
-#define	debug_step1		debug_step
-#define	debug_step2		debug_step
 void	debug_leave(const char *);
 #define	debug_enter()		(debug_enter)(__func__)
 #define	debug_leave()		(debug_leave)(__func__)
 #else
 #define	debug_noop()		do { } while (false)
-#define	debug_node(tn, indent) debug_noop()
-/* ARGSUSED */
-static inline void __printflike(1, 2) debug_printf(const char *fmt, ...) {}
-#define debug_indent()		debug_noop()
-/* ARGSUSED */
+#define	debug_node(tn, indent)	debug_noop()
+#define	

CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 19:07:52 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: decl.c err.c externs1.h func.c init.c lex.c
main1.c

Log Message:
lint: clean up debug logging

The calls to debug_step, unlike printf, don't need a trailing newline.

Remove the debug_step0 macro and its relatives since lint already uses
enough other features from C99 that it essentially requires this
standard, which supports varargs macro arguments.  Among these features
are __func__ and printf("%zu").

In non-debug mode, do not evaluate the arguments of debug_step.
Evaluating the arguments had caused an internal error when running the
test op_shl_lp64.  This is indeed a bug since initdecl should have
initialized the type table for __uint128_t.  This had been forgotten
when support for __uint128_t was added in decl.c 1.69 from 2018-09-07.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.131 -r1.132 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.124 -r1.125 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.116 -r1.117 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.205 -r1.206 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/xlint/lint1/main1.c

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



CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 18:16:42 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: Makefile externs1.h init.c tree.c
Added Files:
src/usr.bin/xlint/lint1: debug.c

Log Message:
lint: extract debug logging to separate file

Lint currently has several different kinds of debug log:

* The -DDEBUG log is controlled at compile time.
* The -d command line options enables some other debug logging.
* The -DYYDEBUG log for parsing is controlled at compile time.
* The -y command line option only has an effect in -DYYDEBUG mode.

Extracting the logging into a separate file is a first step towards
unifying these logs and making the code for debug logging stand out less
than the current #ifdef DEBUG.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.123 -r1.124 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.204 -r1.205 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.321 -r1.322 src/usr.bin/xlint/lint1/tree.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/xlint/lint1/Makefile
diff -u src/usr.bin/xlint/lint1/Makefile:1.81 src/usr.bin/xlint/lint1/Makefile:1.82
--- src/usr.bin/xlint/lint1/Makefile:1.81	Sat Jul 31 17:09:21 2021
+++ src/usr.bin/xlint/lint1/Makefile	Sat Jul 31 18:16:42 2021
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.81 2021/07/31 17:09:21 rillig Exp $
+#	$NetBSD: Makefile,v 1.82 2021/07/31 18:16:42 rillig Exp $
 
 .include 
 
 PROG=		lint1
 SRCS=		cgram.y \
-		ckbool.c ckctype.c ckgetopt.c \
+		ckbool.c ckctype.c ckgetopt.c debug.c \
 		decl.c emit.c emit1.c err.c func.c init.c inittyp.c lex.c \
 		main1.c mem.c mem1.c oper.c scan.l tree.c tyname.c
 

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.123 src/usr.bin/xlint/lint1/externs1.h:1.124
--- src/usr.bin/xlint/lint1/externs1.h:1.123	Sat Jul 31 17:09:21 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Jul 31 18:16:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.123 2021/07/31 17:09:21 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.124 2021/07/31 18:16:42 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -112,6 +112,42 @@ extern	struct	memory_block *expr_save_me
 extern	void	expr_restore_memory(struct memory_block *);
 
 /*
+ * debug.c
+ */
+
+#ifdef DEBUG
+void	debug_node(const tnode_t *, int);
+void	debug_printf(const char *fmt, ...) __printflike(1, 2);
+void	debug_indent(void);
+void	debug_indent_inc(void);
+void	debug_indent_dec(void);
+void	debug_enter(const char *);
+void	debug_step(const char *fmt, ...) __printflike(1, 2);
+#define	debug_step0		debug_step
+#define	debug_step1		debug_step
+#define	debug_step2		debug_step
+void	debug_leave(const char *);
+#define	debug_enter()		(debug_enter)(__func__)
+#define	debug_leave()		(debug_leave)(__func__)
+#else
+#define	debug_noop()		do { } while (false)
+#define	debug_node(tn, indent) debug_noop()
+/* ARGSUSED */
+static inline void __printflike(1, 2) debug_printf(const char *fmt, ...) {}
+#define debug_indent()		debug_noop()
+/* ARGSUSED */
+static inline void __printflike(1, 2) debug_step(const char *fmt, ...) {}
+#define	debug_indent()		debug_noop()
+#define	debug_indent_inc()	debug_noop()
+#define	debug_indent_dec()	debug_noop()
+#define	debug_enter()		debug_noop()
+#define	debug_step0(fmt)	debug_noop()
+#define	debug_step1(fmt, arg0)	debug_noop()
+#define	debug_step2(fmt, arg1, arg2) debug_noop()
+#define	debug_leave()		debug_noop()
+#endif
+
+/*
  * err.c
  */
 extern	int	nerr;
@@ -235,11 +271,6 @@ extern	void	check_expr_misc(const tnode_
 extern	bool	constant_addr(const tnode_t *, const sym_t **, ptrdiff_t *);
 extern	strg_t	*cat_strings(strg_t *, strg_t *);
 extern  int64_t type_size_in_bits(const type_t *);
-#ifdef DEBUG
-extern	void	debug_node(const tnode_t *, int);
-#else
-#define debug_node(tn, indent) do { } while (false)
-#endif
 
 /*
  * func.c

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.204 src/usr.bin/xlint/lint1/init.c:1.205
--- src/usr.bin/xlint/lint1/init.c:1.204	Sat Jul 31 11:03:04 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Jul 31 18:16:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.204 2021/07/31 11:03:04 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.205 2021/07/31 18:16:42 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.204 2021/07/31 11:03:04 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.205 2021/07/31 18:16:42 rillig Exp $");
 #endif
 
 #include 
@@ -172,74 +172,6 @@ struct initialization {
 };
 
 
-#ifdef DEBUG
-static int debug_indentation = 0;
-#endif
-
-
-#ifdef DEBUG
-
-static void __printflike(1, 2)
-debug_printf(const char *fmt, ...)
-{
-	va_list va;
-
-	va_start(va, 

CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 18:16:42 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: Makefile externs1.h init.c tree.c
Added Files:
src/usr.bin/xlint/lint1: debug.c

Log Message:
lint: extract debug logging to separate file

Lint currently has several different kinds of debug log:

* The -DDEBUG log is controlled at compile time.
* The -d command line options enables some other debug logging.
* The -DYYDEBUG log for parsing is controlled at compile time.
* The -y command line option only has an effect in -DYYDEBUG mode.

Extracting the logging into a separate file is a first step towards
unifying these logs and making the code for debug logging stand out less
than the current #ifdef DEBUG.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.123 -r1.124 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.204 -r1.205 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.321 -r1.322 src/usr.bin/xlint/lint1/tree.c

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



CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 17:09:21 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: Makefile cgram.y decl.c externs1.h

Log Message:
lint: add debugging output for the grammar tokens

No functional change outside debug mode.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.351 -r1.352 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.211 -r1.212 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.122 -r1.123 src/usr.bin/xlint/lint1/externs1.h

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



CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 17:09:21 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: Makefile cgram.y decl.c externs1.h

Log Message:
lint: add debugging output for the grammar tokens

No functional change outside debug mode.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.351 -r1.352 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.211 -r1.212 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.122 -r1.123 src/usr.bin/xlint/lint1/externs1.h

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/xlint/lint1/Makefile
diff -u src/usr.bin/xlint/lint1/Makefile:1.80 src/usr.bin/xlint/lint1/Makefile:1.81
--- src/usr.bin/xlint/lint1/Makefile:1.80	Sun Jul 25 22:14:36 2021
+++ src/usr.bin/xlint/lint1/Makefile	Sat Jul 31 17:09:21 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.80 2021/07/25 22:14:36 rillig Exp $
+#	$NetBSD: Makefile,v 1.81 2021/07/31 17:09:21 rillig Exp $
 
 .include 
 
@@ -22,7 +22,7 @@ LOBJS.${PROG}+=		${SRCS:M*.l:.l=.ln}
 
 CPPFLAGS+=	-DIS_LINT1
 CPPFLAGS+=	-I${.CURDIR}
-CPPFLAGS+=	${DEBUG:D-DDEBUG}
+CPPFLAGS+=	${DEBUG:D-DDEBUG -DYYDEBUG}
 
 COPTS.err.c+=	${${ACTIVE_CC} == "clang":? -Wno-format-nonliteral :}
 

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.351 src/usr.bin/xlint/lint1/cgram.y:1.352
--- src/usr.bin/xlint/lint1/cgram.y:1.351	Tue Jul 27 05:52:53 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Sat Jul 31 17:09:21 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.351 2021/07/27 05:52:53 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.352 2021/07/31 17:09:21 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.351 2021/07/27 05:52:53 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.352 2021/07/31 17:09:21 rillig Exp $");
 #endif
 
 #include 
@@ -122,6 +122,13 @@ anonymize(sym_t *s)
 		s->s_styp = NULL;
 }
 
+#if defined(YYDEBUG) && (defined(YYBYACC) || defined(YYBISON))
+#define YYSTYPE_TOSTRING cgram_to_string
+#endif
+#if defined(YYDEBUG) && defined(YYBISON)
+#define YYPRINT cgram_print
+#endif
+
 %}
 
 %expect 150
@@ -349,6 +356,12 @@ anonymize(sym_t *s)
 %type		do_while_expr
 %type			func_declarator
 
+%{
+#if defined(YYDEBUG) && defined(YYBISON)
+static void cgram_print(FILE *, int, YYSTYPE);
+#endif
+%}
+
 %%
 
 program:
@@ -2116,6 +2129,47 @@ yyerror(const char *msg)
 	return 0;
 }
 
+#if (defined(YYDEBUG) && YYDEBUG > 0 && defined(YYBYACC)) \
+|| (defined(YYDEBUG) && defined(YYBISON))
+static const char *
+cgram_to_string(int token, YYSTYPE val)
+{
+	static const char *tqual_name[] = {
+		"const", "volatile", "restrict", "_Thread_local"
+	};
+
+	switch (token) {
+	case T_INCDEC:
+	case T_MULTIPLICATIVE:
+	case T_ADDITIVE:
+	case T_SHIFT:
+	case T_RELATIONAL:
+	case T_EQUALITY:
+	case T_OPASSIGN:
+		return modtab[val.y_op].m_name;
+	case T_SCLASS:
+		return scl_name(val.y_scl);
+	case T_TYPE:
+	case T_STRUCT_OR_UNION:
+		return tspec_name(val.y_tspec);
+	case T_QUAL:
+		return tqual_name[val.y_tqual];
+	case T_NAME:
+		return val.y_name->sb_name;
+	default:
+		return "";
+	}
+}
+#endif
+
+#if defined(YYDEBUG) && defined(YYBISON)
+static void
+cgram_print(FILE *output, int token, YYSTYPE val)
+{
+	fprintf(output, "%s", cgram_to_string(token, val));
+}
+#endif
+
 static void
 cgram_declare(sym_t *decl, bool initflg, sbuf_t *renaming)
 {

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.211 src/usr.bin/xlint/lint1/decl.c:1.212
--- src/usr.bin/xlint/lint1/decl.c:1.211	Sat Jul 31 11:03:04 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sat Jul 31 17:09:21 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.211 2021/07/31 11:03:04 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.212 2021/07/31 17:09:21 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.211 2021/07/31 11:03:04 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.212 2021/07/31 17:09:21 rillig Exp $");
 #endif
 
 #include 
@@ -134,7 +134,7 @@ initdecl(void)
 }
 
 /* Return the name of the "storage class" in the wider sense. */
-static const char *
+const char *
 scl_name(scl_t scl)
 {
 	static const char *const names[] = {

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.122 src/usr.bin/xlint/lint1/externs1.h:1.123
--- src/usr.bin/xlint/lint1/externs1.h:1.122	Sat Jul 31 11:03:04 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Jul 31 17:09:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.122 2021/07/31 11:03:04 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.123 2021/07/31 17:09:21 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -198,6 +198,7 @@ extern	void	

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

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 16:54:37 UTC 2021

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

Log Message:
s/propective/prospective


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

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



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

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 16:54:37 UTC 2021

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

Log Message:
s/propective/prospective


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

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

Modified files:

Index: src/sys/arch/sparc/sparc/autoconf.c
diff -u src/sys/arch/sparc/sparc/autoconf.c:1.267 src/sys/arch/sparc/sparc/autoconf.c:1.268
--- src/sys/arch/sparc/sparc/autoconf.c:1.267	Sat Jul 31 10:07:22 2021
+++ src/sys/arch/sparc/sparc/autoconf.c	Sat Jul 31 16:54:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.267 2021/07/31 10:07:22 andvar Exp $ */
+/*	$NetBSD: autoconf.c,v 1.268 2021/07/31 16:54:37 andvar Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.267 2021/07/31 10:07:22 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.268 2021/07/31 16:54:37 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -2009,7 +2009,7 @@ bootinfo_relocate(void *newloc)
 		(size_t)cp < (size_t)bootinfo + BOOTINFO_SIZE);
 
 	/*
-	 * Check propective gains.
+	 * Check prospective gains.
 	 */
 	if ((int)bootinfo - (int)newloc < bi_size)
 		/* Don't bother */



CVS commit: src/libexec/lfs_cleanerd

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 15:02:54 UTC 2021

Modified Files:
src/libexec/lfs_cleanerd: lfs_cleanerd.8

Log Message:
s/threshhold/threshold


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/libexec/lfs_cleanerd/lfs_cleanerd.8

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

Modified files:

Index: src/libexec/lfs_cleanerd/lfs_cleanerd.8
diff -u src/libexec/lfs_cleanerd/lfs_cleanerd.8:1.20 src/libexec/lfs_cleanerd/lfs_cleanerd.8:1.21
--- src/libexec/lfs_cleanerd/lfs_cleanerd.8:1.20	Sat Aug 31 07:49:48 2019
+++ src/libexec/lfs_cleanerd/lfs_cleanerd.8	Sat Jul 31 15:02:54 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: lfs_cleanerd.8,v 1.20 2019/08/31 07:49:48 wiz Exp $
+.\"	$NetBSD: lfs_cleanerd.8,v 1.21 2021/07/31 15:02:54 andvar Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -40,7 +40,7 @@
 .Op Fl bcDdfmqs
 .Op Fl i Ar segment-number
 .Op Fl J Ar raw-device
-.Op Fl l Ar load-threshhold
+.Op Fl l Ar load-threshold
 .Op Fl n Ar number-of-segments
 .Op Fl r Ar report-frequency
 .Op Fl S Ar semaphore-address
@@ -102,9 +102,9 @@ trying to figure it out from the mount p
 This is mostly useful when the cleaner is compiled into
 .Xr rump_lfs 8
 and the ATF test framework.
-.It Fl l Ar load-threshhold
-Clean more aggressively when the system load is below the given threshhold.
-The default threshhold is 0.2.
+.It Fl l Ar load-threshold
+Clean more aggressively when the system load is below the given threshold.
+The default threshold is 0.2.
 .It Fl m
 Does nothing.
 This option is present for historical compatibility.



CVS commit: src/libexec/lfs_cleanerd

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 15:02:54 UTC 2021

Modified Files:
src/libexec/lfs_cleanerd: lfs_cleanerd.8

Log Message:
s/threshhold/threshold


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/libexec/lfs_cleanerd/lfs_cleanerd.8

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



Re: CVS commit: src/sys

2021-07-31 Thread Jason Thorpe


> On Jul 31, 2021, at 3:17 AM, Tobias Nygren  wrote:
> 
> It's not possible to deduce from the manual what DesignWare revision
> is used but I guess I can go over the data sheets of currently
> released SoCs and build a matrix of the proper values regardless
> of DesignWare revision.

Have the driver use a default value but provide an override in the device tree?

-- thorpej



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

2021-07-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jul 31 14:51:25 UTC 2021

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

Log Message:
Fix a silly mistake (missing return) in the DEBUG case of the kernel pmap
case of pmap_extract().


To generate a diff of this commit:
cvs rdiff -u -r1.299 -r1.300 src/sys/arch/alpha/alpha/pmap.c

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



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

2021-07-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jul 31 14:51:25 UTC 2021

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

Log Message:
Fix a silly mistake (missing return) in the DEBUG case of the kernel pmap
case of pmap_extract().


To generate a diff of this commit:
cvs rdiff -u -r1.299 -r1.300 src/sys/arch/alpha/alpha/pmap.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/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.299 src/sys/arch/alpha/alpha/pmap.c:1.300
--- src/sys/arch/alpha/alpha/pmap.c:1.299	Mon Jul 19 16:31:19 2021
+++ src/sys/arch/alpha/alpha/pmap.c	Sat Jul 31 14:51:25 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.299 2021/07/19 16:31:19 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.300 2021/07/31 14:51:25 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008, 2020
@@ -135,7 +135,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.299 2021/07/19 16:31:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.300 2021/07/31 14:51:25 thorpej Exp $");
 
 #include 
 #include 
@@ -2587,6 +2587,7 @@ pmap_extract(pmap_t pmap, vaddr_t va, pa
 printf("failed (kernel vtophys)\n");
 			}
 		}
+		return address_is_valid;
 #else
 		return vtophys_internal(va, pap);
 #endif



CVS commit: src/etc/rc.d

2021-07-31 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Jul 31 14:47:04 UTC 2021

Modified Files:
src/etc/rc.d: devpubd

Log Message:
Run devpubd before volume managers and pseudo disks.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/rc.d/devpubd

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



CVS commit: src/etc/rc.d

2021-07-31 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Jul 31 14:47:04 UTC 2021

Modified Files:
src/etc/rc.d: devpubd

Log Message:
Run devpubd before volume managers and pseudo disks.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/rc.d/devpubd

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

Modified files:

Index: src/etc/rc.d/devpubd
diff -u src/etc/rc.d/devpubd:1.1 src/etc/rc.d/devpubd:1.2
--- src/etc/rc.d/devpubd:1.1	Tue Sep  6 21:32:29 2011
+++ src/etc/rc.d/devpubd	Sat Jul 31 14:47:04 2021
@@ -1,11 +1,11 @@
 #!/bin/sh
 #
-# $NetBSD: devpubd,v 1.1 2011/09/06 21:32:29 riz Exp $
+# $NetBSD: devpubd,v 1.2 2021/07/31 14:47:04 mlelstv Exp $
 #
 
 # PROVIDE: devpubd
-# REQUIRE: DAEMON
-# BEFORE:  LOGIN
+# REQUIRE: root
+# BEFORE:  zfs ccd cgd lvm raidframe
 
 $_rc_subr_loaded . /etc/rc.subr
 



CVS commit: src

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 14:36:33 UTC 2021

Modified Files:
src/common/lib/libc/hash/sha3: sha3.c
src/sys/arch/arm/ixp12x0: ixp12x0_clk.c
src/sys/arch/dreamcast/dev: pvr.c
src/sys/dev/ic: mb86950.c mb86960.c mb86960var.h
src/sys/dev/usb: umcs.h

Log Message:
fix more typos in style found one in file - check/fix them all.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/hash/sha3/sha3.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/ixp12x0/ixp12x0_clk.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/dreamcast/dev/pvr.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/ic/mb86950.c
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/ic/mb86960.c
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/ic/mb86960var.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/usb/umcs.h

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

Modified files:

Index: src/common/lib/libc/hash/sha3/sha3.c
diff -u src/common/lib/libc/hash/sha3/sha3.c:1.2 src/common/lib/libc/hash/sha3/sha3.c:1.3
--- src/common/lib/libc/hash/sha3/sha3.c:1.2	Sat May 30 18:40:28 2020
+++ src/common/lib/libc/hash/sha3/sha3.c	Sat Jul 31 14:36:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sha3.c,v 1.2 2020/05/30 18:40:28 riastradh Exp $	*/
+/*	$NetBSD: sha3.c,v 1.3 2021/07/31 14:36:33 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2015 Taylor R. Campbell
@@ -27,7 +27,7 @@
  */
 
 /*
- * SHA-3: FIPS-202, Permutation-Based Hash and Extendable-Ouptut Functions
+ * SHA-3: FIPS-202, Permutation-Based Hash and Extendable-Output Functions
  */
 
 #if HAVE_NBTOOL_CONFIG_H
@@ -38,14 +38,14 @@
 
 #if defined(_KERNEL) || defined(_STANDALONE)
 
-__KERNEL_RCSID(0, "$NetBSD: sha3.c,v 1.2 2020/05/30 18:40:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sha3.c,v 1.3 2021/07/31 14:36:33 andvar Exp $");
 #include 
 
 #define	SHA3_ASSERT	KASSERT
 
 #else
 
-__RCSID("$NetBSD: sha3.c,v 1.2 2020/05/30 18:40:28 riastradh Exp $");
+__RCSID("$NetBSD: sha3.c,v 1.3 2021/07/31 14:36:33 andvar Exp $");
 
 #include "namespace.h"
 

Index: src/sys/arch/arm/ixp12x0/ixp12x0_clk.c
diff -u src/sys/arch/arm/ixp12x0/ixp12x0_clk.c:1.18 src/sys/arch/arm/ixp12x0/ixp12x0_clk.c:1.19
--- src/sys/arch/arm/ixp12x0/ixp12x0_clk.c:1.18	Fri May 29 12:30:39 2020
+++ src/sys/arch/arm/ixp12x0/ixp12x0_clk.c	Sat Jul 31 14:36:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp12x0_clk.c,v 1.18 2020/05/29 12:30:39 rin Exp $	*/
+/*	$NetBSD: ixp12x0_clk.c,v 1.19 2021/07/31 14:36:33 andvar Exp $	*/
 
 /*
  * Copyright (c) 1997 Mark Brinicombe.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixp12x0_clk.c,v 1.18 2020/05/29 12:30:39 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp12x0_clk.c,v 1.19 2021/07/31 14:36:33 andvar Exp $");
 
 #include 
 #include 
@@ -314,7 +314,7 @@ delay(unsigned int usecs)
 
 	if (ixpclk_sc == NULL) {
 #ifdef DEBUG
-		printf("delay: called befor start ixpclk\n");
+		printf("delay: called before start ixpclk\n");
 #endif
 
 		csec = usecs / 1;

Index: src/sys/arch/dreamcast/dev/pvr.c
diff -u src/sys/arch/dreamcast/dev/pvr.c:1.37 src/sys/arch/dreamcast/dev/pvr.c:1.38
--- src/sys/arch/dreamcast/dev/pvr.c:1.37	Sat Apr 24 23:36:31 2021
+++ src/sys/arch/dreamcast/dev/pvr.c	Sat Jul 31 14:36:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pvr.c,v 1.37 2021/04/24 23:36:31 thorpej Exp $	*/
+/*	$NetBSD: pvr.c,v 1.38 2021/07/31 14:36:33 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2001 Marcus Comstedt.
@@ -35,7 +35,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pvr.c,v 1.37 2021/04/24 23:36:31 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pvr.c,v 1.38 2021/07/31 14:36:33 andvar Exp $");
 
 #include 
 #include 
@@ -377,7 +377,7 @@ pvrmmap(void *v, void *vs, off_t offset,
 
 	/*
 	 * XXX This should be easy to support -- just need to define
-	 * XXX offsets for the contol regs, etc.
+	 * XXX offsets for the control regs, etc.
 	 */
 
 	struct pvr_softc *sc = v;

Index: src/sys/dev/ic/mb86950.c
diff -u src/sys/dev/ic/mb86950.c:1.34 src/sys/dev/ic/mb86950.c:1.35
--- src/sys/dev/ic/mb86950.c:1.34	Tue Feb  4 05:25:39 2020
+++ src/sys/dev/ic/mb86950.c	Sat Jul 31 14:36:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mb86950.c,v 1.34 2020/02/04 05:25:39 thorpej Exp $	*/
+/*	$NetBSD: mb86950.c,v 1.35 2021/07/31 14:36:33 andvar Exp $	*/
 
 /*
  * All Rights Reserved, Copyright (C) Fujitsu Limited 1995
@@ -67,7 +67,7 @@
   */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.34 2020/02/04 05:25:39 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.35 2021/07/31 14:36:33 andvar Exp $");
 
 /*
  * Device driver for Fujitsu mb86950 based Ethernet cards.
@@ -795,13 +795,13 @@ mb86950_rint(struct mb86950_softc *sc, u
 	 * We just loop checking the flag to pull out all received
 	 * packets.
 	 *
-	 * We limit the number of iterrations to avoid infinite loop.
+	 * We limit the number of iterations to avoid infinite loop.
 	 * It can be caused by a very slow CPU (some 

CVS commit: src

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 14:36:33 UTC 2021

Modified Files:
src/common/lib/libc/hash/sha3: sha3.c
src/sys/arch/arm/ixp12x0: ixp12x0_clk.c
src/sys/arch/dreamcast/dev: pvr.c
src/sys/dev/ic: mb86950.c mb86960.c mb86960var.h
src/sys/dev/usb: umcs.h

Log Message:
fix more typos in style found one in file - check/fix them all.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/hash/sha3/sha3.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/ixp12x0/ixp12x0_clk.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/dreamcast/dev/pvr.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/ic/mb86950.c
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/ic/mb86960.c
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/ic/mb86960var.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/usb/umcs.h

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



CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 13:47:19 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: lex.c

Log Message:
lint: reduce indentation in 'search'

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/xlint/lint1/lex.c

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



CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 13:47:19 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: lex.c

Log Message:
lint: reduce indentation in 'search'

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/xlint/lint1/lex.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/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.56 src/usr.bin/xlint/lint1/lex.c:1.57
--- src/usr.bin/xlint/lint1/lex.c:1.56	Fri Jul 23 15:36:56 2021
+++ src/usr.bin/xlint/lint1/lex.c	Sat Jul 31 13:47:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.56 2021/07/23 15:36:56 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.57 2021/07/31 13:47:19 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: lex.c,v 1.56 2021/07/23 15:36:56 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.57 2021/07/31 13:47:19 rillig Exp $");
 #endif
 
 #include 
@@ -450,17 +450,20 @@ lex_name(const char *yytext, size_t yyle
 static sym_t *
 search(sbuf_t *sb)
 {
-	sym_t	*sym;
+	sym_t *sym;
+	const struct kwtab *kw;
 
 	for (sym = symtab[sb->sb_hash]; sym != NULL; sym = sym->s_link) {
-		if (strcmp(sym->s_name, sb->sb_name) == 0) {
-			if (sym->s_keyword != NULL) {
-const struct kwtab *kw = sym->s_keyword;
-if (!kw->kw_attr || attron)
-	return sym;
-			} else if (!attron && sym->s_kind == symtyp)
-return sym;
-		}
+		if (strcmp(sym->s_name, sb->sb_name) != 0)
+			continue;
+		kw = sym->s_keyword;
+
+		if (kw != NULL && !kw->kw_attr)
+			return sym;
+		if (kw != NULL && attron)
+			return sym;
+		if (kw == NULL && !attron && sym->s_kind == symtyp)
+			return sym;
 	}
 
 	return NULL;



CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 11:37:54 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: in has_constant_member, don't reuse variables

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.320 -r1.321 src/usr.bin/xlint/lint1/tree.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/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.320 src/usr.bin/xlint/lint1/tree.c:1.321
--- src/usr.bin/xlint/lint1/tree.c:1.320	Sat Jul 31 11:03:04 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jul 31 11:37:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.320 2021/07/31 11:03:04 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.321 2021/07/31 11:37:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.320 2021/07/31 11:03:04 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.321 2021/07/31 11:37:53 rillig Exp $");
 #endif
 
 #include 
@@ -2546,19 +2546,17 @@ merge_qualifiers(type_t *tp1, const type
 static bool
 has_constant_member(const type_t *tp)
 {
-	sym_t	*m;
-	tspec_t	t;
+	sym_t *m;
 
-	lint_assert((t = tp->t_tspec) == STRUCT || t == UNION);
+	lint_assert(is_struct_or_union(tp->t_tspec));
 
 	for (m = tp->t_str->sou_first_member; m != NULL; m = m->s_next) {
-		tp = m->s_type;
-		if (tp->t_const)
+		const type_t *mtp = m->s_type;
+		if (mtp->t_const)
+			return true;
+		if (is_struct_or_union(mtp->t_tspec) &&
+		has_constant_member(mtp))
 			return true;
-		if ((t = tp->t_tspec) == STRUCT || t == UNION) {
-			if (has_constant_member(m->s_type))
-return true;
-		}
 	}
 	return false;
 }



CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 11:37:54 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: in has_constant_member, don't reuse variables

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.320 -r1.321 src/usr.bin/xlint/lint1/tree.c

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



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

2021-07-31 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Jul 31 11:34:40 UTC 2021

Modified Files:
src/sys/arch/arm/sunxi: sunxi_platform.c

Log Message:
sunxi_platform: declare UART FIFO sizes for SoCs we support


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/arm/sunxi/sunxi_platform.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_platform.c
diff -u src/sys/arch/arm/sunxi/sunxi_platform.c:1.44 src/sys/arch/arm/sunxi/sunxi_platform.c:1.45
--- src/sys/arch/arm/sunxi/sunxi_platform.c:1.44	Fri Jul 30 12:46:46 2021
+++ src/sys/arch/arm/sunxi/sunxi_platform.c	Sat Jul 31 11:34:40 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_platform.c,v 1.44 2021/07/30 12:46:46 tnn Exp $ */
+/* $NetBSD: sunxi_platform.c,v 1.45 2021/07/31 11:34:40 tnn Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -31,7 +31,7 @@
 #include "opt_console.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.44 2021/07/30 12:46:46 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.45 2021/07/31 11:34:40 tnn Exp $");
 
 #include 
 #include 
@@ -241,11 +241,23 @@ sunxi_platform_device_register(device_t 
 
 	if (device_is_a(self, "com")) {
 		static const struct device_compatible_entry compat_data[] = {
-			{ .compat = "allwinner,sun7i-a20" },
+			{ .compat = "allwinner,sun4i-a10",	.value = 64 },
+			{ .compat = "allwinner,sun5i-a13",	.value = 64 },
+			{ .compat = "allwinner,sun6i-a31",	.value = 64 },
+			{ .compat = "allwinner,sun7i-a20",	.value = 64 },
+			{ .compat = "allwinner,sun8i-h2-plus",	.value = 64 },
+			{ .compat = "allwinner,sun8i-h3",	.value = 64 },
+			{ .compat = "allwinner,sun8i-a83t",	.value = 64 },
+			{ .compat = "allwinner,sun9i-a80",	.value = 64 },
+			{ .compat = "allwinner,sun50i-a64",	.value = 64 },
+			{ .compat = "allwinner,sun50i-h5",	.value = 64 },
+			{ .compat = "allwinner,sun50i-h6",	.value = 256 },
 			DEVICE_COMPAT_EOL
 		};
-		if (of_compatible_match(OF_finddevice("/"), compat_data))
-			prop_dictionary_set_uint(prop, "fifolen", 64);
+		const struct device_compatible_entry *dce =
+		of_compatible_lookup(OF_finddevice("/"), compat_data);
+		if (dce != NULL)
+			prop_dictionary_set_uint(prop, "fifolen", dce->value);
 	}
 }
 



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

2021-07-31 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Jul 31 11:34:40 UTC 2021

Modified Files:
src/sys/arch/arm/sunxi: sunxi_platform.c

Log Message:
sunxi_platform: declare UART FIFO sizes for SoCs we support


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/arm/sunxi/sunxi_platform.c

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



CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 11:03:04 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: decl.c externs1.h func.c init.c lint1.h tree.c

Log Message:
lint: merge duplicate code for generating unqualified type

This is a preparation for fixing the wrong warnings in msg_115.c.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.210 -r1.211 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.121 -r1.122 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.115 -r1.116 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.203 -r1.204 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.118 -r1.119 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.319 -r1.320 src/usr.bin/xlint/lint1/tree.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/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.210 src/usr.bin/xlint/lint1/decl.c:1.211
--- src/usr.bin/xlint/lint1/decl.c:1.210	Sun Jul 25 22:14:36 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sat Jul 31 11:03:04 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.210 2021/07/25 22:14:36 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.211 2021/07/31 11:03:04 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.210 2021/07/25 22:14:36 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.211 2021/07/31 11:03:04 rillig Exp $");
 #endif
 
 #include 
@@ -187,6 +187,27 @@ expr_dup_type(const type_t *tp)
 }
 
 /*
+ * Return the unqualified version of the type.  The returned type is freed at
+ * the end of the current expression.
+ *
+ * See C99 6.2.5p25.
+ */
+type_t *
+expr_unqualified_type(const type_t *tp)
+{
+	type_t *ntp;
+
+	ntp = expr_zalloc(sizeof(*ntp));
+	*ntp = *tp;
+	ntp->t_const = false;
+	ntp->t_volatile = false;
+
+	/* TODO: deep-copy struct/union members; see msg_115.c */
+
+	return ntp;
+}
+
+/*
  * Returns whether the argument is void or an incomplete array,
  * struct, union or enum type.
  */

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.121 src/usr.bin/xlint/lint1/externs1.h:1.122
--- src/usr.bin/xlint/lint1/externs1.h:1.121	Sun Jul 25 22:14:36 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Jul 31 11:03:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.121 2021/07/25 22:14:36 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.122 2021/07/31 11:03:04 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -145,6 +145,7 @@ extern	void	initdecl(void);
 extern	type_t	*gettyp(tspec_t);
 extern	type_t	*dup_type(const type_t *);
 extern	type_t	*expr_dup_type(const type_t *);
+extern	type_t	*expr_unqualified_type(const type_t *);
 extern	bool	is_incomplete(const type_t *);
 extern	void	setcomplete(type_t *, bool);
 extern	void	add_storage_class(scl_t);

Index: src/usr.bin/xlint/lint1/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.115 src/usr.bin/xlint/lint1/func.c:1.116
--- src/usr.bin/xlint/lint1/func.c:1.115	Fri Jul 23 17:06:37 2021
+++ src/usr.bin/xlint/lint1/func.c	Sat Jul 31 11:03:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: func.c,v 1.115 2021/07/23 17:06:37 rillig Exp $	*/
+/*	$NetBSD: func.c,v 1.116 2021/07/31 11:03:04 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.115 2021/07/23 17:06:37 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.116 2021/07/31 11:03:04 rillig Exp $");
 #endif
 
 #include 
@@ -1091,8 +1091,7 @@ do_return(tnode_t *tn)
 		/* Create a temporary node for the left side */
 		ln = expr_zalloc(sizeof(*ln));
 		ln->tn_op = NAME;
-		ln->tn_type = expr_dup_type(funcsym->s_type->t_subt);
-		ln->tn_type->t_const = false;
+		ln->tn_type = expr_unqualified_type(funcsym->s_type->t_subt);
 		ln->tn_lvalue = true;
 		ln->tn_sym = funcsym;		/* better than nothing */
 

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.203 src/usr.bin/xlint/lint1/init.c:1.204
--- src/usr.bin/xlint/lint1/init.c:1.203	Tue Jul 20 19:44:36 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Jul 31 11:03:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.203 2021/07/20 19:44:36 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.204 2021/07/31 11:03:04 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.203 2021/07/20 19:44:36 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.204 2021/07/31 11:03:04 rillig Exp $");
 #endif
 
 #include 
@@ -400,8 +400,7 @@ check_init_expr(const type_t *tp, sym_t 
 	tspec_t lt, rt;
 	struct memory_block *tmem;
 
-	ltp = expr_dup_type(tp);
-	ltp->t_const = false;
+	ltp = expr_unqualified_type(tp);
 
 	/* Create a temporary node for the left side. */
 	ln = expr_zalloc(sizeof(*ln));
@@ -900,8 +899,7 @@ 

CVS commit: src/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 11:03:04 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: decl.c externs1.h func.c init.c lint1.h tree.c

Log Message:
lint: merge duplicate code for generating unqualified type

This is a preparation for fixing the wrong warnings in msg_115.c.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.210 -r1.211 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.121 -r1.122 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.115 -r1.116 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.203 -r1.204 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.118 -r1.119 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.319 -r1.320 src/usr.bin/xlint/lint1/tree.c

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



Re: CVS commit: src/sys

2021-07-31 Thread Tobias Nygren
On Fri, 30 Jul 2021 22:36:45 +0200
Tobias Nygren  wrote:

> On Fri, 30 Jul 2021 17:25:46 -0300 (ADT)
> Jared McNeill  wrote:
> 
> > Why only A20?
> 
> It is the hardware I have on hand. If you know specifically which
> SoCs need this, the compat_data array can be extended.
> I guess maybe these also?
> allwinner,sun4i-a10
> allwinner,sun6i-a31

Apparently it can be an issue on relatively speaking newer SoCs too.
For example the H6 does not have DesignWare specific register,
and comes with 256-byte FIFO instead of 64-byte.

It's not possible to deduce from the manual what DesignWare revision
is used but I guess I can go over the data sheets of currently
released SoCs and build a matrix of the proper values regardless
of DesignWare revision.



CVS commit: src/sys/netinet6

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 10:12:04 UTC 2021

Modified Files:
src/sys/netinet6: in6.h

Log Message:
fix typos in comments


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/netinet6/in6.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/netinet6/in6.h
diff -u src/sys/netinet6/in6.h:1.100 src/sys/netinet6/in6.h:1.101
--- src/sys/netinet6/in6.h:1.100	Tue Sep  8 14:12:57 2020
+++ src/sys/netinet6/in6.h	Sat Jul 31 10:12:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.h,v 1.100 2020/09/08 14:12:57 christos Exp $	*/
+/*	$NetBSD: in6.h,v 1.101 2021/07/31 10:12:04 andvar Exp $	*/
 /*	$KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $	*/
 
 /*
@@ -429,7 +429,7 @@ extern const struct in6_addr in6addr_lin
 #define IPV6_HOPLIMIT		47 /* int; send hop limit */
 #define IPV6_NEXTHOP		48 /* sockaddr; next hop addr */
 #define IPV6_HOPOPTS		49 /* ip6_hbh; send hop-by-hop option */
-#define IPV6_DSTOPTS		50 /* ip6_dest; send dst option befor rthdr */
+#define IPV6_DSTOPTS		50 /* ip6_dest; send dst option before rthdr */
 #define IPV6_RTHDR		51 /* ip6_rthdr; send routing header */
 
 #define IPV6_RECVTCLASS		57 /* bool; recv traffic class values */
@@ -440,7 +440,7 @@ extern const struct in6_addr in6addr_lin
 #define IPV6_TCLASS		61 /* int; send traffic class value */
 #define IPV6_DONTFRAG		62 /* bool; disable IPv6 fragmentation */
 #define IPV6_PREFER_TEMPADDR	63 /* int; prefer temporary address as
-* the sorce address */
+* the source address */
 #define IPV6_BINDANY		64 /* bool: allow bind to any address */
 /* to define items, should talk with KAME guys first, for *BSD compatibility */
 



CVS commit: src/sys/netinet6

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 10:12:04 UTC 2021

Modified Files:
src/sys/netinet6: in6.h

Log Message:
fix typos in comments


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/netinet6/in6.h

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



CVS commit: src/tests/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 10:09:03 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_115.c msg_115.exp

Log Message:
tests/lint: demonstrate more wrong warnings for const struct members

The code 't_const = false' occurs 4 times in the lint code, each
corresponding to one of the wrong warnings in the test.

This bug has been existing at least since 2001.  Back then, the lint
output was:

2001.12.24.20.52.09
| (23): lint error: popctrl() 1
| (15): syntax error [249]
| (19): warning: left operand of 'FARG' must be modifiable lvalue [115]
| (21): syntax error [249]
| (23): warning: function initialize_const_struct_member falls off bottom 
without returning value [217]
| exit status 1

from 2002.12.06.03.27.39
| (23): lint error: func.c, 168: popctrl()
| (15): warning: left operand of '=' must be modifiable lvalue [115]
| (19): warning: left operand of 'FARG' must be modifiable lvalue [115]
| (21): syntax error [249]
| (23): warning: function initialize_const_struct_member falls off bottom 
without returning value [217]
| exit status 1
until 2003.10.27.00.12.44


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_115.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_115.exp

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_115.c
diff -u src/tests/usr.bin/xlint/lint1/msg_115.c:1.5 src/tests/usr.bin/xlint/lint1/msg_115.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_115.c:1.5	Sat Jul 31 09:14:47 2021
+++ src/tests/usr.bin/xlint/lint1/msg_115.c	Sat Jul 31 10:09:03 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_115.c,v 1.5 2021/07/31 09:14:47 rillig Exp $	*/
+/*	$NetBSD: msg_115.c,v 1.6 2021/07/31 10:09:03 rillig Exp $	*/
 # 3 "msg_115.c"
 
 // Test for message: %soperand of '%s' must be modifiable lvalue [115]
@@ -16,20 +16,35 @@ example(const int *const_ptr)
 	(*const_ptr)++;		/* expect: 115 */
 }
 
-void
+typedef struct {
+	int const member;
+} const_member;
+
+void take_const_member(const_member);
+
+/* see typeok_assign, has_constant_member */
+const_member
 initialize_const_struct_member(void)
 {
-	struct S {
-		int const member;
-	};
-
 	/* FIXME: In an initialization, const members can be assigned. */
 	/* expect+1: warning: left operand of '=' must be modifiable lvalue [115] */
-	struct S s1 = (struct S) { 12345 };
-	if (s1.member != 0)
-		return;
-
-	struct S s2 = { 12345 };
-	if (s2.member != 0)
-		return;
+	const_member cm1 = (const_member) { 12345 };
+	if (cm1.member != 0)
+		/* FIXME: In a function call, const members can be assigned. */
+		/* expect+1: warning: left operand of 'farg' must be modifiable lvalue [115] */
+		take_const_member(cm1);
+
+	struct {
+		const_member member;
+	} cm2 = {
+	/* FIXME: In an initialization, const members can be assigned. */
+	/* expect+1: warning: left operand of 'init' must be modifiable lvalue [115] */
+	cm1,
+	};
+	if (cm2.member.member != 0) {
+	}
+
+	/* FIXME: In a return statement, const members can be assigned. */
+	/* expect+1: warning: left operand of 'return' must be modifiable lvalue [115] */
+	return cm1;
 }

Index: src/tests/usr.bin/xlint/lint1/msg_115.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_115.exp:1.4 src/tests/usr.bin/xlint/lint1/msg_115.exp:1.5
--- src/tests/usr.bin/xlint/lint1/msg_115.exp:1.4	Sat Jul 31 09:14:47 2021
+++ src/tests/usr.bin/xlint/lint1/msg_115.exp	Sat Jul 31 10:09:03 2021
@@ -5,4 +5,7 @@ msg_115.c(13): warning: left operand of 
 msg_115.c(14): warning: left operand of '/=' must be modifiable lvalue [115]
 msg_115.c(15): warning: left operand of '%=' must be modifiable lvalue [115]
 msg_115.c(16): warning: operand of 'x++' must be modifiable lvalue [115]
-msg_115.c(28): warning: left operand of '=' must be modifiable lvalue [115]
+msg_115.c(31): warning: left operand of '=' must be modifiable lvalue [115]
+msg_115.c(35): warning: left operand of 'farg' must be modifiable lvalue [115]
+msg_115.c(42): warning: left operand of 'init' must be modifiable lvalue [115]
+msg_115.c(49): warning: left operand of 'return' must be modifiable lvalue [115]



CVS commit: src/tests/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 10:09:03 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_115.c msg_115.exp

Log Message:
tests/lint: demonstrate more wrong warnings for const struct members

The code 't_const = false' occurs 4 times in the lint code, each
corresponding to one of the wrong warnings in the test.

This bug has been existing at least since 2001.  Back then, the lint
output was:

2001.12.24.20.52.09
| (23): lint error: popctrl() 1
| (15): syntax error [249]
| (19): warning: left operand of 'FARG' must be modifiable lvalue [115]
| (21): syntax error [249]
| (23): warning: function initialize_const_struct_member falls off bottom 
without returning value [217]
| exit status 1

from 2002.12.06.03.27.39
| (23): lint error: func.c, 168: popctrl()
| (15): warning: left operand of '=' must be modifiable lvalue [115]
| (19): warning: left operand of 'FARG' must be modifiable lvalue [115]
| (21): syntax error [249]
| (23): warning: function initialize_const_struct_member falls off bottom 
without returning value [217]
| exit status 1
until 2003.10.27.00.12.44


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_115.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_115.exp

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



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

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 10:07:23 UTC 2021

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

Log Message:
fix typos in comments


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

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

Modified files:

Index: src/sys/arch/sparc/sparc/autoconf.c
diff -u src/sys/arch/sparc/sparc/autoconf.c:1.266 src/sys/arch/sparc/sparc/autoconf.c:1.267
--- src/sys/arch/sparc/sparc/autoconf.c:1.266	Mon May 10 23:53:44 2021
+++ src/sys/arch/sparc/sparc/autoconf.c	Sat Jul 31 10:07:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.266 2021/05/10 23:53:44 thorpej Exp $ */
+/*	$NetBSD: autoconf.c,v 1.267 2021/07/31 10:07:22 andvar Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.266 2021/05/10 23:53:44 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.267 2021/07/31 10:07:22 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1114,7 +1114,7 @@ mainbus_attach(device_t parent, device_t
 		const char *const dev;
 #define BS_EARLY	1	/* attach device early */
 #define	BS_IGNORE	2	/* ignore root device */
-#define	BS_OPTIONAL	4	/* device not alwas present */
+#define	BS_OPTIONAL	4	/* device not always present */
 		unsigned int flags;
 	};
 



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

2021-07-31 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jul 31 10:07:23 UTC 2021

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

Log Message:
fix typos in comments


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

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



CVS commit: src/sys/dev/ic

2021-07-31 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Jul 31 10:04:13 UTC 2021

Modified Files:
src/sys/dev/ic: com.c

Log Message:
only read cpr register if we're going to use the value


To generate a diff of this commit:
cvs rdiff -u -r1.364 -r1.365 src/sys/dev/ic/com.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/com.c
diff -u src/sys/dev/ic/com.c:1.364 src/sys/dev/ic/com.c:1.365
--- src/sys/dev/ic/com.c:1.364	Fri Jul 30 12:46:46 2021
+++ src/sys/dev/ic/com.c	Sat Jul 31 10:04:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.364 2021/07/30 12:46:46 tnn Exp $ */
+/* $NetBSD: com.c,v 1.365 2021/07/31 10:04:12 tnn Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.364 2021/07/30 12:46:46 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.365 2021/07/31 10:04:12 tnn Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -539,10 +539,11 @@ com_attach_subr(struct com_softc *sc)
 		goto fifodelay;
 
 	case COM_TYPE_DW_APB:
-		cpr = bus_space_read_4(sc->sc_regs.cr_iot, sc->sc_regs.cr_ioh,
-		DW_APB_UART_CPR);
-		if (!prop_dictionary_get_uint(dict, "fifolen", >sc_fifolen))
+		if (!prop_dictionary_get_uint(dict, "fifolen", >sc_fifolen)) {
+			cpr = bus_space_read_4(sc->sc_regs.cr_iot,
+			sc->sc_regs.cr_ioh, DW_APB_UART_CPR);
 			sc->sc_fifolen = __SHIFTOUT(cpr, UART_CPR_FIFO_MODE) * 16;
+		}
 		if (sc->sc_fifolen == 0) {
 			sc->sc_fifolen = 1;
 			fifo_msg = "DesignWare APB UART, no fifo";



CVS commit: src/sys/dev/ic

2021-07-31 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Jul 31 10:04:13 UTC 2021

Modified Files:
src/sys/dev/ic: com.c

Log Message:
only read cpr register if we're going to use the value


To generate a diff of this commit:
cvs rdiff -u -r1.364 -r1.365 src/sys/dev/ic/com.c

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



CVS commit: src/usr.bin/make

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 09:30:17 UTC 2021

Modified Files:
src/usr.bin/make: Makefile make.h suff.c var.c
src/usr.bin/make/filemon: filemon_ktrace.c

Log Message:
make: fix lint warnings

The string functions from str.h are declared as 'static __unused' when
compiled with GCC, but lint explicitly undefines __GCC__ during
preprocessing.  Therefore, make those functions inline, to prevent
warnings that they are unused.

The macro UNCONST is used in a few places, and (again) since lint
undefines __GCC__, that macro expanded to a simple type cast, which lint
warned about.  To prevent this warning, implement UNCONST as a function
that works everywhere and hides the type cast.

In filemon_open, the code for closing F->in was obviously unreachable.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/usr.bin/make/Makefile
cvs rdiff -u -r1.263 -r1.264 src/usr.bin/make/make.h
cvs rdiff -u -r1.350 -r1.351 src/usr.bin/make/suff.c
cvs rdiff -u -r1.944 -r1.945 src/usr.bin/make/var.c
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/filemon/filemon_ktrace.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/Makefile
diff -u src/usr.bin/make/Makefile:1.115 src/usr.bin/make/Makefile:1.116
--- src/usr.bin/make/Makefile:1.115	Sun May 30 21:03:08 2021
+++ src/usr.bin/make/Makefile	Sat Jul 31 09:30:17 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.115 2021/05/30 21:03:08 rillig Exp $
+#	$NetBSD: Makefile,v 1.116 2021/07/31 09:30:17 rillig Exp $
 #	@(#)Makefile	5.2 (Berkeley) 12/28/90
 
 PROG=	make
@@ -117,6 +117,7 @@ SUBDIR+=	unit-tests
 .endif
 
 LINTFLAGS+=	-T	# strict bool mode, available since 2021-01-11
+LINTFLAGS+=	-w	# treat warnings as errors
 CLEANFILES+=	*.o	# for filemon objects
 
 COPTS.arch.c+=	${GCC_NO_FORMAT_TRUNCATION}

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.263 src/usr.bin/make/make.h:1.264
--- src/usr.bin/make/make.h:1.263	Mon Jun 21 10:33:11 2021
+++ src/usr.bin/make/make.h	Sat Jul 31 09:30:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.263 2021/06/21 10:33:11 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.264 2021/07/31 09:30:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,14 @@
 #endif
 
 #define MAKE_INLINE static inline MAKE_ATTR_UNUSED
+
+/* MAKE_STATIC marks a function that may or may not be inlined. */
+#if defined(lint)
+/* As of 2021-07-31, NetBSD lint ignores __attribute__((unused)). */
+#define MAKE_STATIC MAKE_INLINE
+#else
 #define MAKE_STATIC static MAKE_ATTR_UNUSED
+#endif
 
 #if __STDC_VERSION__ >= 199901L || defined(lint) || defined(USE_C99_BOOLEAN)
 #include 
@@ -742,16 +749,13 @@ GNode_VarArchive(GNode *gn) { return GNo
 MAKE_INLINE const char *
 GNode_VarMember(GNode *gn) { return GNode_ValueDirect(gn, MEMBER); }
 
-#if defined(__GNUC__) && __STDC_VERSION__ >= 199901L
-#define UNCONST(ptr)	({		\
-union __unconst {			\
-	const void *__cp;		\
-	void *__p;			\
-} __d;\
-__d.__cp = ptr, __d.__p; })
-#else
-#define UNCONST(ptr)	(void *)(ptr)
-#endif
+MAKE_INLINE void *
+UNCONST(const void *ptr)
+{
+	void *ret;
+	memcpy(, , sizeof(ret));
+	return ret;
+}
 
 /* At least GNU/Hurd systems lack hardcoded MAXPATHLEN/PATH_MAX */
 #include 

Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.350 src/usr.bin/make/suff.c:1.351
--- src/usr.bin/make/suff.c:1.350	Sun Apr  4 10:05:08 2021
+++ src/usr.bin/make/suff.c	Sat Jul 31 09:30:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.350 2021/04/04 10:05:08 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.351 2021/07/31 09:30:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -115,7 +115,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.350 2021/04/04 10:05:08 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.351 2021/07/31 09:30:17 rillig Exp $");
 
 typedef List SuffixList;
 typedef ListNode SuffixListNode;
@@ -619,6 +619,7 @@ Suff_AddTransform(const char *name)
 		/* TODO: Avoid the redundant parsing here. */
 		bool ok = ParseTransform(name, , );
 		assert(ok);
+		/* LINTED 129 *//* expression has null effect */
 		(void)ok;
 	}
 

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.944 src/usr.bin/make/var.c:1.945
--- src/usr.bin/make/var.c:1.944	Sat Jul 31 00:17:04 2021
+++ src/usr.bin/make/var.c	Sat Jul 31 09:30:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.944 2021/07/31 00:17:04 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.945 2021/07/31 09:30:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.944 2021/07/31 00:17:04 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.945 2021/07/31 09:30:17 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  

CVS commit: src/usr.bin/make

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 09:30:17 UTC 2021

Modified Files:
src/usr.bin/make: Makefile make.h suff.c var.c
src/usr.bin/make/filemon: filemon_ktrace.c

Log Message:
make: fix lint warnings

The string functions from str.h are declared as 'static __unused' when
compiled with GCC, but lint explicitly undefines __GCC__ during
preprocessing.  Therefore, make those functions inline, to prevent
warnings that they are unused.

The macro UNCONST is used in a few places, and (again) since lint
undefines __GCC__, that macro expanded to a simple type cast, which lint
warned about.  To prevent this warning, implement UNCONST as a function
that works everywhere and hides the type cast.

In filemon_open, the code for closing F->in was obviously unreachable.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/usr.bin/make/Makefile
cvs rdiff -u -r1.263 -r1.264 src/usr.bin/make/make.h
cvs rdiff -u -r1.350 -r1.351 src/usr.bin/make/suff.c
cvs rdiff -u -r1.944 -r1.945 src/usr.bin/make/var.c
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/filemon/filemon_ktrace.c

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



CVS commit: src/tests/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 09:14:47 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_115.c msg_115.exp

Log Message:
tests/lint: demonstrate wrong error message for initialization

Seen in usr.bin/make/var.c:4022 in C99 mode, where a ModChain variable
is initialized and two of the members are const-qualified.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_115.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_115.exp

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_115.c
diff -u src/tests/usr.bin/xlint/lint1/msg_115.c:1.4 src/tests/usr.bin/xlint/lint1/msg_115.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_115.c:1.4	Sun Jan 31 11:12:07 2021
+++ src/tests/usr.bin/xlint/lint1/msg_115.c	Sat Jul 31 09:14:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_115.c,v 1.4 2021/01/31 11:12:07 rillig Exp $	*/
+/*	$NetBSD: msg_115.c,v 1.5 2021/07/31 09:14:47 rillig Exp $	*/
 # 3 "msg_115.c"
 
 // Test for message: %soperand of '%s' must be modifiable lvalue [115]
@@ -15,3 +15,21 @@ example(const int *const_ptr)
 	*const_ptr %= 9;	/* expect: 115 */
 	(*const_ptr)++;		/* expect: 115 */
 }
+
+void
+initialize_const_struct_member(void)
+{
+	struct S {
+		int const member;
+	};
+
+	/* FIXME: In an initialization, const members can be assigned. */
+	/* expect+1: warning: left operand of '=' must be modifiable lvalue [115] */
+	struct S s1 = (struct S) { 12345 };
+	if (s1.member != 0)
+		return;
+
+	struct S s2 = { 12345 };
+	if (s2.member != 0)
+		return;
+}

Index: src/tests/usr.bin/xlint/lint1/msg_115.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_115.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_115.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_115.exp:1.3	Sun Jan 17 16:19:54 2021
+++ src/tests/usr.bin/xlint/lint1/msg_115.exp	Sat Jul 31 09:14:47 2021
@@ -5,3 +5,4 @@ msg_115.c(13): warning: left operand of 
 msg_115.c(14): warning: left operand of '/=' must be modifiable lvalue [115]
 msg_115.c(15): warning: left operand of '%=' must be modifiable lvalue [115]
 msg_115.c(16): warning: operand of 'x++' must be modifiable lvalue [115]
+msg_115.c(28): warning: left operand of '=' must be modifiable lvalue [115]



CVS commit: src/tests/usr.bin/xlint/lint1

2021-07-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul 31 09:14:47 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_115.c msg_115.exp

Log Message:
tests/lint: demonstrate wrong error message for initialization

Seen in usr.bin/make/var.c:4022 in C99 mode, where a ModChain variable
is initialized and two of the members are const-qualified.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_115.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_115.exp

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