CVS commit: src/usr.sbin/cpuctl/arch

2021-01-03 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Mon Jan  4 05:35:15 UTC 2021

Modified Files:
src/usr.sbin/cpuctl/arch: aarch64.c

Log Message:
sync cpuids[] of sys/arch/aarch64/aarch64/cpu.c r1.43


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/cpuctl/arch/aarch64.c

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/aarch64.c
diff -u src/usr.sbin/cpuctl/arch/aarch64.c:1.12 src/usr.sbin/cpuctl/arch/aarch64.c:1.13
--- src/usr.sbin/cpuctl/arch/aarch64.c:1.12	Sat Oct 10 08:27:41 2020
+++ src/usr.sbin/cpuctl/arch/aarch64.c	Mon Jan  4 05:35:14 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: aarch64.c,v 1.12 2020/10/10 08:27:41 jmcneill Exp $	*/
+/*	$NetBSD: aarch64.c,v 1.13 2021/01/04 05:35:14 ryo Exp $	*/
 
 /*
  * Copyright (c) 2018 Ryo Shimizu 
@@ -29,7 +29,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: aarch64.c,v 1.12 2020/10/10 08:27:41 jmcneill Exp $");
+__RCSID("$NetBSD: aarch64.c,v 1.13 2021/01/04 05:35:14 ryo Exp $");
 #endif /* no lint */
 
 #include 
@@ -72,17 +72,25 @@ struct fieldinfo {
 
 #define CPU_PARTMASK	(CPU_ID_IMPLEMENTOR_MASK | CPU_ID_PARTNO_MASK)
 const struct cpuidtab cpuids[] = {
-	{ CPU_ID_CORTEXA53R0 & CPU_PARTMASK, "Cortex-A53", "Cortex", "V8-A" },
-	{ CPU_ID_CORTEXA57R0 & CPU_PARTMASK, "Cortex-A57", "Cortex", "V8-A" },
-	{ CPU_ID_CORTEXA72R0 & CPU_PARTMASK, "Cortex-A72", "Cortex", "V8-A" },
-	{ CPU_ID_CORTEXA73R0 & CPU_PARTMASK, "Cortex-A73", "Cortex", "V8-A" },
-	{ CPU_ID_CORTEXA55R1 & CPU_PARTMASK, "Cortex-A55", "Cortex", "V8.2-A" },
-	{ CPU_ID_CORTEXA75R2 & CPU_PARTMASK, "Cortex-A75", "Cortex", "V8.2-A" },
-	{ CPU_ID_CORTEXA76R3 & CPU_PARTMASK, "Cortex-A76", "Cortex", "V8.2-A" },
-	{ CPU_ID_THUNDERXRX, "Cavium ThunderX", "Cavium", "V8-A" },
-	{ CPU_ID_THUNDERX81XXRX, "Cavium ThunderX CN81XX", "Cavium", "V8-A" },
-	{ CPU_ID_THUNDERX83XXRX, "Cavium ThunderX CN83XX", "Cavium", "V8-A" },
-	{ CPU_ID_THUNDERX2RX, "Cavium ThunderX2", "Cavium", "V8.1-A" },
+	{ CPU_ID_CORTEXA35R0 & CPU_PARTMASK, "Cortex-A35", "Arm", "v8-A" },
+	{ CPU_ID_CORTEXA53R0 & CPU_PARTMASK, "Cortex-A53", "Arm", "v8-A" },
+	{ CPU_ID_CORTEXA57R0 & CPU_PARTMASK, "Cortex-A57", "Arm", "v8-A" },
+	{ CPU_ID_CORTEXA55R1 & CPU_PARTMASK, "Cortex-A55", "Arm", "v8.2-A+" },
+	{ CPU_ID_CORTEXA65R0 & CPU_PARTMASK, "Cortex-A65", "Arm", "v8.2-A+" },
+	{ CPU_ID_CORTEXA72R0 & CPU_PARTMASK, "Cortex-A72", "Arm", "v8-A" },
+	{ CPU_ID_CORTEXA73R0 & CPU_PARTMASK, "Cortex-A73", "Arm", "v8-A" },
+	{ CPU_ID_CORTEXA75R2 & CPU_PARTMASK, "Cortex-A75", "Arm", "v8.2-A+" },
+	{ CPU_ID_CORTEXA76R3 & CPU_PARTMASK, "Cortex-A76", "Arm", "v8.2-A+" },
+	{ CPU_ID_CORTEXA76AER1 & CPU_PARTMASK, "Cortex-A76AE", "Arm", "v8.2-A+" },
+	{ CPU_ID_CORTEXA77R0 & CPU_PARTMASK, "Cortex-A77", "Arm", "v8.2-A+" },
+	{ CPU_ID_NVIDIADENVER2 & CPU_PARTMASK, "Denver2", "NVIDIA", "v8-A" },
+	{ CPU_ID_EMAG8180 & CPU_PARTMASK, "eMAG", "Ampere", "v8-A" },
+	{ CPU_ID_NEOVERSEE1R1 & CPU_PARTMASK, "Neoverse E1", "Arm", "v8.2-A+" },
+	{ CPU_ID_NEOVERSEN1R3 & CPU_PARTMASK, "Neoverse N1", "Arm", "v8.2-A+" },
+	{ CPU_ID_THUNDERXRX, "ThunderX", "Cavium", "v8-A" },
+	{ CPU_ID_THUNDERX81XXRX, "ThunderX CN81XX", "Cavium", "v8-A" },
+	{ CPU_ID_THUNDERX83XXRX, "ThunderX CN83XX", "Cavium", "v8-A" },
+	{ CPU_ID_THUNDERX2RX, "ThunderX2", "Marvell", "v8.1-A" },
 };
 
 const struct impltab implids[] = {



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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Jan  4 01:12:20 UTC 2021

Modified Files:
src/usr.bin/xlint/common: externs.h inittyp.c lint.h lp64.h

Log Message:
lint: revert previous commit, except for the typo


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/xlint/common/externs.h
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/xlint/common/inittyp.c
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/common/lint.h
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/xlint/common/lp64.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/common/externs.h
diff -u src/usr.bin/xlint/common/externs.h:1.11 src/usr.bin/xlint/common/externs.h:1.12
--- src/usr.bin/xlint/common/externs.h:1.11	Mon Jan  4 01:11:01 2021
+++ src/usr.bin/xlint/common/externs.h	Mon Jan  4 01:12:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs.h,v 1.11 2021/01/04 01:11:01 rillig Exp $	*/
+/*	$NetBSD: externs.h,v 1.12 2021/01/04 01:12:20 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -74,8 +74,3 @@ extern	void	outint(int);
 #define outname(a)	outname1(__FILE__, __LINE__, a);
 extern	void	outname1(const char *, size_t, const char *);
 extern	void	outsrc(const char *);
-
-/*
- * platforms.c
- */
-extern	const target_platform *platform(void);

Index: src/usr.bin/xlint/common/inittyp.c
diff -u src/usr.bin/xlint/common/inittyp.c:1.14 src/usr.bin/xlint/common/inittyp.c:1.15
--- src/usr.bin/xlint/common/inittyp.c:1.14	Mon Jan  4 01:11:01 2021
+++ src/usr.bin/xlint/common/inittyp.c	Mon Jan  4 01:12:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: inittyp.c,v 1.14 2021/01/04 01:11:01 rillig Exp $	*/
+/*	$NetBSD: inittyp.c,v 1.15 2021/01/04 01:12:20 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: inittyp.c,v 1.14 2021/01/04 01:11:01 rillig Exp $");
+__RCSID("$NetBSD: inittyp.c,v 1.15 2021/01/04 01:12:20 rillig Exp $");
 #endif
 
 #include 
@@ -113,10 +113,10 @@ inittyp(void)
   1, 1, 0, 1, 1, 0, "__uint128_t" } },
 #endif
 
-		{ FLOAT,{ 32, 4 * CHAR_BIT,
+		{ FLOAT,{ FLOAT_SIZE, 4 * CHAR_BIT,
   FLOAT, FLOAT,
   0, 0, 1, 1, 1, 0, "float" } },
-		{ DOUBLE,   { 64, 8 * CHAR_BIT,
+		{ DOUBLE,   { DOUBLE_SIZE, 8 * CHAR_BIT,
   DOUBLE, DOUBLE,
   0, 0, 1, 1, 1, 0, "double" } },
 		{ LDOUBLE,  { LDOUBLE_SIZE, 10 * CHAR_BIT,

Index: src/usr.bin/xlint/common/lint.h
diff -u src/usr.bin/xlint/common/lint.h:1.22 src/usr.bin/xlint/common/lint.h:1.23
--- src/usr.bin/xlint/common/lint.h:1.22	Mon Jan  4 01:11:01 2021
+++ src/usr.bin/xlint/common/lint.h	Mon Jan  4 01:12:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lint.h,v 1.22 2021/01/04 01:11:01 rillig Exp $	*/
+/*	$NetBSD: lint.h,v 1.23 2021/01/04 01:12:20 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -136,12 +136,4 @@ typedef	struct	ob {
 
 typedef struct type type_t;
 
-typedef struct target_platform {
-	const char *pl_name;
-	tspec_t pl_char_type;
-	size_t pl_long_pointer_size;
-	tspec_t pl_intptr_type;		/* either INT or LONG */
-	size_t pl_sizeof_long_double;	/* either 8, 12 or 16 */
-} target_platform;
-
 #include "externs.h"

Index: src/usr.bin/xlint/common/lp64.h
diff -u src/usr.bin/xlint/common/lp64.h:1.8 src/usr.bin/xlint/common/lp64.h:1.9
--- src/usr.bin/xlint/common/lp64.h:1.8	Mon Jan  4 01:11:01 2021
+++ src/usr.bin/xlint/common/lp64.h	Mon Jan  4 01:12:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lp64.h,v 1.8 2021/01/04 01:11:01 rillig Exp $	*/
+/*	$NetBSD: lp64.h,v 1.9 2021/01/04 01:12:20 rillig Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -53,11 +53,11 @@
 #define	TARG_SCHAR_MIN	((-TARG_CHAR_MAX) - 1)
 #define	TARG_UCHAR_MAX	((unsigned char) -1)
 
-#define	TARG_SHRT_MAX	32767
-#define	TARG_SHRT_MIN	(-32768)
-#define	TARG_USHRT_MAX	65535
+#define	TARG_SHRT_MAX	((int16_t) (((uint16_t) -1) >> 1))
+#define	TARG_SHRT_MIN	((-TARG_SHRT_MAX) - 1)
+#define	TARG_USHRT_MAX	((uint16_t) -1)
 
-#define	TARG_INT_MAX	(2147483647)
+#define	TARG_INT_MAX	((int32_t) (((uint32_t) -1) >> 1))
 #define	TARG_INT_MIN	((-TARG_INT_MAX) - 1)
 #define	TARG_UINT_MAX	((uint32_t) -1)
 



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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Jan  4 01:11:01 UTC 2021

Modified Files:
src/usr.bin/xlint/common: externs.h ilp32.h inittyp.c lint.h lp64.h

Log Message:
lint: fix typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/xlint/common/externs.h
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/xlint/common/ilp32.h
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/common/inittyp.c
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/xlint/common/lint.h
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/xlint/common/lp64.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/common/externs.h
diff -u src/usr.bin/xlint/common/externs.h:1.10 src/usr.bin/xlint/common/externs.h:1.11
--- src/usr.bin/xlint/common/externs.h:1.10	Sat Jan  2 03:49:25 2021
+++ src/usr.bin/xlint/common/externs.h	Mon Jan  4 01:11:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs.h,v 1.10 2021/01/02 03:49:25 rillig Exp $	*/
+/*	$NetBSD: externs.h,v 1.11 2021/01/04 01:11:01 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -74,3 +74,8 @@ extern	void	outint(int);
 #define outname(a)	outname1(__FILE__, __LINE__, a);
 extern	void	outname1(const char *, size_t, const char *);
 extern	void	outsrc(const char *);
+
+/*
+ * platforms.c
+ */
+extern	const target_platform *platform(void);

Index: src/usr.bin/xlint/common/ilp32.h
diff -u src/usr.bin/xlint/common/ilp32.h:1.3 src/usr.bin/xlint/common/ilp32.h:1.4
--- src/usr.bin/xlint/common/ilp32.h:1.3	Tue Mar 27 19:24:03 2012
+++ src/usr.bin/xlint/common/ilp32.h	Mon Jan  4 01:11:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ilp32.h,v 1.3 2012/03/27 19:24:03 christos Exp $	*/
+/*	$NetBSD: ilp32.h,v 1.4 2021/01/04 01:11:01 rillig Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 /*
- * Type sizes for IPL32 platforms (int, long, pointer: 32-bit)
+ * Type sizes for ILP32 platforms (int, long, pointer: 32-bit)
  */
 
 #define	CHAR_SIZE	(CHAR_BIT)

Index: src/usr.bin/xlint/common/inittyp.c
diff -u src/usr.bin/xlint/common/inittyp.c:1.13 src/usr.bin/xlint/common/inittyp.c:1.14
--- src/usr.bin/xlint/common/inittyp.c:1.13	Wed Dec 30 11:39:55 2020
+++ src/usr.bin/xlint/common/inittyp.c	Mon Jan  4 01:11:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: inittyp.c,v 1.13 2020/12/30 11:39:55 rillig Exp $	*/
+/*	$NetBSD: inittyp.c,v 1.14 2021/01/04 01:11:01 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: inittyp.c,v 1.13 2020/12/30 11:39:55 rillig Exp $");
+__RCSID("$NetBSD: inittyp.c,v 1.14 2021/01/04 01:11:01 rillig Exp $");
 #endif
 
 #include 
@@ -113,10 +113,10 @@ inittyp(void)
   1, 1, 0, 1, 1, 0, "__uint128_t" } },
 #endif
 
-		{ FLOAT,{ FLOAT_SIZE, 4 * CHAR_BIT,
+		{ FLOAT,{ 32, 4 * CHAR_BIT,
   FLOAT, FLOAT,
   0, 0, 1, 1, 1, 0, "float" } },
-		{ DOUBLE,   { DOUBLE_SIZE, 8 * CHAR_BIT,
+		{ DOUBLE,   { 64, 8 * CHAR_BIT,
   DOUBLE, DOUBLE,
   0, 0, 1, 1, 1, 0, "double" } },
 		{ LDOUBLE,  { LDOUBLE_SIZE, 10 * CHAR_BIT,

Index: src/usr.bin/xlint/common/lint.h
diff -u src/usr.bin/xlint/common/lint.h:1.21 src/usr.bin/xlint/common/lint.h:1.22
--- src/usr.bin/xlint/common/lint.h:1.21	Sat Jan  2 01:06:15 2021
+++ src/usr.bin/xlint/common/lint.h	Mon Jan  4 01:11:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lint.h,v 1.21 2021/01/02 01:06:15 rillig Exp $	*/
+/*	$NetBSD: lint.h,v 1.22 2021/01/04 01:11:01 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -136,4 +136,12 @@ typedef	struct	ob {
 
 typedef struct type type_t;
 
+typedef struct target_platform {
+	const char *pl_name;
+	tspec_t pl_char_type;
+	size_t pl_long_pointer_size;
+	tspec_t pl_intptr_type;		/* either INT or LONG */
+	size_t pl_sizeof_long_double;	/* either 8, 12 or 16 */
+} target_platform;
+
 #include "externs.h"

Index: src/usr.bin/xlint/common/lp64.h
diff -u src/usr.bin/xlint/common/lp64.h:1.7 src/usr.bin/xlint/common/lp64.h:1.8
--- src/usr.bin/xlint/common/lp64.h:1.7	Fri Nov 16 20:49:08 2018
+++ src/usr.bin/xlint/common/lp64.h	Mon Jan  4 01:11:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lp64.h,v 1.7 2018/11/16 20:49:08 scole Exp $	*/
+/*	$NetBSD: lp64.h,v 1.8 2021/01/04 01:11:01 rillig Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -53,11 +53,11 @@
 #define	TARG_SCHAR_MIN	((-TARG_CHAR_MAX) - 1)
 #define	TARG_UCHAR_MAX	((unsigned char) -1)
 
-#define	TARG_SHRT_MAX	((int16_t) (((uint16_t) -1) >> 1))
-#define	TARG_SHRT_MIN	((-TARG_SHRT_MAX) - 1)
-#define	TARG_USHRT_MAX	((uint16_t) -1)
+#define	TARG_SHRT_MAX	32767
+#define	TARG_SHRT_MIN	(-32768)
+#define	TARG_USHRT_MAX	65535
 
-#define	TARG_INT_MAX	((int32_t) (((uint32_t) -1) >> 1))
+#define	TARG_INT_MAX	(2147483647)
 #define	TARG_INT_MIN	((-TARG_INT_MAX) - 1)
 #define	TARG_UINT_MAX	((uint32_t) -1)
 



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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 21:33:50 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: cgram.y

Log Message:
lint: use consistent indentation for C grammar


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/usr.bin/xlint/lint1/cgram.y

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/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.129 src/usr.bin/xlint/lint1/cgram.y:1.130
--- src/usr.bin/xlint/lint1/cgram.y:1.129	Sun Jan  3 20:38:26 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Sun Jan  3 21:33:50 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.129 2021/01/03 20:38:26 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.130 2021/01/03 21:33:50 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.129 2021/01/03 20:38:26 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.130 2021/01/03 21:33:50 rillig Exp $");
 #endif
 
 #include 
@@ -568,7 +568,7 @@ type_attribute_spec:
 	| T_AT_RETURNS_TWICE
 	| T_AT_PACKED {
 		addpacked();
-	}
+	  }
 	| T_AT_PURE
 	| T_AT_TUNION
 	| T_AT_GNU_INLINE
@@ -577,17 +577,17 @@ type_attribute_spec:
 	constant T_COMMA constant T_RPAREN
 	| T_AT_USED {
 		add_attr_used();
-	}
+	  }
 	| T_AT_UNUSED {
 		add_attr_used();
-	}
+	  }
 	| T_AT_WARN_UNUSED_RESULT
 	| T_AT_WEAK
 	| T_AT_VISIBILITY T_LPAREN constant T_RPAREN
 	| T_QUAL {
 		if ($1 != CONST)
 			yyerror("Bad attribute");
-	}
+	  }
 	;
 
 type_attribute_spec_list:
@@ -598,14 +598,14 @@ type_attribute_spec_list:
 type_attribute:
 	  T_ATTRIBUTE T_LPAREN T_LPAREN {
 	attron = 1;
-	} type_attribute_spec_list {
+	  } type_attribute_spec_list {
 	attron = 0;
-	} T_RPAREN T_RPAREN
+	  } T_RPAREN T_RPAREN
 	| T_PACKED {
 		addpacked();
-	}
+	  }
 	| T_NORETURN {
-	}
+	  }
 	;
 
 type_attribute_list:
@@ -1041,7 +1041,7 @@ notype_direct_decl:
 	  }
 	| type_attribute notype_direct_decl {
 		$$ = $2;
-	}
+	  }
 	| notype_direct_decl T_LBRACK T_RBRACK {
 		$$ = add_array($1, 0, 0);
 	  }
@@ -1074,7 +1074,7 @@ type_direct_decl:
 	  }
 	| type_attribute type_direct_decl {
 		$$ = $2;
-	}
+	  }
 	| type_direct_decl T_LBRACK T_RBRACK {
 		$$ = add_array($1, 0, 0);
 	  }
@@ -1453,7 +1453,7 @@ direct_abs_decl:
 	  }
 	| type_attribute direct_abs_decl {
 		$$ = $2;
-	}
+	  }
 	| direct_abs_decl T_LBRACK T_RBRACK {
 		$$ = add_array($1, 0, 0);
 	  }
@@ -1500,12 +1500,12 @@ label:
 	| T_CASE constant T_COLON {
 		case_label($2);
 		ftflg = 1;
-	}
+	  }
 	| T_CASE constant T_ELLIPSE constant T_COLON {
 		/* XXX: We don't fill all cases */
 		case_label($2);
 		ftflg = 1;
-	}
+	  }
 	| T_DEFAULT T_COLON {
 		default_label();
 		ftflg = 1;
@@ -1518,7 +1518,7 @@ stmnt_d_list:
 		if (!Sflag)
 			/* declarations after statements is a C9X feature */
 			c99ism(327);
-	}
+	  }
 	;
 
 comp_stmnt:
@@ -1581,14 +1581,14 @@ expr_stmnt_val:
 	| non_expr_stmnt {
 		$$ = getnode();
 		$$->tn_type = gettyp(VOID);
-	}
+	  }
 	;
 
 expr_stmnt_list:
 	  expr_stmnt_val
 	| expr_stmnt_list expr_stmnt_val {
 		$$ = $2;
-	}
+	  }
 	;
 
 selection_stmnt:
@@ -1876,9 +1876,9 @@ term:
 		blklev++;
 		/* ({ }) is a GCC extension */
 		gnuism(320);
-	} comp_stmnt_rbrace T_RPAREN {
+	 } comp_stmnt_rbrace T_RPAREN {
 		$$ = new_name_node(initsym, 0);
-	}
+	 }
 	| T_LPAREN comp_stmnt_lbrace expr_stmnt_list {
 		blklev--;
 		mblklev--;
@@ -1887,9 +1887,9 @@ term:
 		blklev++;
 		/* ({ }) is a GCC extension */
 		gnuism(320);
-	} comp_stmnt_rbrace T_RPAREN {
+	 } comp_stmnt_rbrace T_RPAREN {
 		$$ = new_name_node(initsym, 0);
-	}
+	 }
 	| term T_INCDEC {
 		$$ = build($2 == INC ? INCAFT : DECAFT, $1, NULL);
 	  }



CVS commit: src/usr.bin/make

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 21:12:03 UTC 2021

Modified Files:
src/usr.bin/make: lst.h

Log Message:
make(1): remove anonymous union from struct ListNode

Anonymous structs and unions have been introduced in C11.  The code of
make is supposed to be compatible with C90 though.

The additional members were intended to be used during an interactive
debugging session only and were thus not relevant to running the actual
code.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/usr.bin/make/lst.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/make/lst.h
diff -u src/usr.bin/make/lst.h:1.94 src/usr.bin/make/lst.h:1.95
--- src/usr.bin/make/lst.h:1.94	Wed Dec 30 10:03:16 2020
+++ src/usr.bin/make/lst.h	Sun Jan  3 21:12:03 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lst.h,v 1.94 2020/12/30 10:03:16 rillig Exp $	*/
+/*	$NetBSD: lst.h,v 1.95 2021/01/03 21:12:03 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -90,11 +90,7 @@ typedef struct ListNode ListNode;
 struct ListNode {
 	ListNode *prev;		/* previous node in list, or NULL */
 	ListNode *next;		/* next node in list, or NULL */
-	union {
-		void *datum;	/* datum associated with this element */
-		const struct GNode *priv_gnode; /* alias, just for debugging */
-		const char *priv_str; /* alias, just for debugging */
-	};
+	void *datum;		/* datum associated with this element */
 };
 
 struct List {



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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 20:44:55 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: Makefile.err-msgs-h

Log Message:
lint: fix code generation from err.c

That file does not need to be in the current directory.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/xlint/lint1/Makefile.err-msgs-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.err-msgs-h
diff -u src/usr.bin/xlint/lint1/Makefile.err-msgs-h:1.1 src/usr.bin/xlint/lint1/Makefile.err-msgs-h:1.2
--- src/usr.bin/xlint/lint1/Makefile.err-msgs-h:1.1	Sun Jan  3 18:48:37 2021
+++ src/usr.bin/xlint/lint1/Makefile.err-msgs-h	Sun Jan  3 20:44:54 2021
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile.err-msgs-h,v 1.1 2021/01/03 18:48:37 rillig Exp $
+#	$NetBSD: Makefile.err-msgs-h,v 1.2 2021/01/03 20:44:54 rillig Exp $
 
 err-msgs.h: err.c Makefile.err-msgs-h
 	${_MKTARGET_CREATE}
 	sp='[[:space:]]*'; \
 	from="^$$sp\(\".*\"\)\,$$sp/\*$$sp\([0-9][0-9]*\)$$sp\*/\$$"; \
-	${TOOL_SED} -n -e "s,$$from,#define MSG_\2 \1,p" < err.c > ${.TARGET}.tmp
+	${TOOL_SED} -n -e "s,$$from,#define MSG_\2 \1,p" < ${.ALLSRC:M*err.c} > ${.TARGET}.tmp
 	mv -f ${.TARGET}.tmp ${.TARGET}
 
 CLEANFILES+=	err-msgs.h



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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 20:38:26 UTC 2021

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

Log Message:
lint: rename funcarg and funccall to longer names

>From the previous short names, it was no obvious that these functions
create a new tree node.

The function named funccall in lint2 has been left as-is, since it has a
completely different prototype.


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.121 -r1.122 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/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.128 src/usr.bin/xlint/lint1/cgram.y:1.129
--- src/usr.bin/xlint/lint1/cgram.y:1.128	Sun Jan  3 20:31:08 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Sun Jan  3 20:38:26 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.128 2021/01/03 20:31:08 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.129 2021/01/03 20:38:26 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.128 2021/01/03 20:31:08 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.129 2021/01/03 20:38:26 rillig Exp $");
 #endif
 
 #include 
@@ -1916,10 +1916,10 @@ term:
 		$$ = build(STAR, build(PLUS, $1, $3), NULL);
 	  }
 	| term T_LPAREN T_RPAREN {
-		$$ = funccall($1, NULL);
+		$$ = new_function_call_node($1, NULL);
 	  }
 	| term T_LPAREN func_arg_list T_RPAREN {
-		$$ = funccall($1, $3);
+		$$ = new_function_call_node($1, $3);
 	  }
 	| term point_or_arrow T_NAME {
 		if ($1 != NULL) {
@@ -2010,10 +2010,10 @@ string2:
 
 func_arg_list:
 	  expr		%prec T_COMMA {
-		$$ = funcarg(NULL, $1);
+		$$ = new_function_argument_node(NULL, $1);
 	  }
 	| func_arg_list T_COMMA expr {
-		$$ = funcarg($1, $3);
+		$$ = new_function_argument_node($1, $3);
 	  }
 	;
 

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.47 src/usr.bin/xlint/lint1/externs1.h:1.48
--- src/usr.bin/xlint/lint1/externs1.h:1.47	Sun Jan  3 20:31:08 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sun Jan  3 20:38:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.47 2021/01/03 20:31:08 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.48 2021/01/03 20:38:26 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -212,8 +212,8 @@ extern	tnode_t	*build_sizeof(type_t *);
 extern	tnode_t	*build_offsetof(type_t *, sym_t *);
 extern	tnode_t	*build_alignof(type_t *);
 extern	tnode_t	*cast(tnode_t *, type_t *);
-extern	tnode_t	*funcarg(tnode_t *, tnode_t *);
-extern	tnode_t	*funccall(tnode_t *, tnode_t *);
+extern	tnode_t	*new_function_argument_node(tnode_t *, tnode_t *);
+extern	tnode_t	*new_function_call_node(tnode_t *, tnode_t *);
 extern	val_t	*constant(tnode_t *, int);
 extern	void	expr(tnode_t *, int, int, int);
 extern	void	check_expr_misc(tnode_t *, int, int, int, int, int, int);

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.121 src/usr.bin/xlint/lint1/tree.c:1.122
--- src/usr.bin/xlint/lint1/tree.c:1.121	Sun Jan  3 20:31:08 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Jan  3 20:38:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.121 2021/01/03 20:31:08 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.122 2021/01/03 20:38:26 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.121 2021/01/03 20:31:08 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.122 2021/01/03 20:38:26 rillig Exp $");
 #endif
 
 #include 
@@ -3192,11 +3192,12 @@ cast(tnode_t *tn, type_t *tp)
 
 /*
  * Create the node for a function argument.
- * All necessary conversions and type checks are done in funccall(), because
- * in funcarg() we have no information about expected argument types.
+ * All necessary conversions and type checks are done in
+ * new_function_call_node because new_function_argument_node has no
+ * information about expected argument types.
  */
 tnode_t *
-funcarg(tnode_t *args, tnode_t *arg)
+new_function_argument_node(tnode_t *args, tnode_t *arg)
 {
 	tnode_t	*ntn;
 
@@ -3218,7 +3219,7 @@ funcarg(tnode_t *args, tnode_t *arg)
  * function arguments and insert conversions, if necessary.
  */
 tnode_t *
-funccall(tnode_t *func, tnode_t *args)
+new_function_call_node(tnode_t *func, tnode_t *args)
 {
 	tnode_t	*ntn;
 	op_t	fcop;



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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 20:31:09 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: cgram.y externs1.h init.c tree.c

Log Message:
lint: rename functions that create nodes


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.120 -r1.121 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/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.127 src/usr.bin/xlint/lint1/cgram.y:1.128
--- src/usr.bin/xlint/lint1/cgram.y:1.127	Fri Jan  1 11:41:01 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Sun Jan  3 20:31:08 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.127 2021/01/01 11:41:01 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.128 2021/01/03 20:31:08 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.127 2021/01/01 11:41:01 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.128 2021/01/03 20:31:08 rillig Exp $");
 #endif
 
 #include 
@@ -1855,13 +1855,13 @@ term:
 		/* XXX really necessary? */
 		if (yychar < 0)
 			yychar = yylex();
-		$$ = getnnode(getsym($1), yychar);
+		$$ = new_name_node(getsym($1), yychar);
 	  }
 	| string {
-		$$ = getsnode($1);
+		$$ = new_string_node($1);
 	  }
 	| T_CON {
-		$$ = getcnode(gettyp($1->v_tspec), $1);
+		$$ = new_constant_node(gettyp($1->v_tspec), $1);
 	  }
 	| T_LPAREN expr T_RPAREN {
 		if ($2 != NULL)
@@ -1877,7 +1877,7 @@ term:
 		/* ({ }) is a GCC extension */
 		gnuism(320);
 	} comp_stmnt_rbrace T_RPAREN {
-		$$ = getnnode(initsym, 0);
+		$$ = new_name_node(initsym, 0);
 	}
 	| T_LPAREN comp_stmnt_lbrace expr_stmnt_list {
 		blklev--;
@@ -1888,7 +1888,7 @@ term:
 		/* ({ }) is a GCC extension */
 		gnuism(320);
 	} comp_stmnt_rbrace T_RPAREN {
-		$$ = getnnode(initsym, 0);
+		$$ = new_name_node(initsym, 0);
 	}
 	| term T_INCDEC {
 		$$ = build($2 == INC ? INCAFT : DECAFT, $1, NULL);
@@ -1936,7 +1936,7 @@ term:
 $1 = cconv($1);
 			}
 			msym = struct_or_union_member($1, $2, getsym($3));
-			$$ = build($2, $1, getnnode(msym, 0));
+			$$ = build($2, $1, new_name_node(msym, 0));
 		} else {
 			$$ = NULL;
 		}
@@ -1982,7 +1982,7 @@ term:
 		if (!Sflag)
 			 /* compound literals are a C9X/GCC extension */
 			 gnuism(319);
-		$$ = getnnode(initsym, 0);
+		$$ = new_name_node(initsym, 0);
 	  }
 	;
 

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.46 src/usr.bin/xlint/lint1/externs1.h:1.47
--- src/usr.bin/xlint/lint1/externs1.h:1.46	Sun Jan  3 20:14:38 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sun Jan  3 20:31:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.46 2021/01/03 20:14:38 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.47 2021/01/03 20:31:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -198,9 +198,9 @@ extern	void	print_previous_declaration(i
  */
 extern	type_t	*incref(type_t *, tspec_t);
 extern	type_t	*tincref(type_t *, tspec_t);
-extern	tnode_t	*getcnode(type_t *, val_t *);
-extern	tnode_t	*getnnode(sym_t *, int);
-extern	tnode_t	*getsnode(strg_t *);
+extern	tnode_t	*new_constant_node(type_t *, val_t *);
+extern	tnode_t	*new_name_node(sym_t *, int);
+extern	tnode_t	*new_string_node(strg_t *);
 extern	sym_t	*struct_or_union_member(tnode_t *, op_t, sym_t *);
 extern	tnode_t	*build(op_t, tnode_t *, tnode_t *);
 extern	tnode_t	*cconv(tnode_t *);

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.59 src/usr.bin/xlint/lint1/init.c:1.60
--- src/usr.bin/xlint/lint1/init.c:1.59	Sun Jan  3 19:10:47 2021
+++ src/usr.bin/xlint/lint1/init.c	Sun Jan  3 20:31:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.59 2021/01/03 19:10:47 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.60 2021/01/03 20:31:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.59 2021/01/03 19:10:47 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.60 2021/01/03 20:31:08 rillig Exp $");
 #endif
 
 #include 
@@ -582,7 +582,7 @@ mkinit(tnode_t *tn)
 	 */
 	if ((sc == AUTO || sc == REG) &&
 	initsym->s_type->t_tspec != ARRAY && initstk->i_next == NULL) {
-		ln = getnnode(initsym, 0);
+		ln = new_name_node(initsym, 0);
 		ln->tn_type = tduptyp(ln->tn_type);
 		ln->tn_type->t_const = 0;
 		tn = build(ASSIGN, ln, tn);

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.120 src/usr.bin/xlint/lint1/tree.c:1.121
--- src/usr.bin/xlint/lint1/tree.c:1.120	Sun Jan  3 19:10:47 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Jan  3 20:31:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.120 2021/01/0

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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 20:20:01 UTC 2021

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

Log Message:
lint: add test for 265 "c89 C does not support 'long long'"


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_265.c \
src/tests/usr.bin/xlint/lint1/msg_265.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_265.c
diff -u src/tests/usr.bin/xlint/lint1/msg_265.c:1.1 src/tests/usr.bin/xlint/lint1/msg_265.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_265.c:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_265.c	Sun Jan  3 20:20:01 2021
@@ -1,7 +1,13 @@
-/*	$NetBSD: msg_265.c,v 1.1 2021/01/02 10:22:44 rillig Exp $	*/
+/*	$NetBSD: msg_265.c,v 1.2 2021/01/03 20:20:01 rillig Exp $	*/
 # 3 "msg_265.c"
 
-// Test for message: %s C does not support 'long long' [265]
+/* Test for message: %s C does not support 'long long' [265] */
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+/* lint1-flags: -w */
+
+long long unsupported_variable;
+
+/*LONGLONG*/
+long long suppressed_variable;
+
+long long another_unsupported_variable;
Index: src/tests/usr.bin/xlint/lint1/msg_265.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_265.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_265.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_265.exp:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_265.exp	Sun Jan  3 20:20:01 2021
@@ -1 +1,2 @@
-msg_265.c(6): syntax error ':' [249]
+msg_265.c(8): warning: c89 C does not support 'long long' [265]
+msg_265.c(13): warning: c89 C does not support 'long long' [265]



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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 20:14:38 UTC 2021

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

Log Message:
lint: rename prflstrg to printflike_argnum, likewise for scflstrg


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.48 -r1.49 src/usr.bin/xlint/lint1/func.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.109 src/usr.bin/xlint/lint1/decl.c:1.110
--- src/usr.bin/xlint/lint1/decl.c:1.109	Sun Jan  3 19:15:36 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sun Jan  3 20:14:38 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.109 2021/01/03 19:15:36 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.110 2021/01/03 20:14:38 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.109 2021/01/03 19:15:36 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.110 2021/01/03 20:14:38 rillig Exp $");
 #endif
 
 #include 
@@ -2389,14 +2389,16 @@ check_func_lint_directives(void)
 	tspec_t t;
 
 	/* check for illegal combinations of lint directives */
-	if (prflstrg != -1 && scflstrg != -1) {
+	if (printflike_argnum != -1 && scanflike_argnum != -1) {
 		/* can't be used together: ** PRINTFLIKE ** ** SCANFLIKE ** */
 		warning(289);
-		prflstrg = scflstrg = -1;
+		printflike_argnum = scanflike_argnum = -1;
 	}
-	if (nvararg != -1 && (prflstrg != -1 || scflstrg != -1)) {
+	if (nvararg != -1 &&
+	(printflike_argnum != -1 || scanflike_argnum != -1)) {
 		/* dubious use of ** VARARGS ** with ** %s ** */
-		warning(288, prflstrg != -1 ? "PRINTFLIKE" : "SCANFLIKE");
+		warning(288,
+		printflike_argnum != -1 ? "PRINTFLIKE" : "SCANFLIKE");
 		nvararg = -1;
 	}
 
@@ -2417,22 +2419,23 @@ check_func_lint_directives(void)
 		warning(283, "VARARGS");
 		nvararg = 0;
 	}
-	if (prflstrg > narg) {
+	if (printflike_argnum > narg) {
 		/* argument number mismatch with directive: ** %s ** */
 		warning(283, "PRINTFLIKE");
-		prflstrg = -1;
-	} else if (prflstrg == 0) {
-		prflstrg = -1;
+		printflike_argnum = -1;
+	} else if (printflike_argnum == 0) {
+		printflike_argnum = -1;
 	}
-	if (scflstrg > narg) {
+	if (scanflike_argnum > narg) {
 		/* argument number mismatch with directive: ** %s ** */
 		warning(283, "SCANFLIKE");
-		scflstrg = -1;
-	} else if (scflstrg == 0) {
-		scflstrg = -1;
-	}
-	if (prflstrg != -1 || scflstrg != -1) {
-		narg = prflstrg != -1 ? prflstrg : scflstrg;
+		scanflike_argnum = -1;
+	} else if (scanflike_argnum == 0) {
+		scanflike_argnum = -1;
+	}
+	if (printflike_argnum != -1 || scanflike_argnum != -1) {
+		narg = printflike_argnum != -1
+		? printflike_argnum : scanflike_argnum;
 		arg = dcs->d_fargs;
 		for (n = 1; n < narg; n++)
 			arg = arg->s_next;
@@ -2441,7 +2444,7 @@ check_func_lint_directives(void)
 		 t != UCHAR && t != SCHAR)) {
 			/* arg. %d must be 'char *' for PRINTFLIKE/SCANFLIKE */
 			warning(293, narg);
-			prflstrg = scflstrg = -1;
+			printflike_argnum = scanflike_argnum = -1;
 		}
 	}
 }

Index: src/usr.bin/xlint/lint1/emit1.c
diff -u src/usr.bin/xlint/lint1/emit1.c:1.32 src/usr.bin/xlint/lint1/emit1.c:1.33
--- src/usr.bin/xlint/lint1/emit1.c:1.32	Sat Jan  2 18:26:44 2021
+++ src/usr.bin/xlint/lint1/emit1.c	Sun Jan  3 20:14:38 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.32 2021/01/02 18:26:44 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.33 2021/01/03 20:14:38 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit1.c,v 1.32 2021/01/02 18:26:44 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.33 2021/01/03 20:14:38 rillig Exp $");
 #endif
 
 #include 
@@ -330,25 +330,25 @@ outfdef(sym_t *fsym, pos_t *posp, int rv
 	/* flags */
 
 	/* both SCANFLIKE and PRINTFLIKE imply VARARGS */
-	if (prflstrg != -1) {
-		nvararg = prflstrg;
-	} else if (scflstrg != -1) {
-		nvararg = scflstrg;
+	if (printflike_argnum != -1) {
+		nvararg = printflike_argnum;
+	} else if (scanflike_argnum != -1) {
+		nvararg = scanflike_argnum;
 	}
 
 	if (nvararg != -1) {
 		outchar('v');
 		outint(nvararg);
 	}
-	if (scflstrg != -1) {
+	if (scanflike_argnum != -1) {
 		outchar('S');
-		outint(scflstrg);
+		outint(scanflike_argnum);
 	}
-	if (prflstrg != -1) {
+	if (printflike_argnum != -1) {
 		outchar('P');
-		outint(prflstrg);
+		outint(printflike_argnum);
 	}
-	nvararg = prflstrg = scflstrg = -1;
+	nvararg = printflike_argnum = scanflike_argnum = -1;
 
 	outchar('d');
 

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1

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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 20:04:09 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: func.c lint1.h

Log Message:
lint: rename cstk to cstmt

Most of the code that deals with control statements is only interested
in the innermost control statement, and not if that is a stack or not.
Therefore, emphasize that part in the variable name.

The member c_next was confusing since the "direction" of this "next
element" was ambiguous.  In a sequence of if statements, the "next"
element could have equally been the following one, not the surrounding
one.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.51 -r1.52 src/usr.bin/xlint/lint1/lint1.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/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.47 src/usr.bin/xlint/lint1/func.c:1.48
--- src/usr.bin/xlint/lint1/func.c:1.47	Sat Jan  2 18:44:58 2021
+++ src/usr.bin/xlint/lint1/func.c	Sun Jan  3 20:04:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: func.c,v 1.47 2021/01/02 18:44:58 rillig Exp $	*/
+/*	$NetBSD: func.c,v 1.48 2021/01/03 20:04:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.47 2021/01/02 18:44:58 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.48 2021/01/03 20:04:08 rillig Exp $");
 #endif
 
 #include 
@@ -75,8 +75,8 @@ int	rchflg;
  */
 int	ftflg;
 
-/* Top element of stack for control statements */
-cstk_t	*cstk;
+/* The innermost control statement */
+cstk_t	*cstmt;
 
 /*
  * Number of arguments which will be checked for usage in following
@@ -159,8 +159,8 @@ pushctrl(int env)
 
 	ci = xcalloc(1, sizeof (cstk_t));
 	ci->c_env = env;
-	ci->c_next = cstk;
-	cstk = ci;
+	ci->c_surrounding = cstmt;
+	cstmt = ci;
 }
 
 /*
@@ -172,10 +172,10 @@ popctrl(int env)
 	cstk_t	*ci;
 	clst_t	*cl;
 
-	lint_assert(cstk != NULL);
-	lint_assert(cstk->c_env == env);
+	lint_assert(cstmt != NULL);
+	lint_assert(cstmt->c_env == env);
 
-	cstk = (ci = cstk)->c_next;
+	cstmt = (ci = cstmt)->c_surrounding;
 
 	while ((cl = ci->c_clst) != NULL) {
 		ci->c_clst = cl->cl_next;
@@ -347,7 +347,7 @@ funcend(void)
 	int	n;
 
 	if (reached) {
-		cstk->c_noretval = 1;
+		cstmt->c_noretval = 1;
 		if (funcsym->s_type->t_subt->t_tspec != VOID &&
 		!funcsym->s_rimpl) {
 			/* func. %s falls off bottom without returning value */
@@ -360,7 +360,7 @@ funcend(void)
 	 * declared to be int. Otherwise the wrong return statement
 	 * has already printed a warning.
 	 */
-	if (cstk->c_noretval && cstk->c_retval && funcsym->s_rimpl)
+	if (cstmt->c_noretval && cstmt->c_retval && funcsym->s_rimpl)
 		/* function %s has return (e); and return; */
 		warning(216, funcsym->s_name);
 
@@ -383,7 +383,7 @@ funcend(void)
 	if (dcs->d_scl == EXTERN && funcsym->s_inline) {
 		outsym(funcsym, funcsym->s_scl, DECL);
 	} else {
-		outfdef(funcsym, &dcs->d_fdpos, cstk->c_retval,
+		outfdef(funcsym, &dcs->d_fdpos, cstmt->c_retval,
 			funcsym->s_osdef, dcs->d_fargs);
 	}
 
@@ -493,7 +493,7 @@ case_label(tnode_t *tn)
 	cstk_t	*ci;
 
 	/* find the stack entry for the innermost switch statement */
-	for (ci = cstk; ci != NULL && !ci->c_switch; ci = ci->c_next)
+	for (ci = cstmt; ci != NULL && !ci->c_switch; ci = ci->c_surrounding)
 		continue;
 
 	check_case_label(tn, ci);
@@ -509,7 +509,7 @@ default_label(void)
 	cstk_t	*ci;
 
 	/* find the stack entry for the innermost switch statement */
-	for (ci = cstk; ci != NULL && !ci->c_switch; ci = ci->c_next)
+	for (ci = cstmt; ci != NULL && !ci->c_switch; ci = ci->c_surrounding)
 		continue;
 
 	if (ci == NULL) {
@@ -574,7 +574,7 @@ void
 if2(void)
 {
 
-	cstk->c_rchif = reached ? 1 : 0;
+	cstmt->c_rchif = reached ? 1 : 0;
 	reached = 1;
 }
 
@@ -587,7 +587,7 @@ if3(int els)
 {
 
 	if (els) {
-		reached |= cstk->c_rchif;
+		reached |= cstmt->c_rchif;
 	} else {
 		reached = 1;
 	}
@@ -638,8 +638,8 @@ switch1(tnode_t *tn)
 	expr(tn, 1, 0, 1);
 
 	pushctrl(T_SWITCH);
-	cstk->c_switch = 1;
-	cstk->c_swtype = tp;
+	cstmt->c_switch = 1;
+	cstmt->c_swtype = tp;
 
 	reached = rchflg = 0;
 	ftflg = 1;
@@ -655,36 +655,36 @@ switch2(void)
 	sym_t	*esym;
 	clst_t	*cl;
 
-	lint_assert(cstk->c_swtype != NULL);
+	lint_assert(cstmt->c_swtype != NULL);
 
 	/*
 	 * If the switch expression was of type enumeration, count the case
 	 * labels and the number of enumerators. If both counts are not
 	 * equal print a warning.
 	 */
-	if (cstk->c_swtype->t_isenum) {
+	if (cstmt->c_swtype->t_isenum) {
 		nenum = nclab = 0;
-		lint_assert(cstk->c_swtype->t_enum != NULL);
-		for (esym = cstk->c_swtype->t_enum->elem;
+		lint_assert(cstmt->c_swtype->t_enum != NULL);
+		for (esym = cstmt->c_swtype->t_enum->elem;
 		 esym != NULL; esym = esym->s_next) {
 			nenum++;
 		}
-		for (cl = cstk->c_clst; cl != NULL; cl = cl->cl_

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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 19:15:36 UTC 2021

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

Log Message:
lint: rename t_ispacked to t_packed and d_ispacked to d_packed

It's shorter, and the other flags of the type or declaration also don't
have "is" in their names.  Except for t_isenum, but that's because there
is a macro named t_enum that would interfere with that name.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/xlint/lint1/lint1.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/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.108 src/usr.bin/xlint/lint1/decl.c:1.109
--- src/usr.bin/xlint/lint1/decl.c:1.108	Sun Jan  3 19:10:47 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sun Jan  3 19:15:36 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.108 2021/01/03 19:10:47 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.109 2021/01/03 19:15:36 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.108 2021/01/03 19:10:47 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.109 2021/01/03 19:15:36 rillig Exp $");
 #endif
 
 #include 
@@ -536,7 +536,7 @@ void
 addpacked(void)
 {
 	if (dcs->d_type == NULL)
-		dcs->d_ispacked = 1;
+		dcs->d_packed = 1;
 	else
 		setpackedsize(dcs->d_type);
 }
@@ -1639,7 +1639,7 @@ mktag(sym_t *tag, tspec_t kind, int decl
 		if (tag->s_scl == NOSCL) {
 			tag->s_scl = scl;
 			tag->s_type = tp = getblk(sizeof (type_t));
-			tp->t_ispacked = dcs->d_ispacked;
+			tp->t_packed = dcs->d_packed;
 		} else {
 			tp = tag->s_type;
 		}
@@ -1651,7 +1651,7 @@ mktag(sym_t *tag, tspec_t kind, int decl
 		tag->s_scl = scl;
 		tag->s_blklev = -1;
 		tag->s_type = tp = getblk(sizeof (type_t));
-		tp->t_ispacked = dcs->d_ispacked;
+		tp->t_packed = dcs->d_packed;
 		dcs->d_next->d_nedecl = 1;
 	}
 
@@ -1772,7 +1772,7 @@ complete_tag_struct_or_union(type_t *tp,
 	sp = tp->t_str;
 	sp->align = dcs->d_stralign;
 	sp->memb = fmem;
-	if (tp->t_ispacked)
+	if (tp->t_packed)
 		setpackedsize(tp);
 	else
 		sp->size = dcs->d_offset;

Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.50 src/usr.bin/xlint/lint1/lint1.h:1.51
--- src/usr.bin/xlint/lint1/lint1.h:1.50	Sun Jan  3 19:10:47 2021
+++ src/usr.bin/xlint/lint1/lint1.h	Sun Jan  3 19:15:36 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.50 2021/01/03 19:10:47 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.51 2021/01/03 19:15:36 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -158,7 +158,7 @@ struct type {
 	bool	t_typedef : 1;	/* type defined with typedef */
 	bool	t_bitfield : 1;
 	bool	t_isenum : 1;	/* type is (or was) enum (t_enum valid) */
-	bool	t_ispacked : 1;	/* type is packed */
+	bool	t_packed : 1;
 	union {
 		int	_t_dim;		/* dimension */
 		str_t	*_t_str;	/* struct/union tag */
@@ -343,8 +343,8 @@ typedef	struct dinfo {
 	bool	d_proto : 1;	/* current function decl. is prototype */
 	bool	d_notyp : 1;	/* set if no type specifier was present */
 	bool	d_asm : 1;	/* set if d_ctx == AUTO and asm() present */
-	bool	d_ispacked : 1;	/* packed */
-	bool	d_used : 1;	/* used */
+	bool	d_packed : 1;
+	bool	d_used : 1;
 	type_t	*d_tagtyp;	/* tag during member declaration */
 	sym_t	*d_fargs;	/* list of arguments during function def. */
 	pos_t	d_fdpos;	/* position of function definition */



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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 19:10:47 UTC 2021

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

Log Message:
lint: rename type.t_isfield to t_bitfield


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.119 -r1.120 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.107 src/usr.bin/xlint/lint1/decl.c:1.108
--- src/usr.bin/xlint/lint1/decl.c:1.107	Sun Jan  3 18:48:37 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sun Jan  3 19:10:47 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.107 2021/01/03 18:48:37 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.108 2021/01/03 19:10:47 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.107 2021/01/03 18:48:37 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.108 2021/01/03 19:10:47 rillig Exp $");
 #endif
 
 #include 
@@ -494,7 +494,7 @@ static size_t
 bitfieldsize(sym_t **mem)
 {
 	size_t len = (*mem)->s_type->t_flen;
-	while (*mem && (*mem)->s_type->t_isfield) {
+	while (*mem && (*mem)->s_type->t_bitfield) {
 		len += (*mem)->s_type->t_flen;
 		*mem = (*mem)->s_next;
 	}
@@ -513,7 +513,7 @@ setpackedsize(type_t *tp)
 		sp = tp->t_str;
 		sp->size = 0;
 		for (mem = sp->memb; mem != NULL; mem = mem->s_next) {
-			if (mem->s_type->t_isfield) {
+			if (mem->s_type->t_bitfield) {
 sp->size += bitfieldsize(&mem);
 if (mem == NULL)
 	break;
@@ -1148,7 +1148,7 @@ declarator_1_struct_union(sym_t *dsym)
 		if (dsym->s_scl == MOU) {
 			/* illegal use of bit-field */
 			error(41);
-			dsym->s_type->t_isfield = 0;
+			dsym->s_type->t_bitfield = false;
 			dsym->s_bitfield = 0;
 		}
 	} else if (t == FUNC) {
@@ -1238,7 +1238,7 @@ bitfield(sym_t *dsym, int len)
 		dsym->s_blklev = -1;
 	}
 	dsym->s_type = duptyp(dsym->s_type);
-	dsym->s_type->t_isfield = 1;
+	dsym->s_type->t_bitfield = true;
 	dsym->s_type->t_flen = len;
 	dsym->s_bitfield = 1;
 	return dsym;
@@ -1787,7 +1787,7 @@ complete_tag_struct_or_union(type_t *tp,
 		/* bind anonymous members to the structure */
 		if (mem->s_styp == NULL) {
 			mem->s_styp = sp;
-			if (mem->s_type->t_isfield) {
+			if (mem->s_type->t_bitfield) {
 sp->size += bitfieldsize(&mem);
 if (mem == NULL)
 	break;

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.58 src/usr.bin/xlint/lint1/init.c:1.59
--- src/usr.bin/xlint/lint1/init.c:1.58	Sun Jan  3 17:42:45 2021
+++ src/usr.bin/xlint/lint1/init.c	Sun Jan  3 19:10:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.58 2021/01/03 17:42:45 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.59 2021/01/03 19:10:47 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.58 2021/01/03 17:42:45 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.59 2021/01/03 19:10:47 rillig Exp $");
 #endif
 
 #include 
@@ -633,7 +633,7 @@ mkinit(tnode_t *tn)
 	expr(tn, 1, 0, 1);
 	trestor(tmem);
 
-	if (tspec_is_int(lt) && ln->tn_type->t_isfield && !tspec_is_int(rt)) {
+	if (tspec_is_int(lt) && ln->tn_type->t_bitfield && !tspec_is_int(rt)) {
 		/*
 		 * Bit-fields can be initialized in trad. C only by integer
 		 * constants.
@@ -643,7 +643,7 @@ mkinit(tnode_t *tn)
 			warning(186);
 	}
 
-	if (lt != rt || (initstk->i_type->t_isfield && tn->tn_op == CON))
+	if (lt != rt || (initstk->i_type->t_bitfield && tn->tn_op == CON))
 		tn = convert(INIT, 0, initstk->i_type, tn);
 
 	if (tn != NULL && tn->tn_op != CON) {

Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.49 src/usr.bin/xlint/lint1/lint1.h:1.50
--- src/usr.bin/xlint/lint1/lint1.h:1.49	Sun Jan  3 18:48:37 2021
+++ src/usr.bin/xlint/lint1/lint1.h	Sun Jan  3 19:10:47 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.49 2021/01/03 18:48:37 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.50 2021/01/03 19:10:47 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -156,7 +156,7 @@ struct type {
 	bool	t_proto : 1;	/* function prototype (t_args valid) */
 	bool	t_vararg : 1;	/* prototype with ... */
 	bool	t_typedef : 1;	/* type defined with typedef */
-	bool	t_isfield : 1;	/* type is bitfield */
+	bool	t_bitfield : 1;
 	bool	t_isenum : 1;	/* type is (or was) enum (t_enum valid) */
 	bool	t_ispacked : 1;	/* type is packed */
 	union {

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.119 src/usr.bin/xlint/lint1/tree.c:1.120
--- src/usr.bin/xlint/lint1/tree.c:1.119	Sun Jan  3 18:35:51 2021
+

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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 18:48:37 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: Makefile decl.c err.c lint1.h
Added Files:
src/usr.bin/xlint/lint1: Makefile.err-msgs-h

Log Message:
lint: in DEBUG mode, verify printf parameters for messages

Since several years GCC validates printf-style strings, and there is no
reason not to let GCC do that work.  This prevents bugs like the
segmentation fault that was fixed in tree.c 1.109 from 2021-01-01.

By default, lint is compiled with DEBUG off, but it's easy enough to
compile it in debug mode once in a while.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/xlint/lint1/Makefile.err-msgs-h
cvs rdiff -u -r1.106 -r1.107 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.48 -r1.49 src/usr.bin/xlint/lint1/lint1.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.54 src/usr.bin/xlint/lint1/Makefile:1.55
--- src/usr.bin/xlint/lint1/Makefile:1.54	Fri Jan  1 14:51:44 2021
+++ src/usr.bin/xlint/lint1/Makefile	Sun Jan  3 18:48:37 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.54 2021/01/01 14:51:44 rillig Exp $
+#	$NetBSD: Makefile,v 1.55 2021/01/03 18:48:37 rillig Exp $
 
 .include 
 
@@ -38,9 +38,11 @@ LDADD+=		-ll
 DPADD+=		${LIBL}
 .endif
 
+.include "Makefile.err-msgs-h"
 .include "Makefile.ops-h"
 .include "Makefile.ops-c"
 
 .include 
 
 ${SRCS}: ops.h
+${SRCS:Nerr.c}: err-msgs.h

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.106 src/usr.bin/xlint/lint1/decl.c:1.107
--- src/usr.bin/xlint/lint1/decl.c:1.106	Sun Jan  3 17:42:45 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sun Jan  3 18:48:37 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.106 2021/01/03 17:42:45 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.107 2021/01/03 18:48:37 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.106 2021/01/03 17:42:45 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.107 2021/01/03 18:48:37 rillig Exp $");
 #endif
 
 #include 
@@ -3206,7 +3206,7 @@ print_previous_declaration(int msg, sym_
 	cpos = curr_pos;
 	curr_pos = psym->s_def_pos;
 	if (msg != -1) {
-		message(msg);
+		(message)(msg);
 	} else if (psym->s_def == DEF || psym->s_def == TDEF) {
 		/* previous definition of %s */
 		message(261, psym->s_name);

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.63 src/usr.bin/xlint/lint1/err.c:1.64
--- src/usr.bin/xlint/lint1/err.c:1.63	Sun Jan  3 17:42:45 2021
+++ src/usr.bin/xlint/lint1/err.c	Sun Jan  3 18:48:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.63 2021/01/03 17:42:45 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.64 2021/01/03 18:48:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.63 2021/01/03 17:42:45 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.64 2021/01/03 18:48:37 rillig Exp $");
 #endif
 
 #include 
@@ -464,7 +464,7 @@ vwarning(int n, va_list ap)
 }
 
 void
-error(int n, ...)
+(error)(int n, ...)
 {
 	va_list	ap;
 
@@ -502,7 +502,7 @@ assert_failed(const char *file, int line
 }
 
 void
-warning(int n, ...)
+(warning)(int n, ...)
 {
 	va_list	ap;
 
@@ -512,7 +512,7 @@ warning(int n, ...)
 }
 
 void
-message(int n, ...)
+(message)(int n, ...)
 {
 	va_list	ap;
 	const	char *fn;
@@ -535,7 +535,7 @@ message(int n, ...)
  * "right"... [perry, 2 Nov 2002]
 */
 void
-c99ism(int n, ...)
+(c99ism)(int n, ...)
 {
 	va_list	ap;
 	bool extensions_ok = Sflag || gflag;
@@ -550,7 +550,7 @@ c99ism(int n, ...)
 }
 
 void
-gnuism(int n, ...)
+(gnuism)(int n, ...)
 {
 	va_list	ap;
 

Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.48 src/usr.bin/xlint/lint1/lint1.h:1.49
--- src/usr.bin/xlint/lint1/lint1.h:1.48	Sat Jan  2 18:26:44 2021
+++ src/usr.bin/xlint/lint1/lint1.h	Sun Jan  3 18:48:37 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.48 2021/01/02 18:26:44 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.49 2021/01/03 18:48:37 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -33,6 +33,7 @@
  */
 
 #include "lint.h"
+#include "err-msgs.h"
 #include "op.h"
 
 /*
@@ -435,3 +436,26 @@ typedef	struct err_set {
 #endif
 
 extern err_set	msgset;
+
+
+#ifdef DEBUG
+#  include "err-msgs.h"
+
+/* ARGSUSED */
+static inline void __attribute__((format(printf, 1, 2)))
+check_printf(const char *fmt, ...)
+{
+}
+
+#  define wrap_check_printf(func, id, args...)\
+	do {\
+		check_printf(__CONCAT(MSG_, id), ##args);		\
+		(func)(id, ##args);	\
+	} while (/*CONSTCOND*

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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 18:35:51 UTC 2021

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

Log Message:
lint: remove redundant include of externs1.h

It is already included by lint1.h.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/xlint/lint1/print.c
cvs rdiff -u -r1.118 -r1.119 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/print.c
diff -u src/usr.bin/xlint/lint1/print.c:1.7 src/usr.bin/xlint/lint1/print.c:1.8
--- src/usr.bin/xlint/lint1/print.c:1.7	Wed Dec 30 10:56:51 2020
+++ src/usr.bin/xlint/lint1/print.c	Sun Jan  3 18:35:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.7 2020/12/30 10:56:51 rillig Exp $	*/
+/*	$NetBSD: print.c,v 1.8 2021/01/03 18:35:51 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,13 +35,12 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: print.c,v 1.7 2020/12/30 10:56:51 rillig Exp $");
+__RCSID("$NetBSD: print.c,v 1.8 2021/01/03 18:35:51 rillig Exp $");
 #endif
 
 #include 
 
 #include "lint1.h"
-#include "externs1.h"
 
 static const char *str_op_t[] =
 {

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.118 src/usr.bin/xlint/lint1/tree.c:1.119
--- src/usr.bin/xlint/lint1/tree.c:1.118	Sun Jan  3 17:42:45 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Jan  3 18:35:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.118 2021/01/03 17:42:45 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.119 2021/01/03 18:35:51 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.118 2021/01/03 17:42:45 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.119 2021/01/03 18:35:51 rillig Exp $");
 #endif
 
 #include 
@@ -49,7 +49,6 @@ __RCSID("$NetBSD: tree.c,v 1.118 2021/01
 
 #include "lint1.h"
 #include "cgram.h"
-#include "externs1.h"
 
 static	tnode_t	*new_int_const_node(tspec_t, int64_t);
 static	void	check_pointer_comparison(op_t, tnode_t *, tnode_t *);



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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 17:42:45 UTC 2021

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

Log Message:
lint: let gnuism and c99ism return void instead of int

The return value was only used in a single case.  Duplicating the
condition for printing a message is ok in that case, since it makes all
other places in the code simpler.

The occasional "(void)" or "msg = " before the function call had hidden
the calls from check-msgs.lua, which didn't check the message texts in
such cases.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.110 -r1.111 src/usr.bin/xlint/lint1/scan.l
cvs rdiff -u -r1.117 -r1.118 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.105 src/usr.bin/xlint/lint1/decl.c:1.106
--- src/usr.bin/xlint/lint1/decl.c:1.105	Sun Jan  3 17:11:19 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sun Jan  3 17:42:45 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.105 2021/01/03 17:11:19 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.106 2021/01/03 17:42:45 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.105 2021/01/03 17:11:19 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.106 2021/01/03 17:42:45 rillig Exp $");
 #endif
 
 #include 
@@ -317,7 +317,7 @@ add_type(type_t *tp)
 		dcs->d_lmod = NOTSPEC;
 		if (!quadflg)
 			/* %s C does not support 'long long' */
-			(void)c99ism(265, tflag ? "traditional" : "c89");
+			c99ism(265, tflag ? "traditional" : "c89");
 	}
 
 	if (dcs->d_type != NULL && dcs->d_type->t_typedef) {
@@ -1778,8 +1778,8 @@ complete_tag_struct_or_union(type_t *tp,
 		sp->size = dcs->d_offset;
 
 	if (sp->size == 0) {
-		/* zero sized %s */
-		(void)c99ism(47, ttab[t].tt_name);
+		/* zero sized %s is a C9X feature */
+		c99ism(47, ttab[t].tt_name);
 	}
 
 	n = 0;
@@ -2531,7 +2531,8 @@ check_prototype_declaration(sym_t *arg, 
 	if (!eqtype(tp, ptp, 1, 1, &dowarn)) {
 		if (eqtype(tp, ptp, 1, 0, &dowarn)) {
 			/* type does not match prototype: %s */
-			msg = gnuism(58, arg->s_name);
+			gnuism(58, arg->s_name);
+			msg = sflag || !gflag;
 		} else {
 			/* type does not match prototype: %s */
 			error(58, arg->s_name);

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.62 src/usr.bin/xlint/lint1/err.c:1.63
--- src/usr.bin/xlint/lint1/err.c:1.62	Sun Jan  3 16:59:59 2021
+++ src/usr.bin/xlint/lint1/err.c	Sun Jan  3 17:42:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.62 2021/01/03 16:59:59 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.63 2021/01/03 17:42:45 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.62 2021/01/03 16:59:59 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.63 2021/01/03 17:42:45 rillig Exp $");
 #endif
 
 #include 
@@ -534,44 +534,31 @@ message(int n, ...)
  * forward? We need to answer that and then we can fix this to be
  * "right"... [perry, 2 Nov 2002]
 */
-int
+void
 c99ism(int n, ...)
 {
 	va_list	ap;
-	int	msg;
+	bool extensions_ok = Sflag || gflag;
 
 	va_start(ap, n);
-	if (sflag && !(Sflag || gflag)) {
+	if (sflag && !extensions_ok) {
 		verror(n, ap);
-		msg = 1;
-	} else if (!sflag && (Sflag || gflag)) {
-		msg = 0;
-	} else {
+	} else if (sflag || !extensions_ok) {
 		vwarning(n, ap);
-		msg = 1;
 	}
 	va_end(ap);
-
-	return msg;
 }
 
-int
+void
 gnuism(int n, ...)
 {
 	va_list	ap;
-	int	msg;
 
 	va_start(ap, n);
 	if (sflag && !gflag) {
 		verror(n, ap);
-		msg = 1;
-	} else if (!sflag && gflag) {
-		msg = 0;
-	} else {
+	} else if (sflag || !gflag) {
 		vwarning(n, ap);
-		msg = 1;
 	}
 	va_end(ap);
-
-	return msg;
 }

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.44 src/usr.bin/xlint/lint1/externs1.h:1.45
--- src/usr.bin/xlint/lint1/externs1.h:1.44	Sat Jan  2 18:44:58 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sun Jan  3 17:42:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.44 2021/01/02 18:44:58 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.45 2021/01/03 17:42:45 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -123,8 +123,8 @@ extern	void	msglist(void);
 extern	void	error(int, ...);
 extern	void	warning(int, ...);
 extern	void	message(int, ...);
-extern	int	gnuism(int, ...);
-extern	int	c99ism(int, ...);
+extern	void	gnuism(int, ...);
+extern	void	c99ism(int, ...);
 extern	void	lerror(const char *, int, const char *, ...)
 

CVS commit: src/sys/arch/atari

2021-01-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan  3 17:42:10 UTC 2021

Modified Files:
src/sys/arch/atari/atari: autoconf.c be_bus.c bus.c intr.c le_bus.c
machdep.c mainbus.c
src/sys/arch/atari/dev: hdfd.c ite.c md_root.c zs.c
src/sys/arch/atari/pci: pci_machdep.c

Log Message:
malloc(9) -> kmem(9)


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/atari/atari/autoconf.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/atari/atari/be_bus.c
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/atari/atari/bus.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/atari/atari/intr.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/atari/atari/le_bus.c
cvs rdiff -u -r1.183 -r1.184 src/sys/arch/atari/atari/machdep.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/atari/atari/mainbus.c
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/atari/dev/hdfd.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/atari/dev/ite.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/atari/dev/md_root.c
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/atari/dev/zs.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/atari/pci/pci_machdep.c

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

Modified files:

Index: src/sys/arch/atari/atari/autoconf.c
diff -u src/sys/arch/atari/atari/autoconf.c:1.67 src/sys/arch/atari/atari/autoconf.c:1.68
--- src/sys/arch/atari/atari/autoconf.c:1.67	Sat Jun 29 16:41:18 2019
+++ src/sys/arch/atari/atari/autoconf.c	Sun Jan  3 17:42:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.67 2019/06/29 16:41:18 tsutsui Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.68 2021/01/03 17:42:10 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.67 2019/06/29 16:41:18 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.68 2021/01/03 17:42:10 thorpej Exp $");
 
 #include "opt_md.h"
 
@@ -43,7 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -105,8 +105,7 @@ cpu_rootconf(void)
 		md_major = devsw_name2blk("md", NULL, 0);
 		if (md_major >= 0) {
 			for (i = 0; i < RAMD_NDEV; i++) {
-cf = malloc(sizeof(*cf), M_DEVBUF,
-M_ZERO|M_WAITOK);
+cf = kmem_zalloc(sizeof(*cf), KM_SLEEP);
 if (cf == NULL)
 	break;	/* XXX */
 cf->cf_name = md_cd.cd_name;

Index: src/sys/arch/atari/atari/be_bus.c
diff -u src/sys/arch/atari/atari/be_bus.c:1.16 src/sys/arch/atari/atari/be_bus.c:1.17
--- src/sys/arch/atari/atari/be_bus.c:1.16	Sun Nov 10 21:16:25 2019
+++ src/sys/arch/atari/atari/be_bus.c	Sun Jan  3 17:42:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: be_bus.c,v 1.16 2019/11/10 21:16:25 chs Exp $	*/
+/*	$NetBSD: be_bus.c,v 1.17 2021/01/03 17:42:10 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,12 +30,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: be_bus.c,v 1.16 2019/11/10 21:16:25 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: be_bus.c,v 1.17 2021/01/03 17:42:10 thorpej Exp $");
 
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -178,12 +178,12 @@ beb_alloc_bus_space_tag(bus_space_tag_t 
 
 	/*
 	 * Allow the caller to specify storage space for the tag. This
-	 * is used during console config (when malloc() can't be used).
+	 * is used during console config (when kmem_alloc() can't be used).
 	 */
 	if (storage != NULL)
 		beb_t = storage;
 	else {
-		beb_t = malloc(sizeof(*beb_t), M_TEMP, M_WAITOK);
+		beb_t = kmem_alloc(sizeof(*beb_t), KM_SLEEP);
 	}
 	memset(beb_t, 0, sizeof(*beb_t));
 	

Index: src/sys/arch/atari/atari/bus.c
diff -u src/sys/arch/atari/atari/bus.c:1.60 src/sys/arch/atari/atari/bus.c:1.61
--- src/sys/arch/atari/atari/bus.c:1.60	Sat Mar 10 03:44:43 2018
+++ src/sys/arch/atari/atari/bus.c	Sun Jan  3 17:42:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.60 2018/03/10 03:44:43 tsutsui Exp $	*/
+/*	$NetBSD: bus.c,v 1.61 2021/01/03 17:42:10 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -33,12 +33,12 @@
 #include "opt_m68k_arch.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.60 2018/03/10 03:44:43 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.61 2021/01/03 17:42:10 thorpej Exp $");
 
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -330,6 +330,14 @@ bus_space_mmap(bus_space_tag_t t, bus_ad
 	return m68k_btop(addr + off);
 }
 
+static size_t
+_bus_dmamap_mapsize(int const nsegments)
+{
+	KASSERT(nsegments > 0); 
+	return sizeof(struct atari_bus_dmamap) +
+	(sizeof(bus_dma_segment_t) * (nsegments - 1));
+}
+
 /*
  * Common function for DMA map creation.  May be called by bus-specific
  * DMA map creation functions.
@@ -340,7 +348,6 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 {
 	struct atari_bus_dmamap *map;
 	void *mapstore;
-	size_t mapsize;
 
 	/*
 	 * Allocate and initialize the DMA map.  The end of the map
@@ -354,13 +361,10 @@ _bus

CVS commit: src/sys/arch/shark/shark

2021-01-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan  3 17:28:33 UTC 2021

Modified Files:
src/sys/arch/shark/shark: opms.c

Log Message:
Use sel{record,remove}_knote().


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/shark/shark/opms.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/shark/shark/opms.c
diff -u src/sys/arch/shark/shark/opms.c:1.30 src/sys/arch/shark/shark/opms.c:1.31
--- src/sys/arch/shark/shark/opms.c:1.30	Wed Jul 22 01:24:40 2020
+++ src/sys/arch/shark/shark/opms.c	Sun Jan  3 17:28:33 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: opms.c,v 1.30 2020/07/22 01:24:40 msaitoh Exp $*/
+/*  $NetBSD: opms.c,v 1.31 2021/01/03 17:28:33 thorpej Exp $*/
 
 /*
  * Copyright 1997
@@ -91,7 +91,7 @@
 */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: opms.c,v 1.30 2020/07/22 01:24:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: opms.c,v 1.31 2021/01/03 17:28:33 thorpej Exp $");
 
 #include "opms.h"
 #if NOPMS > 1
@@ -966,7 +966,7 @@ filt_opmsrdetach(struct knote *kn)
 	int s;
 
 	s = spltty();
-	SLIST_REMOVE(&sc->sc_rsel.sel_klist, kn, knote, kn_selnext);
+	selremove_knote(&sc->sc_rsel, kn);
 	splx(s);
 }
 
@@ -990,12 +990,10 @@ int
 opmskqfilter(dev_t dev, struct knote *kn)
 {
 	struct opms_softc *sc = device_lookup_private(&opms_cd, PMSUNIT(dev));
-	struct klist *klist;
 	int s;
 
 	switch (kn->kn_filter) {
 	case EVFILT_READ:
-		klist = &sc->sc_rsel.sel_klist;
 		kn->kn_fop = &opmsread_filtops;
 		break;
 
@@ -1006,7 +1004,7 @@ opmskqfilter(dev_t dev, struct knote *kn
 	kn->kn_hook = sc;
 
 	s = spltty();
-	SLIST_INSERT_HEAD(klist, kn, kn_selnext);
+	selrecord_knote(&sc->sc_rsel, kn);
 	splx(s);
 
 	return (0);



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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 17:11:19 UTC 2021

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

Log Message:
lint: separate error and warning for 27 and 58

Even though this results in more lines of code, the benefit is that the
message text in the comment is verified by check-msgs.lua.  The code is
also easier to read, the parentheses and asterisk were not needed.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 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.104 src/usr.bin/xlint/lint1/decl.c:1.105
--- src/usr.bin/xlint/lint1/decl.c:1.104	Sun Jan  3 16:59:59 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sun Jan  3 17:11:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.104 2021/01/03 16:59:59 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.105 2021/01/03 17:11:19 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.104 2021/01/03 16:59:59 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.105 2021/01/03 17:11:19 rillig Exp $");
 #endif
 
 #include 
@@ -1923,8 +1923,12 @@ decl1ext(sym_t *dsym, int initflg)
 		if (!redec && !check_redeclaration(dsym, (dowarn = 0, &dowarn))) {
 
 			if (dowarn) {
-/* redeclaration of %s */
-(*(sflag ? error : warning))(27, dsym->s_name);
+if (sflag)
+	/* redeclaration of %s */
+	error(27, dsym->s_name);
+else
+	/* redeclaration of %s */
+	warning(27, dsym->s_name);
 print_previous_declaration(-1, rdsym);
 			}
 
@@ -2534,8 +2538,12 @@ check_prototype_declaration(sym_t *arg, 
 			msg = 1;
 		}
 	} else if (dowarn) {
-		/* type does not match prototype: %s */
-		(*(sflag ? error : warning))(58, arg->s_name);
+		if (sflag)
+			/* type does not match prototype: %s */
+			error(58, arg->s_name);
+		else
+			/* type does not match prototype: %s */
+			warning(58, arg->s_name);
 		msg = 1;
 	}
 



CVS commit: src

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 16:59:59 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_004.exp msg_035.exp msg_308.exp
src/usr.bin/xlint/lint1: decl.c err.c

Log Message:
lint: fix spelling of message 308

All other messages are lowercase as well.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_004.exp
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_035.exp
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_308.exp
cvs rdiff -u -r1.103 -r1.104 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/xlint/lint1/err.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/msg_004.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_004.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_004.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_004.exp:1.2	Sat Jan  2 18:06:01 2021
+++ src/tests/usr.bin/xlint/lint1/msg_004.exp	Sun Jan  3 16:59:59 2021
@@ -1,4 +1,4 @@
-msg_004.c(13): Invalid type for _Complex [308]
+msg_004.c(13): invalid type for _Complex [308]
 msg_004.c(13): illegal type combination [4]
 msg_004.c(17): illegal type combination [4]
 msg_004.c(21): illegal type combination [4]

Index: src/tests/usr.bin/xlint/lint1/msg_035.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_035.exp:1.5 src/tests/usr.bin/xlint/lint1/msg_035.exp:1.6
--- src/tests/usr.bin/xlint/lint1/msg_035.exp:1.5	Sat Jan  2 17:17:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_035.exp	Sun Jan  3 16:59:59 2021
@@ -12,7 +12,7 @@ msg_035.c(52): warning: illegal bit-fiel
 msg_035.c(54): warning: illegal bit-field type [35]
 msg_035.c(55): warning: illegal bit-field type [35]
 msg_035.c(56): warning: illegal bit-field type [35]
-msg_035.c(57): Invalid type for _Complex [308]
+msg_035.c(57): invalid type for _Complex [308]
 msg_035.c(57): warning: illegal bit-field type [35]
 msg_035.c(58): warning: illegal bit-field type [35]
 msg_035.c(59): warning: illegal bit-field type [35]

Index: src/tests/usr.bin/xlint/lint1/msg_308.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_308.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_308.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_308.exp:1.3	Sat Jan  2 17:17:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_308.exp	Sun Jan  3 16:59:59 2021
@@ -1,3 +1,3 @@
-msg_308.c(9): Invalid type for _Complex [308]
-msg_308.c(10): Invalid type for _Complex [308]
+msg_308.c(9): invalid type for _Complex [308]
+msg_308.c(10): invalid type for _Complex [308]
 msg_308.c(10): illegal type combination [4]

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.103 src/usr.bin/xlint/lint1/decl.c:1.104
--- src/usr.bin/xlint/lint1/decl.c:1.103	Sat Jan  2 18:44:58 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sun Jan  3 16:59:59 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.103 2021/01/02 18:44:58 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.104 2021/01/03 16:59: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.103 2021/01/02 18:44:58 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.104 2021/01/03 16:59:59 rillig Exp $");
 #endif
 
 #include 
@@ -304,7 +304,7 @@ add_type(type_t *tp)
 		else if (dcs->d_cmod == DOUBLE)
 			t = DCOMPLEX;
 		else {
-			/* Invalid type for _Complex */
+			/* invalid type for _Complex */
 			error(308);
 			t = DCOMPLEX; /* just as a fallback */
 		}

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.61 src/usr.bin/xlint/lint1/err.c:1.62
--- src/usr.bin/xlint/lint1/err.c:1.61	Sun Jan  3 15:51:16 2021
+++ src/usr.bin/xlint/lint1/err.c	Sun Jan  3 16:59:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.61 2021/01/03 15:51:16 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.62 2021/01/03 16:59:59 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.61 2021/01/03 15:51:16 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.62 2021/01/03 16:59:59 rillig Exp $");
 #endif
 
 #include 
@@ -367,7 +367,7 @@ const	char *msgs[] = {
 	"ANSI C forbids conversion of %s to %s, op %s",		  /* 305 */
 	"constant truncated by conversion, op %s",		  /* 306 */
 	"static variable %s set but not used",			  /* 307 */
-	"Invalid type for _Complex",  /* 308 */
+	"invalid type for _Complex",  /* 308 */
 	"extra bits set to 0 in conversion of '%s' to '%s', op %s",   /* 309 */
 	"symbol renaming can't be used on function arguments",	  /* 310 */
 	"symbol renaming can't be used on automatic variables",	  /* 311 */



CVS commit: [thorpej-futex] src/distrib/sets/lists

2021-01-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan  3 16:49:32 UTC 2021

Modified Files:
src/distrib/sets/lists/base [thorpej-futex]: mi
src/distrib/sets/lists/comp [thorpej-futex]: mi
src/distrib/sets/lists/debug [thorpej-futex]: mi
src/distrib/sets/lists/dtb [thorpej-futex]: ad.aarch64 ad.aarch64eb
src/distrib/sets/lists/games [thorpej-futex]: mi
src/distrib/sets/lists/man [thorpej-futex]: mi
src/distrib/sets/lists/tests [thorpej-futex]: mi
src/distrib/sets/lists/xbase [thorpej-futex]: mi
src/distrib/sets/lists/xdebug [thorpej-futex]: mi

Log Message:
Sync w/ HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.1272 -r1.1272.2.1 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.2367 -r1.2367.2.1 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.344 -r1.344.2.1 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.3 -r1.3.2.1 src/distrib/sets/lists/dtb/ad.aarch64
cvs rdiff -u -r1.2 -r1.2.2.1 src/distrib/sets/lists/dtb/ad.aarch64eb
cvs rdiff -u -r1.59 -r1.59.2.1 src/distrib/sets/lists/games/mi
cvs rdiff -u -r1.1711 -r1.1711.2.1 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.993 -r1.993.2.1 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.163 -r1.163.2.1 src/distrib/sets/lists/xbase/mi
cvs rdiff -u -r1.39 -r1.39.2.1 src/distrib/sets/lists/xdebug/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1272 src/distrib/sets/lists/base/mi:1.1272.2.1
--- src/distrib/sets/lists/base/mi:1.1272	Mon Nov 23 12:41:47 2020
+++ src/distrib/sets/lists/base/mi	Sun Jan  3 16:49:31 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1272 2020/11/23 12:41:47 martin Exp $
+# $NetBSD: mi,v 1.1272.2.1 2021/01/03 16:49:31 thorpej Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -951,6 +951,7 @@
 ./usr/bin/renicebase-util-bin
 ./usr/bin/reset	base-util-bin
 ./usr/bin/rev	base-util-bin
+./usr/bin/resizebase-util-bin
 ./usr/bin/revokebase-util-bin
 ./usr/bin/rfcomm_sppdbase-util-bin
 ./usr/bin/rlog	base-rcs-bin

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2367 src/distrib/sets/lists/comp/mi:1.2367.2.1
--- src/distrib/sets/lists/comp/mi:1.2367	Fri Dec  4 18:27:18 2020
+++ src/distrib/sets/lists/comp/mi	Sun Jan  3 16:49:31 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2367 2020/12/04 18:27:18 christos Exp $
+#	$NetBSD: mi,v 1.2367.2.1 2021/01/03 16:49:31 thorpej Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -3074,6 +3074,7 @@
 ./usr/include/sys/errno.h			comp-c-include
 ./usr/include/sys/evcnt.h			comp-c-include
 ./usr/include/sys/event.h			comp-c-include
+./usr/include/sys/eventfd.h			comp-c-include
 ./usr/include/sys/exec.h			comp-c-include
 ./usr/include/sys/exec_aout.h			comp-c-include
 ./usr/include/sys/exec_coff.h			comp-c-include
@@ -3225,6 +3226,7 @@
 ./usr/include/sys/time.h			comp-c-include
 ./usr/include/sys/timeb.h			comp-c-include
 ./usr/include/sys/timepps.h			comp-c-include
+./usr/include/sys/timerfd.h			comp-c-include
 ./usr/include/sys/times.h			comp-c-include
 ./usr/include/sys/timespec.h			comp-c-include
 ./usr/include/sys/timex.h			comp-c-include

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.344 src/distrib/sets/lists/debug/mi:1.344.2.1
--- src/distrib/sets/lists/debug/mi:1.344	Sat Dec 12 03:03:14 2020
+++ src/distrib/sets/lists/debug/mi	Sun Jan  3 16:49:31 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.344 2020/12/12 03:03:14 pgoyette Exp $
+# $NetBSD: mi,v 1.344.2.1 2021/01/03 16:49:31 thorpej Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -750,6 +750,7 @@
 ./usr/libdata/debug/usr/bin/quota.debug		comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/radioctl.debug	comp-audio-debug	debug
 ./usr/libdata/debug/usr/bin/ranlib.debug	comp-util-debug		binutils,debug
+./usr/libdata/debug/usr/bin/resize.debug	comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/rcs.debug		comp-rcs-debug		debug
 ./usr/libdata/debug/usr/bin/rcsclean.debug	comp-rcs-debug		debug
 ./usr/libdata/debug/usr/bin/rcsdiff.debug	comp-rcs-debug		debug
@@ -936,6 +937,7 @@
 ./usr/libdata/debug/usr/games/snscore.debug	comp-games-debug	debug
 ./usr/libdata/debug/usr/games/strfile.debug	comp-utils-debug	debug
 ./usr/libdata/debug/usr/games/teachgammon.debug	comp-games-debug	debug
+./usr/libdata/debug/usr/games/testpat.debug	comp-games-debug	debug
 ./usr/libdata/debug/usr/games/tetris.debug	comp-games-debug	debug
 ./usr/libdata/debug/usr/games/trek.debug	comp-games-debug	debug
 ./usr/libdata/debug/usr/games/unstr.debug	comp-utils-debug	debug
@@ -2145,6 +2147,7 @@
 ./us

CVS commit: [thorpej-futex] src/sys

2021-01-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan  3 16:35:05 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64 [thorpej-futex]: bus_space.c cpuswitch.S
locore.S locore_el2.S pmap.c
src/sys/arch/alpha/alpha [thorpej-futex]: pmap.c
src/sys/arch/amiga/dev [thorpej-futex]: event.c
src/sys/arch/arc/dev [thorpej-futex]: opms.c
src/sys/arch/arm/acpi [thorpej-futex]: gicv3_acpi.c
src/sys/arch/arm/amlogic [thorpej-futex]: files.meson meson_clk.h
meson_clk_pll.c meson_dwmac.c meson_pinctrl.c meson_pinctrl.h
meson_resets.c mesongx_mmc.c
src/sys/arch/arm/arm [thorpej-futex]: efi_runtime.c
src/sys/arch/arm/arm32 [thorpej-futex]: bus_dma.c
src/sys/arch/arm/broadcom [thorpej-futex]: bcm2835_bsc_fdt.c
bcm2835_intr.c
src/sys/arch/arm/cortex [thorpej-futex]: gicv3.c gicv3_its.c
src/sys/arch/arm/dts [thorpej-futex]: rk3328-rock64.dts
src/sys/arch/arm/fdt [thorpej-futex]: arm_fdt.c
src/sys/arch/arm/imx [thorpej-futex]: if_enet.c imxusb.c
src/sys/arch/arm/nvidia [thorpej-futex]: tegra_ahcisata.c tegra_i2c.c
src/sys/arch/arm/rockchip [thorpej-futex]: rk3328_cru.c rk3328_cru.h
rk_i2c.c rk_i2s.c
src/sys/arch/arm/samsung [thorpej-futex]: exynos_i2c.c
src/sys/arch/arm/sociox [thorpej-futex]: sni_i2c.c
src/sys/arch/arm/sunxi [thorpej-futex]: sunxi_rsb.c sunxi_twi.c
src/sys/arch/arm/ti [thorpej-futex]: ti_iic.c
src/sys/arch/atari/dev [thorpej-futex]: event.c
src/sys/arch/evbarm/conf [thorpej-futex]: GENERIC GENERIC.common
GENERIC64 files.generic files.generic64
src/sys/arch/evbarm/evbarm [thorpej-futex]: autoconf.c
src/sys/arch/evbarm/fdt [thorpej-futex]: fdt_machdep.c
src/sys/arch/hp300/dev [thorpej-futex]: dcm.c dnkbd.c hil_intio.c
sti_sgc.c
src/sys/arch/landisk/dev [thorpej-futex]: button.c
src/sys/arch/landisk/landisk [thorpej-futex]: bus_dma.c intr.c
src/sys/arch/luna68k/dev [thorpej-futex]: lcd.c siotty.c xp.c
src/sys/arch/luna68k/luna68k [thorpej-futex]: isr.c
src/sys/arch/m68k [thorpej-futex]: Makefile.cmachflags
src/sys/arch/m68k/include [thorpej-futex]: pmap_coldfire.h
src/sys/arch/m68k/m68k [thorpej-futex]: bus_dma.c
src/sys/arch/mac68k/dev [thorpej-futex]: aed.c macfb.c
src/sys/arch/mac68k/nubus [thorpej-futex]: cpi_nubus.c
src/sys/arch/mac68k/obio [thorpej-futex]: iwm_fd.c
src/sys/arch/macppc/dev [thorpej-futex]: aed.c apm.c
src/sys/arch/mips/include [thorpej-futex]: pmap.h
src/sys/arch/mips/mips [thorpej-futex]: pmap_machdep.c
src/sys/arch/powerpc/booke [thorpej-futex]: booke_pmap.c
src/sys/arch/powerpc/include/booke [thorpej-futex]: pmap.h
src/sys/arch/riscv/include [thorpej-futex]: pmap.h sysreg.h
src/sys/arch/riscv/riscv [thorpej-futex]: trap.c
src/sys/arch/sparc/include [thorpej-futex]: pmap.h
src/sys/arch/sparc64/dev [thorpej-futex]: pcf8591_envctrl.c
src/sys/arch/sparc64/sparc64 [thorpej-futex]: locore.s ofw_patch.c
src/sys/arch/x68k/dev [thorpej-futex]: event.c
src/sys/coda [thorpej-futex]: coda_psdev.c
src/sys/compat/common [thorpej-futex]: bio_30.c
src/sys/conf [thorpej-futex]: copyright
src/sys/ddb [thorpej-futex]: TODO
src/sys/dev [thorpej-futex]: bio.c fss.c midi.c sequencer.c
src/sys/dev/apm [thorpej-futex]: apm.c
src/sys/dev/ata [thorpej-futex]: ata_subr.c ata_wdc.c satareg.h
src/sys/dev/audio [thorpej-futex]: audio.c
src/sys/dev/fdt [thorpej-futex]: dwiic_fdt.c fdt_gpio.c fdt_i2c.c
fdtvar.h files.fdt
src/sys/dev/hdaudio [thorpej-futex]: hdaudio.c
src/sys/dev/hpc/apm [thorpej-futex]: apmdev.c
src/sys/dev/i2c [thorpej-futex]: em3027.c files.i2c i2cvar.h motoi2c.c
pcf8574.c tcakp.c
src/sys/dev/ic [thorpej-futex]: ahcisata_core.c ahcisatavar.h
dwc_gmac.c mvsata.c nvme.c siisata.c sti.c stivar.h
src/sys/dev/ir [thorpej-futex]: irframe_tty.c
src/sys/dev/ofw [thorpej-futex]: ofw_subr.c openfirm.h
src/sys/dev/pci [thorpej-futex]: aceride.c ahcisata_pci.c oboe.c
pci_map.c pciconf.c pcidevs pcidevs.h pcidevs_data.h pcireg.h
vio9p.c
src/sys/dev/pci/ixgbe [thorpej-futex]: ixgbe.c ixgbe.h ixgbe_type.h
src/sys/dev/putter [thorpej-futex]: putter.c
src/sys/dev/qbus [thorpej-futex]: qd.c
src/sys/dev/sbus [thorpej-futex]: bpp.c
src/sys/dev/scsipi [thorpej-futex]: ch.c
src/sys/dev/sun [thorpej-futex]: event.c
src/sys/dev/sysmon [thorpej-futex]: sysmon_power.c
src/sys/dev/usb [thorpej-futex]: ehci.c ohci.c uaudio.c udsir.c ugen.c
uhci.c uhid.c uirda.c usb.c usb_mem.c usb_mem.h usb_quirks.c
usbde

CVS commit: [thorpej-futex] src/sys/compat/linux32/common

2021-01-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan  3 16:14:04 UTC 2021

Modified Files:
src/sys/compat/linux32/common [thorpej-futex]: linux32_ioctl.c

Log Message:
Handle timerfd ioctls.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.8.1 src/sys/compat/linux32/common/linux32_ioctl.c

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

Modified files:

Index: src/sys/compat/linux32/common/linux32_ioctl.c
diff -u src/sys/compat/linux32/common/linux32_ioctl.c:1.14 src/sys/compat/linux32/common/linux32_ioctl.c:1.14.8.1
--- src/sys/compat/linux32/common/linux32_ioctl.c:1.14	Fri Aug 23 12:49:59 2019
+++ src/sys/compat/linux32/common/linux32_ioctl.c	Sun Jan  3 16:14:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_ioctl.c,v 1.14 2019/08/23 12:49:59 maxv Exp $ */
+/*	$NetBSD: linux32_ioctl.c,v 1.14.8.1 2021/01/03 16:14:04 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -32,13 +32,15 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux32_ioctl.c,v 1.14 2019/08/23 12:49:59 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_ioctl.c,v 1.14.8.1 2021/01/03 16:14:04 thorpej Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include  
 
 #include 
 #include 
@@ -46,6 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_ioct
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -80,8 +83,31 @@ linux32_sys_ioctl(struct lwp *l, const s
 
 	switch(group) {
 	case 'T':
-		error = linux32_ioctl_termios(l, uap, retval);
+	{
+		/*
+		 * Termios, the MIDI sequencer, and timerfd use 'T' to
+		 * identify the ioctl, so we have to differentiate them
+		 * in another way.
+		 *
+		 * (XXX We don't bother with MIDI here.)
+		 */
+		struct file *fp;
+
+		if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
+			return EBADF;
+
+		if (fp->f_type == DTYPE_TIMERFD) {
+			struct linux_sys_ioctl_args ua;
+			SCARG(&ua, fd) = SCARG(uap, fd);
+			SCARG(&ua, com) = SCARG(uap, com);
+			SCARG(&ua, data) = SCARG_P32(uap, data);
+			error = linux_ioctl_timerfd(l, &ua, retval);
+		} else {
+			error = linux32_ioctl_termios(l, uap, retval);
+		}
+		fd_putfile(SCARG(uap, fd));
 		break;
+	}
 	case 'M':
 	case 'Q':
 	case 'P':



CVS commit: [thorpej-futex] src/sys/compat/linux32/arch/amd64

2021-01-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan  3 16:13:07 UTC 2021

Modified Files:
src/sys/compat/linux32/arch/amd64 [thorpej-futex]: linux32_syscall.h
linux32_syscallargs.h linux32_syscalls.c linux32_sysent.c
linux32_systrace_args.c

Log Message:
Regen for preadv(2) and pwritev(2).


To generate a diff of this commit:
cvs rdiff -u -r1.81.2.2 -r1.81.2.3 \
src/sys/compat/linux32/arch/amd64/linux32_syscall.h \
src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h \
src/sys/compat/linux32/arch/amd64/linux32_syscalls.c \
src/sys/compat/linux32/arch/amd64/linux32_sysent.c
cvs rdiff -u -r1.8.2.2 -r1.8.2.3 \
src/sys/compat/linux32/arch/amd64/linux32_systrace_args.c

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

Modified files:

Index: src/sys/compat/linux32/arch/amd64/linux32_syscall.h
diff -u src/sys/compat/linux32/arch/amd64/linux32_syscall.h:1.81.2.2 src/sys/compat/linux32/arch/amd64/linux32_syscall.h:1.81.2.3
--- src/sys/compat/linux32/arch/amd64/linux32_syscall.h:1.81.2.2	Thu Dec 17 03:05:50 2020
+++ src/sys/compat/linux32/arch/amd64/linux32_syscall.h	Sun Jan  3 16:13:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_syscall.h,v 1.81.2.2 2020/12/17 03:05:50 thorpej Exp $ */
+/* $NetBSD: linux32_syscall.h,v 1.81.2.3 2021/01/03 16:13:07 thorpej Exp $ */
 
 /*
  * System call numbers.
@@ -741,6 +741,12 @@
 /* syscall: "pipe2" ret: "int" args: "netbsd32_intp" "int" */
 #define	LINUX32_SYS_pipe2	331
 
+/* syscall: "preadv" ret: "int" args: "int" "const netbsd32_iovecp_t" "int" "netbsd32_u_long" "netbsd32_u_long" */
+#define	LINUX32_SYS_preadv	333
+
+/* syscall: "pwritev" ret: "int" args: "int" "const netbsd32_iovecp_t" "int" "netbsd32_u_long" "netbsd32_u_long" */
+#define	LINUX32_SYS_pwritev	334
+
 #define	LINUX32_SYS_MAXSYSCALL	351
 #define	LINUX32_SYS_NSYSENT	512
 #endif /* _LINUX32_SYS_SYSCALL_H_ */
Index: src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h
diff -u src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h:1.81.2.2 src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h:1.81.2.3
--- src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h:1.81.2.2	Thu Dec 17 03:05:50 2020
+++ src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h	Sun Jan  3 16:13:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_syscallargs.h,v 1.81.2.2 2020/12/17 03:05:50 thorpej Exp $ */
+/* $NetBSD: linux32_syscallargs.h,v 1.81.2.3 2021/01/03 16:13:07 thorpej Exp $ */
 
 /*
  * System call argument lists.
@@ -1077,6 +1077,24 @@ struct linux32_sys_pipe2_args {
 };
 check_syscall_args(linux32_sys_pipe2)
 
+struct linux32_sys_preadv_args {
+	syscallarg(int) fd;
+	syscallarg(const netbsd32_iovecp_t) iovp;
+	syscallarg(int) iovcnt;
+	syscallarg(netbsd32_u_long) off_lo;
+	syscallarg(netbsd32_u_long) off_hi;
+};
+check_syscall_args(linux32_sys_preadv)
+
+struct linux32_sys_pwritev_args {
+	syscallarg(int) fd;
+	syscallarg(const netbsd32_iovecp_t) iovp;
+	syscallarg(int) iovcnt;
+	syscallarg(netbsd32_u_long) off_lo;
+	syscallarg(netbsd32_u_long) off_hi;
+};
+check_syscall_args(linux32_sys_pwritev)
+
 /*
  * System call prototypes.
  */
@@ -1545,4 +1563,8 @@ int	linux32_sys_dup3(struct lwp *, const
 
 int	linux32_sys_pipe2(struct lwp *, const struct linux32_sys_pipe2_args *, register_t *);
 
+int	linux32_sys_preadv(struct lwp *, const struct linux32_sys_preadv_args *, register_t *);
+
+int	linux32_sys_pwritev(struct lwp *, const struct linux32_sys_pwritev_args *, register_t *);
+
 #endif /* _LINUX32_SYS_SYSCALLARGS_H_ */
Index: src/sys/compat/linux32/arch/amd64/linux32_syscalls.c
diff -u src/sys/compat/linux32/arch/amd64/linux32_syscalls.c:1.81.2.2 src/sys/compat/linux32/arch/amd64/linux32_syscalls.c:1.81.2.3
--- src/sys/compat/linux32/arch/amd64/linux32_syscalls.c:1.81.2.2	Thu Dec 17 03:05:50 2020
+++ src/sys/compat/linux32/arch/amd64/linux32_syscalls.c	Sun Jan  3 16:13:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_syscalls.c,v 1.81.2.2 2020/12/17 03:05:50 thorpej Exp $ */
+/* $NetBSD: linux32_syscalls.c,v 1.81.2.3 2021/01/03 16:13:07 thorpej Exp $ */
 
 /*
  * System call names.
@@ -8,7 +8,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux32_syscalls.c,v 1.81.2.2 2020/12/17 03:05:50 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_syscalls.c,v 1.81.2.3 2021/01/03 16:13:07 thorpej Exp $");
 
 #if defined(_KERNEL_OPT)
 #include 
@@ -372,8 +372,8 @@ const char *const linux32_syscallnames[]
 	/* 330 */	"dup3",
 	/* 331 */	"pipe2",
 	/* 332 */	"#332 (unimplemented inotify_init1)",
-	/* 333 */	"#333 (unimplemented preadv)",
-	/* 334 */	"#334 (unimplemented pwritev)",
+	/* 333 */	"preadv",
+	/* 334 */	"pwritev",
 	/* 335 */	"#335 (unimplemented rt_tgsigqueueinfo)",
 	/* 336 */	"#336 (unimplemented perf_counter_open)",
 	/* 337 */	"#337 (unimplemented recvmmsg)",
@@ -891,8 +891,8 @@ const char *const altlinux32_syscallname
 	/* 330 */	NULL, /* dup3 */
 	/* 331 */	NULL, /* pipe2 */
 	/* 332 */	NUL

CVS commit: [thorpej-futex] src/sys/compat/linux32

2021-01-03 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan  3 16:12:44 UTC 2021

Modified Files:
src/sys/compat/linux32/arch/amd64 [thorpej-futex]: syscalls.master
src/sys/compat/linux32/common [thorpej-futex]: linux32_misc.c

Log Message:
Add preadv(2) and pwritev(2).


To generate a diff of this commit:
cvs rdiff -u -r1.71.2.2 -r1.71.2.3 \
src/sys/compat/linux32/arch/amd64/syscalls.master
cvs rdiff -u -r1.30.2.2 -r1.30.2.3 \
src/sys/compat/linux32/common/linux32_misc.c

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

Modified files:

Index: src/sys/compat/linux32/arch/amd64/syscalls.master
diff -u src/sys/compat/linux32/arch/amd64/syscalls.master:1.71.2.2 src/sys/compat/linux32/arch/amd64/syscalls.master:1.71.2.3
--- src/sys/compat/linux32/arch/amd64/syscalls.master:1.71.2.2	Thu Dec 17 03:05:32 2020
+++ src/sys/compat/linux32/arch/amd64/syscalls.master	Sun Jan  3 16:12:43 2021
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.71.2.2 2020/12/17 03:05:32 thorpej Exp $
+	$NetBSD: syscalls.master,v 1.71.2.3 2021/01/03 16:12:43 thorpej Exp $
 
 ; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file.
 ; (See syscalls.conf to see what it is processed into.)
@@ -567,8 +567,12 @@
 330	STD	{ int|linux32_sys||dup3(int from, int to, int flags); }
 331 STD	{ int|linux32_sys||pipe2(netbsd32_intp fd, int flags); }
 332	UNIMPL	inotify_init1
-333	UNIMPL	preadv
-334	UNIMPL	pwritev
+333	STD	{ int|linux32_sys||preadv(int fd, \
+		const netbsd32_iovecp_t iovp, int iovcnt, \
+		netbsd32_u_long off_lo, netbsd32_u_long off_hi); }
+334	STD	{ int|linux32_sys||pwritev(int fd, \
+		const netbsd32_iovecp_t iovp, int iovcnt, \
+		netbsd32_u_long off_lo, netbsd32_u_long off_hi); }
 335	UNIMPL	rt_tgsigqueueinfo
 336	UNIMPL	perf_counter_open
 337	UNIMPL	recvmmsg

Index: src/sys/compat/linux32/common/linux32_misc.c
diff -u src/sys/compat/linux32/common/linux32_misc.c:1.30.2.2 src/sys/compat/linux32/common/linux32_misc.c:1.30.2.3
--- src/sys/compat/linux32/common/linux32_misc.c:1.30.2.2	Thu Dec 17 03:02:06 2020
+++ src/sys/compat/linux32/common/linux32_misc.c	Sun Jan  3 16:12:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_misc.c,v 1.30.2.2 2020/12/17 03:02:06 thorpej Exp $	*/
+/*	$NetBSD: linux32_misc.c,v 1.30.2.3 2021/01/03 16:12:44 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.30.2.2 2020/12/17 03:02:06 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.30.2.3 2021/01/03 16:12:44 thorpej Exp $");
 
 #include 
 #include 
@@ -380,3 +380,53 @@ linux32_sys_eventfd2(struct lwp *l, cons
 
 	return linux_sys_eventfd2(l, &ua, retval);
 }
+
+static inline off_t
+linux32_hilo_to_off_t(unsigned long hi, unsigned long lo)
+{
+	return (((off_t)hi) << 32) | lo;
+}
+
+int
+linux32_sys_preadv(struct lwp *l, const struct linux32_sys_preadv_args *uap,
+register_t *retval)
+{
+	/* {
+		syscallarg(int) fd;
+		syscallarg(const netbsd32_iovecp_t) iovp;
+		syscallarg(int) iovcnt;
+		syscallarg(netbsd32_u_long) off_lo;
+		syscallarg(netbsd32_u_long) off_hi;
+	} */
+	struct netbsd32_preadv_args ua;
+
+	SCARG(&ua, fd) = SCARG(uap, fd);
+	SCARG(&ua, iovp) = SCARG(uap, iovp);
+	SCARG(&ua, iovcnt) = SCARG(uap, iovcnt);
+	SCARG(&ua, PAD) = 0;
+	SCARG(&ua, offset) = linux32_hilo_to_off_t(SCARG(uap, off_hi),
+		   SCARG(uap, off_lo));
+	return netbsd32_preadv(l, &ua, retval);
+}
+
+int
+linux32_sys_pwritev(struct lwp *l, const struct linux32_sys_pwritev_args *uap,
+register_t *retval)
+{
+	/* {
+		syscallarg(int) fd;
+		syscallarg(const netbsd32_iovecp_t) iovp;
+		syscallarg(int) iovcnt;
+		syscallarg(netbsd32_u_long) off_lo;
+		syscallarg(netbsd32_u_long) off_hi;
+	} */
+	struct netbsd32_pwritev_args ua;
+
+	SCARG(&ua, fd) = SCARG(uap, fd);
+	SCARG(&ua, iovp) = SCARG(uap, iovp);
+	SCARG(&ua, iovcnt) = SCARG(uap, iovcnt);
+	SCARG(&ua, PAD) = 0;
+	SCARG(&ua, offset) = linux32_hilo_to_off_t(SCARG(uap, off_hi),
+		   SCARG(uap, off_lo));
+	return netbsd32_pwritev(l, &ua, retval);
+}



CVS commit: src

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 15:55:18 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_124.exp
src/usr.bin/xlint/common: tyname.c

Log Message:
lint: add detailed type information for functions


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_124.exp
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/xlint/common/tyname.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/msg_124.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_124.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_124.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_124.exp:1.3	Sun Jan  3 15:51:16 2021
+++ src/tests/usr.bin/xlint/lint1/msg_124.exp	Sun Jan  3 15:55:18 2021
@@ -1,3 +1,3 @@
-msg_124.c(16): warning: illegal pointer combination (pointer to function) and (pointer to int), op p = p [124]
-msg_124.c(17): warning: illegal pointer combination (pointer to function) and (pointer to int), op p = p [124]
-msg_124.c(18): warning: illegal pointer combination (pointer to function) and (pointer to int), op p = p [124]
+msg_124.c(16): warning: illegal pointer combination (pointer to function(int) returning void) and (pointer to int), op p = p [124]
+msg_124.c(17): warning: illegal pointer combination (pointer to function(pointer to function(int) returning void) returning pointer to function(int) returning void) and (pointer to int), op p = p [124]
+msg_124.c(18): warning: illegal pointer combination (pointer to function(pointer to const char, ...) returning int) and (pointer to int), op p = p [124]

Index: src/usr.bin/xlint/common/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.20 src/usr.bin/xlint/common/tyname.c:1.21
--- src/usr.bin/xlint/common/tyname.c:1.20	Sat Jan  2 03:49:25 2021
+++ src/usr.bin/xlint/common/tyname.c	Sun Jan  3 15:55:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tyname.c,v 1.20 2021/01/02 03:49:25 rillig Exp $	*/
+/*	$NetBSD: tyname.c,v 1.21 2021/01/03 15:55:18 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tyname.c,v 1.20 2021/01/02 03:49:25 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.21 2021/01/03 15:55:18 rillig Exp $");
 #endif
 
 #include 
@@ -256,6 +256,37 @@ sametype(const type_t *t1, const type_t 
 	}
 }
 
+static void
+type_name_of_function(buffer *buf, const type_t *tp)
+{
+	const char *sep = "";
+
+	buf_add(buf, "(");
+	if (tp->t_proto) {
+#ifdef t_enum /* lint1 */
+		sym_t *arg;
+
+		for (arg = tp->t_args; arg != NULL; arg = arg->s_next) {
+			buf_add(buf, sep), sep = ", ";
+			buf_add(buf, type_name(arg->s_type));
+		}
+#else /* lint2 */
+		type_t **argtype;
+
+		for (argtype = tp->t_args; *argtype != NULL; argtype++) {
+			buf_add(buf, sep), sep = ", ";
+			buf_add(buf, type_name(*argtype));
+		}
+#endif
+	}
+	if (tp->t_vararg) {
+		buf_add(buf, sep), sep = ", ";
+		buf_add(buf, "...");
+	}
+	buf_add(buf, ") returning ");
+	buf_add(buf, type_name(tp->t_subt));
+}
+
 const char *
 type_name(const type_t *tp)
 {
@@ -301,7 +332,6 @@ type_name(const type_t *tp)
 	case DOUBLE:
 	case LDOUBLE:
 	case VOID:
-	case FUNC:
 	case COMPLEX:
 	case FCOMPLEX:
 	case DCOMPLEX:
@@ -339,8 +369,12 @@ type_name(const type_t *tp)
 		buf_add_int(&buf, tp->t_dim);
 		buf_add(&buf, "]");
 		break;
+	case FUNC:
+		type_name_of_function(&buf, tp);
+		break;
+
 	default:
-		LERROR("tyname(%d)", t);
+		LERROR("type_name(%d)", t);
 	}
 
 	name = intern(buf.data);



CVS commit: src

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 15:51:16 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: d_long_double_int.exp msg_124.exp
src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: add type information to message 124 "illegal pointer combination"


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/d_long_double_int.exp
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_124.exp
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.116 -r1.117 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/tests/usr.bin/xlint/lint1/d_long_double_int.exp
diff -u src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.1 src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.2
--- src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.1	Mon Dec 28 09:58:56 2020
+++ src/tests/usr.bin/xlint/lint1/d_long_double_int.exp	Sun Jan  3 15:51:16 2021
@@ -1 +1 @@
-(9): warning: illegal pointer combination, op p == p [124]
+(9): warning: illegal pointer combination (pointer to long double) and (pointer to long), op p == p [124]

Index: src/tests/usr.bin/xlint/lint1/msg_124.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_124.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_124.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_124.exp:1.2	Sun Jan  3 15:44:35 2021
+++ src/tests/usr.bin/xlint/lint1/msg_124.exp	Sun Jan  3 15:51:16 2021
@@ -1,3 +1,3 @@
-msg_124.c(16): warning: illegal pointer combination, op p = p [124]
-msg_124.c(17): warning: illegal pointer combination, op p = p [124]
-msg_124.c(18): warning: illegal pointer combination, op p = p [124]
+msg_124.c(16): warning: illegal pointer combination (pointer to function) and (pointer to int), op p = p [124]
+msg_124.c(17): warning: illegal pointer combination (pointer to function) and (pointer to int), op p = p [124]
+msg_124.c(18): warning: illegal pointer combination (pointer to function) and (pointer to int), op p = p [124]

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.60 src/usr.bin/xlint/lint1/err.c:1.61
--- src/usr.bin/xlint/lint1/err.c:1.60	Sat Jan  2 17:17:00 2021
+++ src/usr.bin/xlint/lint1/err.c	Sun Jan  3 15:51:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.60 2021/01/02 17:17:00 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.61 2021/01/03 15:51:16 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.60 2021/01/02 17:17:00 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.61 2021/01/03 15:51:16 rillig Exp $");
 #endif
 
 #include 
@@ -183,7 +183,7 @@ const	char *msgs[] = {
 	"negative shift",	  /* 121 */
 	"shift greater than size of object",			  /* 122 */
 	"illegal combination of %s (%s) and %s (%s), op %s",	  /* 123 */
-	"illegal pointer combination, op %s",			  /* 124 */
+	"illegal pointer combination (%s) and (%s), op %s",	  /* 124 */
 	"ANSI C forbids ordered comparisons of pointers to functions",/* 125 */
 	"incompatible types in conditional",			  /* 126 */
 	"'&' before array or function: ignored",		  /* 127 */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.116 src/usr.bin/xlint/lint1/tree.c:1.117
--- src/usr.bin/xlint/lint1/tree.c:1.116	Sat Jan  2 18:26:44 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Jan  3 15:51:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.116 2021/01/02 18:26:44 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.117 2021/01/03 15:51:16 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.116 2021/01/02 18:26:44 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.117 2021/01/03 15:51:16 rillig Exp $");
 #endif
 
 #include 
@@ -2215,8 +2215,9 @@ warn_incompatible_pointers(mod_t *mp, ty
 			/* illegal pointer combination */
 			warning(184);
 		} else {
-			/* illegal pointer combination, op %s */
-			warning(124, mp->m_name);
+			/* illegal pointer combination (%s) and (%s), op %s */
+			warning(124,
+			type_name(ltp), type_name(rtp), mp->m_name);
 		}
 	}
 }



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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 15:44:36 UTC 2021

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

Log Message:
lint: add test for message 124 "illegal pointer combination"

The message may be correct, but it is not helpful in any way.  There are
just too many function pointers that may differ in a very small detail.

Before tyname.c 1.20 from 2021-01-02, the string representation of type
names was often limited to only 63 characters.  Because of this, it made
sense to omit any detail that could need more space than this.  Now that
this limitation is gone, it's reasonable to add more detail to the type
information, especially since that information is readily available.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_124.c \
src/tests/usr.bin/xlint/lint1/msg_124.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_124.c
diff -u src/tests/usr.bin/xlint/lint1/msg_124.c:1.1 src/tests/usr.bin/xlint/lint1/msg_124.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_124.c:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_124.c	Sun Jan  3 15:44:35 2021
@@ -1,7 +1,19 @@
-/*	$NetBSD: msg_124.c,v 1.1 2021/01/02 10:22:43 rillig Exp $	*/
+/*	$NetBSD: msg_124.c,v 1.2 2021/01/03 15:44:35 rillig Exp $	*/
 # 3 "msg_124.c"
 
 // Test for message: illegal pointer combination, op %s [124]
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+typedef void(*signal_handler)(int);
+
+typedef signal_handler(*sys_signal)(signal_handler);
+
+typedef int(*printflike)(const char *, ...)
+__attribute__((format(printf, 1, 2)));
+
+void
+example(int *ptr)
+{
+	signal_handler handler = ptr;
+	sys_signal signal = ptr;
+	printflike printf = ptr;
+}
Index: src/tests/usr.bin/xlint/lint1/msg_124.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_124.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_124.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_124.exp:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_124.exp	Sun Jan  3 15:44:35 2021
@@ -1 +1,3 @@
-msg_124.c(6): syntax error ':' [249]
+msg_124.c(16): warning: illegal pointer combination, op p = p [124]
+msg_124.c(17): warning: illegal pointer combination, op p = p [124]
+msg_124.c(18): warning: illegal pointer combination, op p = p [124]



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

2021-01-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan  3 15:35:01 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_027.c msg_027.exp msg_029.c
msg_029.exp msg_031.c msg_031.exp msg_034.c msg_034.exp msg_036.c
msg_036.exp msg_037.c msg_037.exp msg_071.c msg_071.exp msg_072.c
msg_072.exp msg_073.c msg_073.exp msg_074.c msg_074.exp msg_086.c
msg_086.exp msg_087.c msg_087.exp msg_088.c msg_088.exp msg_230.c
msg_230.exp

Log Message:
lint: add tests for some of the messages


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_027.c \
src/tests/usr.bin/xlint/lint1/msg_027.exp \
src/tests/usr.bin/xlint/lint1/msg_029.c \
src/tests/usr.bin/xlint/lint1/msg_029.exp \
src/tests/usr.bin/xlint/lint1/msg_031.c \
src/tests/usr.bin/xlint/lint1/msg_031.exp \
src/tests/usr.bin/xlint/lint1/msg_034.c \
src/tests/usr.bin/xlint/lint1/msg_034.exp \
src/tests/usr.bin/xlint/lint1/msg_036.c \
src/tests/usr.bin/xlint/lint1/msg_036.exp \
src/tests/usr.bin/xlint/lint1/msg_037.c \
src/tests/usr.bin/xlint/lint1/msg_037.exp \
src/tests/usr.bin/xlint/lint1/msg_071.c \
src/tests/usr.bin/xlint/lint1/msg_071.exp \
src/tests/usr.bin/xlint/lint1/msg_072.c \
src/tests/usr.bin/xlint/lint1/msg_072.exp \
src/tests/usr.bin/xlint/lint1/msg_073.c \
src/tests/usr.bin/xlint/lint1/msg_073.exp \
src/tests/usr.bin/xlint/lint1/msg_074.c \
src/tests/usr.bin/xlint/lint1/msg_074.exp \
src/tests/usr.bin/xlint/lint1/msg_086.c \
src/tests/usr.bin/xlint/lint1/msg_086.exp \
src/tests/usr.bin/xlint/lint1/msg_087.c \
src/tests/usr.bin/xlint/lint1/msg_087.exp \
src/tests/usr.bin/xlint/lint1/msg_088.c \
src/tests/usr.bin/xlint/lint1/msg_088.exp \
src/tests/usr.bin/xlint/lint1/msg_230.c \
src/tests/usr.bin/xlint/lint1/msg_230.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_027.c
diff -u src/tests/usr.bin/xlint/lint1/msg_027.c:1.1 src/tests/usr.bin/xlint/lint1/msg_027.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_027.c:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_027.c	Sun Jan  3 15:35:00 2021
@@ -1,7 +1,8 @@
-/*	$NetBSD: msg_027.c,v 1.1 2021/01/02 10:22:43 rillig Exp $	*/
+/*	$NetBSD: msg_027.c,v 1.2 2021/01/03 15:35:00 rillig Exp $	*/
 # 3 "msg_027.c"
 
 // Test for message: redeclaration of %s [27]
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+extern int identifier(void);
+
+extern double identifier(void);
Index: src/tests/usr.bin/xlint/lint1/msg_027.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_027.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_027.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_027.exp:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_027.exp	Sun Jan  3 15:35:00 2021
@@ -1 +1 @@
-msg_027.c(6): syntax error ':' [249]
+msg_027.c(8): redeclaration of identifier [27]
Index: src/tests/usr.bin/xlint/lint1/msg_029.c
diff -u src/tests/usr.bin/xlint/lint1/msg_029.c:1.1 src/tests/usr.bin/xlint/lint1/msg_029.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_029.c:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_029.c	Sun Jan  3 15:35:00 2021
@@ -1,7 +1,11 @@
-/*	$NetBSD: msg_029.c,v 1.1 2021/01/02 10:22:43 rillig Exp $	*/
+/*	$NetBSD: msg_029.c,v 1.2 2021/01/03 15:35:00 rillig Exp $	*/
 # 3 "msg_029.c"
 
 // Test for message: previously declared extern, becomes static: %s [29]
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+extern int function(void);
+
+static int function(void)
+{
+	return function();
+}
Index: src/tests/usr.bin/xlint/lint1/msg_029.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_029.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_029.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_029.exp:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_029.exp	Sun Jan  3 15:35:00 2021
@@ -1 +1 @@
-msg_029.c(6): syntax error ':' [249]
+msg_029.c(9): warning: previously declared extern, becomes static: function [29]
Index: src/tests/usr.bin/xlint/lint1/msg_031.c
diff -u src/tests/usr.bin/xlint/lint1/msg_031.c:1.1 src/tests/usr.bin/xlint/lint1/msg_031.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_031.c:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_031.c	Sun Jan  3 15:35:00 2021
@@ -1,7 +1,15 @@
-/*	$NetBSD: msg_031.c,v 1.1 2021/01/02 10:22:43 rillig Exp $	*/
+/*	$NetBSD: msg_031.c,v 1.2 2021/01/03 15:35:00 rillig Exp $	*/
 # 3 "msg_031.c"
 
 // Test for message: incomplete structure or union %s: %s [31]
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+struct complete {
+	int dummy;
+};
+
+stru

CVS commit: src/external/bsd/ntp/dist/ntpd

2021-01-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Jan  3 15:33:05 UTC 2021

Modified Files:
src/external/bsd/ntp/dist/ntpd: cmd_args.c ntp_io.c ntp_timer.c

Log Message:
ntp: respect user's wishes to disable interface scanning

While here, disable periodic scanning by default on NetBSD as it's
no longer needed.
The user can still enable it though with a positive number to the -U
option.

kardel@ So far I see no other issues from the pitfalls I know of


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpd/cmd_args.c
cvs rdiff -u -r1.28 -r1.29 src/external/bsd/ntp/dist/ntpd/ntp_io.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/ntp/dist/ntpd/ntp_timer.c

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

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/cmd_args.c
diff -u src/external/bsd/ntp/dist/ntpd/cmd_args.c:1.6 src/external/bsd/ntp/dist/ntpd/cmd_args.c:1.7
--- src/external/bsd/ntp/dist/ntpd/cmd_args.c:1.6	Mon May 25 20:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/cmd_args.c	Sun Jan  3 15:33:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmd_args.c,v 1.6 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: cmd_args.c,v 1.7 2021/01/03 15:33:05 roy Exp $	*/
 
 /*
  * cmd_args.c = command-line argument processing
@@ -181,9 +181,11 @@ getCmdOpts(
 	if (HAVE_OPT( UPDATEINTERVAL )) {
 		long val = OPT_VALUE_UPDATEINTERVAL;
 
-		if (val >= 0)
+		if (val >= 0) {
 			interface_interval = val;
-		else {
+			if (interface_interval == 0)
+disable_dynamic_updates = 1;
+		} else {
 			fprintf(stderr,
 "command line interface update interval %ld must not be negative\n",
 val);

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.28 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.29
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.28	Fri Jan  1 17:21:47 2021
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Sun Jan  3 15:33:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.28 2021/01/01 17:21:47 roy Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.29 2021/01/03 15:33:05 roy Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -455,8 +455,13 @@ init_io(void)
 {
 	/* Init buffer free list and stat counters */
 	init_recvbuff(RECV_INIT);
+#ifdef SO_RERROR
+	/* route(4) overflow can be observed */
+	interface_interval = 0;
+#else
 	/* update interface every 5 minutes as default */
 	interface_interval = 300;
+#endif
 
 #ifdef WORK_PIPE
 	addremove_io_fd = &ntpd_addremove_io_fd;

Index: src/external/bsd/ntp/dist/ntpd/ntp_timer.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.8 src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.9
--- src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.8	Mon May 25 20:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/ntp_timer.c	Sun Jan  3 15:33:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_timer.c,v 1.8 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: ntp_timer.c,v 1.9 2021/01/03 15:33:05 roy Exp $	*/
 
 /*
  * ntp_timer.c - event timer support routines
@@ -423,9 +423,11 @@ timer(void)
 	/*
 	 * Interface update timer
 	 */
-	if (interface_interval && interface_timer <= current_time) {
-		timer_interfacetimeout(current_time +
-		interface_interval);
+	if (!disable_dynamic_updates &&
+	interface_timer && interface_timer <= current_time) {
+		if (interface_interval)
+			timer_interfacetimeout(current_time +
+			interface_interval);
 		DPRINTF(2, ("timer: interface update\n"));
 		interface_update(NULL, NULL);
 	}



CVS commit: [netbsd-9] src/doc

2021-01-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  3 12:52:54 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.2

Log Message:
Ticket #1177


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.31 -r1.1.2.32 src/doc/CHANGES-9.2

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

Modified files:

Index: src/doc/CHANGES-9.2
diff -u src/doc/CHANGES-9.2:1.1.2.31 src/doc/CHANGES-9.2:1.1.2.32
--- src/doc/CHANGES-9.2:1.1.2.31	Sat Jan  2 10:24:42 2021
+++ src/doc/CHANGES-9.2	Sun Jan  3 12:52:54 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.2,v 1.1.2.31 2021/01/02 10:24:42 martin Exp $
+# $NetBSD: CHANGES-9.2,v 1.1.2.32 2021/01/03 12:52:54 martin Exp $
 
 A complete list of changes from the NetBSD 9.1 release to the NetBSD 9.2
 release:
@@ -1388,3 +1388,10 @@ sys/ufs/ufs/ufs_quota1.c			1.23
 	Avoid out of bounds array access.
 	[nia, ticket #1176]
 
+sys/kern/init_main.c(apply patch)
+
+	PR kern/55906: create the aiodone workqueue before running
+	mountroothooks.
+	[khorben, #1177]
+
+



CVS commit: [netbsd-9] src/sys/kern

2021-01-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan  3 12:51:33 UTC 2021

Modified Files:
src/sys/kern [netbsd-9]: init_main.c

Log Message:
Apply patch, requested by khorben in ticket #1177 (issue solved differently
in -current):

sys/kern/init_main.c(apply patch)

PR kern/55906: create the aiodone workqueue before running mountroothooks.


To generate a diff of this commit:
cvs rdiff -u -r1.504.2.1 -r1.504.2.2 src/sys/kern/init_main.c

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

Modified files:

Index: src/sys/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.504.2.1 src/sys/kern/init_main.c:1.504.2.2
--- src/sys/kern/init_main.c:1.504.2.1	Sat Nov 14 15:36:11 2020
+++ src/sys/kern/init_main.c	Sun Jan  3 12:51:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.504.2.1 2020/11/14 15:36:11 martin Exp $	*/
+/*	$NetBSD: init_main.c,v 1.504.2.2 2021/01/03 12:51:33 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.504.2.1 2020/11/14 15:36:11 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.504.2.2 2021/01/03 12:51:33 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -668,6 +668,11 @@ main(void)
 	cpu_rootconf();
 	cpu_dumpconf();
 
+	/* Create the aiodone daemon kernel thread. */
+	if (workqueue_create(&uvm.aiodone_queue, "aiodoned",
+	uvm_aiodone_worker, NULL, PRI_VM, IPL_NONE, WQ_MPSAFE))
+		panic("fork aiodoned");
+
 	/* Mount the root file system. */
 	do {
 		domountroothook(root_device);
@@ -736,11 +741,6 @@ main(void)
 	NULL, NULL, "ioflush"))
 		panic("fork syncer");
 
-	/* Create the aiodone daemon kernel thread. */
-	if (workqueue_create(&uvm.aiodone_queue, "aiodoned",
-	uvm_aiodone_worker, NULL, PRI_VM, IPL_NONE, WQ_MPSAFE))
-		panic("fork aiodoned");
-
 	/* Wait for final configure threads to complete. */
 	config_finalize_mountroot();
 



CVS commit: src/sys/dev/pci

2021-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan  3 10:31:37 UTC 2021

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

Log Message:
Misc whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/pciconf.c

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

Modified files:

Index: src/sys/dev/pci/pciconf.c
diff -u src/sys/dev/pci/pciconf.c:1.51 src/sys/dev/pci/pciconf.c:1.52
--- src/sys/dev/pci/pciconf.c:1.51	Tue Dec 29 15:39:59 2020
+++ src/sys/dev/pci/pciconf.c	Sun Jan  3 10:31:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pciconf.c,v 1.51 2020/12/29 15:39:59 skrll Exp $	*/
+/*	$NetBSD: pciconf.c,v 1.52 2021/01/03 10:31:37 skrll Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pciconf.c,v 1.51 2020/12/29 15:39:59 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciconf.c,v 1.52 2021/01/03 10:31:37 skrll Exp $");
 
 #include "opt_pci.h"
 
@@ -392,9 +392,9 @@ set_busreg(pci_chipset_tag_t pc, pcitag_
 {
 	pcireg_t	busreg;
 
-	busreg  =  __SHIFTIN(prim, PCI_BRIDGE_BUS_PRIMARY);
-	busreg |=  __SHIFTIN(sec,  PCI_BRIDGE_BUS_SECONDARY);
-	busreg |=  __SHIFTIN(sub,  PCI_BRIDGE_BUS_SUBORDINATE);
+	busreg  = __SHIFTIN(prim, PCI_BRIDGE_BUS_PRIMARY);
+	busreg |= __SHIFTIN(sec,  PCI_BRIDGE_BUS_SECONDARY);
+	busreg |= __SHIFTIN(sub,  PCI_BRIDGE_BUS_SUBORDINATE);
 	pci_conf_write(pc, tag, PCI_BRIDGE_BUS_REG, busreg);
 }
 
@@ -647,7 +647,7 @@ pci_do_device_query(pciconf_bus_t *pb, p
 		reg_end = PCI_MAPREG_PCB_END;
 
 		busreg = pci_conf_read(pb->pc, tag, PCI_BUSNUM);
-		busreg  =  (busreg & 0xff00) |
+		busreg = (busreg & 0xff00) |
 		__SHIFTIN(pb->busno, PCI_BRIDGE_BUS_PRIMARY) |
 		__SHIFTIN(pb->next_busno, PCI_BRIDGE_BUS_SECONDARY) |
 		__SHIFTIN(pb->next_busno, PCI_BRIDGE_BUS_SUBORDINATE);