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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 30 01:44:32 UTC 2020

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

Log Message:
lint: reduce nesting of function calls


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 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.117 src/usr.bin/xlint/lint1/cgram.y:1.118
--- src/usr.bin/xlint/lint1/cgram.y:1.117	Wed Dec 30 01:02:38 2020
+++ src/usr.bin/xlint/lint1/cgram.y	Wed Dec 30 01:44:32 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.117 2020/12/30 01:02:38 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.118 2020/12/30 01:44:32 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.117 2020/12/30 01:02:38 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.118 2020/12/30 01:44:32 rillig Exp $");
 #endif
 
 #include 
@@ -1165,8 +1165,8 @@ pointer:
 		$$ = merge_pointers_and_qualifiers($1, $2);
 	  }
 	| asterisk type_qualifier_list pointer {
-		$$ = merge_pointers_and_qualifiers(
-		merge_pointers_and_qualifiers($1, $2), $3);
+		$$ = merge_pointers_and_qualifiers($1, $2);
+		$$ = merge_pointers_and_qualifiers($$, $3);
 	  }
 	;
 



CVS commit: src/usr.bin/nl

2020-12-29 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Wed Dec 30 01:42:31 UTC 2020

Modified Files:
src/usr.bin/nl: nl.c

Log Message:
nl: fix -d delim parsing for POSIX

POSIX specifies it is possible to specify a one delimiter character.
Fix the logic so that both one and two character delimiters are accepted.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/nl/nl.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/nl/nl.c
diff -u src/usr.bin/nl/nl.c:1.13 src/usr.bin/nl/nl.c:1.14
--- src/usr.bin/nl/nl.c:1.13	Tue Dec 22 17:50:55 2020
+++ src/usr.bin/nl/nl.c	Wed Dec 30 01:42:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nl.c,v 1.13 2020/12/22 17:50:55 ginsbach Exp $	*/
+/*	$NetBSD: nl.c,v 1.14 2020/12/30 01:42:31 ginsbach Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1999\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: nl.c,v 1.13 2020/12/22 17:50:55 ginsbach Exp $");
+__RCSID("$NetBSD: nl.c,v 1.14 2020/12/30 01:42:31 ginsbach Exp $");
 #endif
 
 #include 
@@ -157,14 +157,15 @@ main(int argc, char *argv[])
 		case 'd':
 			if (optarg[0] != '\0')
 delim[0] = optarg[0];
-			if (optarg[1] != '\0')
+			if (optarg[1] != '\0') {
 delim[1] = optarg[1];
-			/* at most two delimiter characters */
-			if (optarg[2] != '\0') {
-errx(EXIT_FAILURE,
-"invalid delim argument -- %s",
-optarg);
-/* NOTREACHED */
+/* at most two delimiter characters */
+if (optarg[2] != '\0') {
+	errx(EXIT_FAILURE,
+	"invalid delim argument -- %s",
+	optarg);
+	/* NOTREACHED */
+}
 			}
 			break;
 		case 'f':



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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 30 01:33:30 UTC 2020

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

Log Message:
lint: reduce verbosity of assertions

Having 2 lines of source code per assertion is too much, especially
since most of this code is redundant anyway.  Extract the common code
and the additional negation into a simple function instead.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.36 -r1.37 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/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.58 src/usr.bin/xlint/lint1/err.c:1.59
--- src/usr.bin/xlint/lint1/err.c:1.58	Tue Dec 29 12:18:42 2020
+++ src/usr.bin/xlint/lint1/err.c	Wed Dec 30 01:33:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.58 2020/12/29 12:18:42 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.59 2020/12/30 01:33:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.58 2020/12/29 12:18:42 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.59 2020/12/30 01:33:30 rillig Exp $");
 #endif
 
 #include 
@@ -490,6 +490,18 @@ lerror(const char *file, int line, const
 }
 
 void
+assert_failed(const char *file, int line, const char *func, const char *cond)
+{
+	const	char *fn;
+
+	fn = lbasename(curr_pos.p_file);
+	(void)fprintf(stderr,
+	"lint: assertion \"%s\" failed in %s at %s:%d near %s:%d\n",
+	cond, func, file, line, fn, curr_pos.p_line);
+	abort();
+}
+
+void
 warning(int n, ...)
 {
 	va_list	ap;

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.40 src/usr.bin/xlint/lint1/externs1.h:1.41
--- src/usr.bin/xlint/lint1/externs1.h:1.40	Tue Dec 29 17:29:31 2020
+++ src/usr.bin/xlint/lint1/externs1.h	Wed Dec 30 01:33:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.40 2020/12/29 17:29:31 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.41 2020/12/30 01:33:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -127,6 +127,8 @@ extern	int	gnuism(int, ...);
 extern	int	c99ism(int, ...);
 extern	void	lerror(const char *, int, const char *, ...)
  __attribute__((__noreturn__,__format__(__printf__, 3, 4)));
+extern	void	assert_failed(const char *, int, const char *, const char *)
+		__attribute__((__noreturn__));
 
 /*
  * decl.c

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.43 src/usr.bin/xlint/lint1/init.c:1.44
--- src/usr.bin/xlint/lint1/init.c:1.43	Tue Dec 29 23:12:48 2020
+++ src/usr.bin/xlint/lint1/init.c	Wed Dec 30 01:33:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.43 2020/12/29 23:12:48 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.44 2020/12/30 01:33:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.43 2020/12/29 23:12:48 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.44 2020/12/30 01:33:30 rillig Exp $");
 #endif
 
 #include 
@@ -161,16 +161,14 @@ initstack_pop_item(void)
 	initstk = istk->i_nxt;
 	free(istk);
 	istk = initstk;
-	if (istk == NULL)
-		LERROR("initstack_pop_item()");
+	lint_assert(istk != NULL);
 
 	DPRINTF(("%s: top type=%s, brace=%d remaining=%d named=%d\n", __func__,
 	tyname(buf, sizeof buf, istk->i_type ? istk->i_type : istk->i_subt),
 	istk->i_brace, istk->i_remaining, istk->i_namedmem));
 
 	istk->i_remaining--;
-	if (istk->i_remaining < 0)
-		LERROR("initstack_pop_item()");
+	lint_assert(istk->i_remaining >= 0);
 
 	DPRINTF(("%s: top remaining=%d rhs.name=%s\n", __func__,
 	istk->i_remaining, namedmem ? namedmem->n_name : "*null*"));
@@ -207,8 +205,7 @@ initstack_pop_item(void)
 	!istk->i_namedmem) {
 		do {
 			m = istk->i_mem = istk->i_mem->s_nxt;
-			if (m == NULL)
-LERROR("initstack_pop_item()");
+			lint_assert(m != NULL);
 			DPRINTF(("%s: pop %s\n", __func__, m->s_name));
 		} while (m->s_field && m->s_name == unnamed);
 		istk->i_subt = m->s_type;
@@ -268,25 +265,21 @@ initstack_push(void)
 		 * Inside of other aggregate types must not be an incomplete
 		 * type.
 		 */
-		if (istk->i_nxt->i_nxt != NULL)
-			LERROR("initstack_push()");
+		lint_assert(istk->i_nxt->i_nxt == NULL);
 		istk->i_remaining = 1;
-		if (istk->i_type->t_tspec != ARRAY)
-			LERROR("initstack_push()");
+		lint_assert(istk->i_type->t_tspec == ARRAY);
 		istk->i_type->t_dim++;
 		setcomplete(istk->i_type, 1);
 	}
 
-	if (istk->i_remaining <= 0)
-		LERROR("initstack_push()");
-	if (istk->i_type != NULL && tspec_is_scalar(istk->i_type->t_tspec))
-		LERROR("initstack_push()");
+	lint_assert(istk->i_remaining > 0);
+	

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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 30 01:02:38 UTC 2020

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

Log Message:
lint: add debug logging to the parser

Even with -DDEBUG and -DYYDEBUG, the debug output is not detailed enough
to clearly see what happens.

Add some custom debug logging to the parser, mainly for demonstration
purposes, and also to find out how to fix the test d_struct_init_nested.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 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.116 src/usr.bin/xlint/lint1/cgram.y:1.117
--- src/usr.bin/xlint/lint1/cgram.y:1.116	Tue Dec 29 17:29:31 2020
+++ src/usr.bin/xlint/lint1/cgram.y	Wed Dec 30 01:02:38 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.116 2020/12/29 17:29:31 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.117 2020/12/30 01:02:38 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.116 2020/12/29 17:29:31 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.117 2020/12/30 01:02:38 rillig Exp $");
 #endif
 
 #include 
@@ -102,10 +102,12 @@ static inline void RESTORE(const char *f
 	} else
 		CLRWFLGS(file, line);
 }
+#define cgram_debug(fmt, args...) printf("cgram_debug: " fmt "\n", ##args)
 #else
 #define CLRWFLGS(f, l) clrwflgs(), olwarn = LWARN_BAD
 #define SAVE(f, l)	olwarn = lwarn
 #define RESTORE(f, l) (void)(olwarn == LWARN_BAD ? (clrwflgs(), 0) : (lwarn = olwarn))
+#define cgram_debug(fmt, args...) (void)0
 #endif
 
 /* unbind the anonymous struct members from the struct */
@@ -1315,7 +1317,11 @@ opt_asm_or_symbolrename:		/* expect only
 	;
 
 initializer:
-	  init_assign_expr
+	  {
+		cgram_debug("begin initializer");
+	  } init_assign_expr {
+		cgram_debug("end initializer");
+	  }
 	;
 
 init_assign_expr:
@@ -2018,9 +2024,11 @@ point:
 identifier:
 	  T_NAME {
 		$$ = $1;
+		cgram_debug("name '%s'", $$->sb_name);
 	  }
 	| T_TYPENAME {
 		$$ = $1;
+		cgram_debug("typename '%s'", $$->sb_name);
 	  }
 	;
 



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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 23:12:48 UTC 2020

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

Log Message:
lint: rename istk_t.i_cnt to i_remaining


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.35 -r1.36 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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.42 src/usr.bin/xlint/lint1/init.c:1.43
--- src/usr.bin/xlint/lint1/init.c:1.42	Tue Dec 29 20:56:28 2020
+++ src/usr.bin/xlint/lint1/init.c	Tue Dec 29 23:12:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.42 2020/12/29 20:56:28 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.43 2020/12/29 23:12:48 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.42 2020/12/29 20:56:28 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.43 2020/12/29 23:12:48 rillig Exp $");
 #endif
 
 #include 
@@ -141,7 +141,7 @@ initstack_init(void)
 
 	istk = initstk = xcalloc(1, sizeof (istk_t));
 	istk->i_subt = initsym->s_type;
-	istk->i_cnt = 1;
+	istk->i_remaining = 1;
 }
 
 static void
@@ -156,7 +156,7 @@ initstack_pop_item(void)
 	istk = initstk;
 	DPRINTF(("%s: pop type=%s, brace=%d remaining=%d named=%d\n", __func__,
 	tyname(buf, sizeof buf, istk->i_type ? istk->i_type : istk->i_subt),
-	istk->i_brace, istk->i_cnt, istk->i_namedmem));
+	istk->i_brace, istk->i_remaining, istk->i_namedmem));
 
 	initstk = istk->i_nxt;
 	free(istk);
@@ -166,19 +166,19 @@ initstack_pop_item(void)
 
 	DPRINTF(("%s: top type=%s, brace=%d remaining=%d named=%d\n", __func__,
 	tyname(buf, sizeof buf, istk->i_type ? istk->i_type : istk->i_subt),
-	istk->i_brace, istk->i_cnt, istk->i_namedmem));
+	istk->i_brace, istk->i_remaining, istk->i_namedmem));
 
-	istk->i_cnt--;
-	if (istk->i_cnt < 0)
+	istk->i_remaining--;
+	if (istk->i_remaining < 0)
 		LERROR("initstack_pop_item()");
 
 	DPRINTF(("%s: top remaining=%d rhs.name=%s\n", __func__,
-	istk->i_cnt, namedmem ? namedmem->n_name : "*null*"));
+	istk->i_remaining, namedmem ? namedmem->n_name : "*null*"));
 
-	if (istk->i_cnt >= 0 && namedmem != NULL) {
+	if (istk->i_remaining >= 0 && namedmem != NULL) {
 
 		DPRINTF(("%s: named remaining=%d type=%s, rhs.name=%s\n",
-		__func__, istk->i_cnt,
+		__func__, istk->i_remaining,
 		tyname(buf, sizeof(buf), istk->i_type), namedmem->n_name));
 
 		for (m = istk->i_type->t_str->memb; m != NULL; m = m->s_nxt) {
@@ -188,7 +188,7 @@ initstack_pop_item(void)
 continue;
 			if (strcmp(m->s_name, namedmem->n_name) == 0) {
 istk->i_subt = m->s_type;
-istk->i_cnt++;
+istk->i_remaining++;
 pop_member();
 return;
 			}
@@ -203,7 +203,7 @@ initstack_pop_item(void)
 	 * If the removed element was a structure member, we must go
 	 * to the next structure member.
 	 */
-	if (istk->i_cnt > 0 && istk->i_type->t_tspec == STRUCT &&
+	if (istk->i_remaining > 0 && istk->i_type->t_tspec == STRUCT &&
 	!istk->i_namedmem) {
 		do {
 			m = istk->i_mem = istk->i_mem->s_nxt;
@@ -242,7 +242,8 @@ initstack_pop_nobrace(void)
 {
 
 	DPRINTF(("%s\n", __func__));
-	while (!initstk->i_brace && initstk->i_cnt == 0 && !initstk->i_nolimit)
+	while (!initstk->i_brace && initstk->i_remaining == 0 &&
+	   !initstk->i_nolimit)
 		initstack_pop_item();
 	DPRINTF(("%s: done\n", __func__));
 }
@@ -260,7 +261,7 @@ initstack_push(void)
 	istk = initstk;
 
 	/* Extend an incomplete array type by one element */
-	if (istk->i_cnt == 0) {
+	if (istk->i_remaining == 0) {
 		DPRINTF(("%s(extend) %s\n", __func__,
 		tyname(buf, sizeof(buf), istk->i_type)));
 		/*
@@ -269,14 +270,14 @@ initstack_push(void)
 		 */
 		if (istk->i_nxt->i_nxt != NULL)
 			LERROR("initstack_push()");
-		istk->i_cnt = 1;
+		istk->i_remaining = 1;
 		if (istk->i_type->t_tspec != ARRAY)
 			LERROR("initstack_push()");
 		istk->i_type->t_dim++;
 		setcomplete(istk->i_type, 1);
 	}
 
-	if (istk->i_cnt <= 0)
+	if (istk->i_remaining <= 0)
 		LERROR("initstack_push()");
 	if (istk->i_type != NULL && tspec_is_scalar(istk->i_type->t_tspec))
 		LERROR("initstack_push()");
@@ -311,9 +312,9 @@ again:
 		}
 		istk->i_subt = istk->i_type->t_subt;
 		istk->i_nolimit = incompl(istk->i_type);
-		istk->i_cnt = istk->i_type->t_dim;
+		istk->i_remaining = istk->i_type->t_dim;
 		DPRINTF(("%s: elements array %s[%d] %s\n", __func__,
-		tyname(buf, sizeof(buf), istk->i_subt), istk->i_cnt,
+		tyname(buf, sizeof(buf), istk->i_subt), istk->i_remaining,
 		namedmem ? namedmem->n_name : "*none*"));
 		break;
 	case UNION:
@@ -373,7 +374,7 @@ again:
 			initerr = 1;
 			return;
 		}
-		istk->i_cnt = istk->i_type->t_tspec == STRUCT ? cnt : 1;
+		istk->i_remaining = istk->i_type->t_tspec == STRUCT ? cnt : 1;
 		break;
 

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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 23:04:31 UTC 2020

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

Log Message:
lint: rename functions that had very short names


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

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

Modified files:

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.99 src/usr.bin/xlint/lint1/tree.c:1.100
--- src/usr.bin/xlint/lint1/tree.c:1.99	Tue Dec 29 21:32:46 2020
+++ src/usr.bin/xlint/lint1/tree.c	Tue Dec 29 23:04:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.99 2020/12/29 21:32:46 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.100 2020/12/29 23:04:31 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.99 2020/12/29 21:32:46 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.100 2020/12/29 23:04:31 rillig Exp $");
 #endif
 
 #include 
@@ -51,41 +51,44 @@ __RCSID("$NetBSD: tree.c,v 1.99 2020/12/
 #include "cgram.h"
 #include "externs1.h"
 
-static	tnode_t	*getinode(tspec_t, int64_t);
-static	void	ptrcmpok(op_t, tnode_t *, tnode_t *);
-static	int	asgntypok(op_t, int, tnode_t *, tnode_t *);
-static	void	chkbeop(op_t, tnode_t *, tnode_t *);
-static	void	chkeop2(op_t, int, tnode_t *, tnode_t *);
-static	void	chkeop1(op_t, int, tnode_t *, tnode_t *);
-static	tnode_t	*mktnode(op_t, type_t *, tnode_t *, tnode_t *);
+static	tnode_t	*new_int_const_node(tspec_t, int64_t);
+static	void	check_pointer_comparison(op_t, tnode_t *, tnode_t *);
+static	int	check_assign_types_compatible(op_t, int, tnode_t *, tnode_t *);
+static	void	check_bad_enum_operation(op_t, tnode_t *, tnode_t *);
+static	void	check_enum_type_mismatch(op_t, int, tnode_t *, tnode_t *);
+static	void	check_enum_int_mismatch(op_t, int, tnode_t *, tnode_t *);
+static	tnode_t	*new_tnode(op_t, type_t *, tnode_t *, tnode_t *);
 static	void	balance(op_t, tnode_t **, tnode_t **);
-static	void	incompat(op_t, tspec_t, tspec_t);
+static	void	warn_incompatible_types(op_t, tspec_t, tspec_t);
 static	void	warn_incompatible_pointers(mod_t *, type_t *, type_t *);
 static	void	merge_qualifiers(type_t **, type_t *, type_t *);
-static	int	conmemb(type_t *);
-static	void	ptconv(int, tspec_t, tspec_t, type_t *, tnode_t *);
-static	void	iiconv(op_t, int, tspec_t, tspec_t, type_t *, tnode_t *);
-static	void	piconv(op_t, tspec_t, type_t *, tnode_t *);
-static	void	ppconv(op_t, tnode_t *, type_t *);
-static	tnode_t	*bldstr(op_t, tnode_t *, tnode_t *);
-static	tnode_t	*bldincdec(op_t, tnode_t *);
-static	tnode_t	*bldri(op_t, tnode_t *);
+static	int	has_constant_member(type_t *);
+static	void	check_prototype_conversion(int, tspec_t, tspec_t, type_t *,
+	   tnode_t *);
+static	void	check_integer_conversion(op_t, int, tspec_t, tspec_t, type_t *,
+	 tnode_t *);
+static	void	check_pointer_integer_conversion(op_t, tspec_t, type_t *,
+		 tnode_t *);
+static	void	check_pointer_conversion(op_t, tnode_t *, type_t *);
+static	tnode_t	*build_struct_access(op_t, tnode_t *, tnode_t *);
+static	tnode_t	*build_prepost_incdec(op_t, tnode_t *);
+static	tnode_t	*build_real_imag(op_t, tnode_t *);
 static	tnode_t	*build_ampersand(tnode_t *, int);
-static	tnode_t	*bldplmi(op_t, tnode_t *, tnode_t *);
-static	tnode_t	*bldshft(op_t, tnode_t *, tnode_t *);
-static	tnode_t	*bldcol(tnode_t *, tnode_t *);
-static	tnode_t	*bldasgn(op_t, tnode_t *, tnode_t *);
+static	tnode_t	*build_plus_minus(op_t, tnode_t *, tnode_t *);
+static	tnode_t	*build_bit_shift(op_t, tnode_t *, tnode_t *);
+static	tnode_t	*build_colon(tnode_t *, tnode_t *);
+static	tnode_t	*build_assignment(op_t, tnode_t *, tnode_t *);
 static	tnode_t	*plength(type_t *);
 static	tnode_t	*fold(tnode_t *);
-static	tnode_t	*foldtst(tnode_t *);
-static	tnode_t	*foldflt(tnode_t *);
-static	tnode_t	*chkfarg(type_t *, tnode_t *);
-static	tnode_t	*parg(int, type_t *, tnode_t *);
-static	void	nulleff(tnode_t *);
-static	void	displexpr(tnode_t *, int);
+static	tnode_t	*fold_test(tnode_t *);
+static	tnode_t	*fold_float(tnode_t *);
+static	tnode_t	*check_function_arguments(type_t *, tnode_t *);
+static	tnode_t	*check_prototype_argument(int, type_t *, tnode_t *);
+static	void	check_null_effect(tnode_t *);
+static	void	display_expression(tnode_t *, int);
 static	void	check_array_index(tnode_t *, int);
-static	void	chkcomp(op_t, tnode_t *, tnode_t *);
-static	void	precconf(tnode_t *);
+static	void	check_integer_comparison(op_t, tnode_t *, tnode_t *);
+static	void	check_precedence_confusion(tnode_t *);
 
 extern sig_atomic_t fpe;
 
@@ -180,7 +183,7 @@ getcnode(type_t *tp, val_t *v)
  * Create a node for a integer constant.
  */
 static tnode_t *
-getinode(tspec_t t, int64_t q)
+new_int_const_node(tspec_t t, int64_t q)
 {
 	tnode_t	*n;
 
@@ -496,7 +499,7 @@ build(op_t op, tnode_t *ln, tnode_t *rn)
 	 * 

CVS commit: src/sys/kern

2020-12-29 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Tue Dec 29 22:13:40 UTC 2020

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

Log Message:
Honor LOCKPARENT for ".." of the root directory.

Reported-by: syzbot+f40b9f241b818fd12...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/sys/kern/vfs_lookup.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/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.224 src/sys/kern/vfs_lookup.c:1.225
--- src/sys/kern/vfs_lookup.c:1.224	Mon Jun 15 18:44:10 2020
+++ src/sys/kern/vfs_lookup.c	Tue Dec 29 22:13:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.224 2020/06/15 18:44:10 ad Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.225 2020/12/29 22:13:40 chs Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.224 2020/06/15 18:44:10 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.225 2020/12/29 22:13:40 chs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_magiclinks.h"
@@ -1047,6 +1047,28 @@ lookup_crossmount(struct namei_state *st
 }
 
 /*
+ * Determine the desired locking mode for the directory of a lookup.
+ */
+static int
+lookup_lktype(struct vnode *searchdir, struct componentname *cnp)
+{
+
+	/*
+	 * If the file system supports VOP_LOOKUP() with a shared lock, and
+	 * we are not making any modifications (nameiop LOOKUP) or this is
+	 * not the last component then get a shared lock.  Where we can't do
+	 * fast-forwarded lookups (for example with layered file systems)
+	 * then this is the fallback for reducing lock contention.
+	 */
+	if ((searchdir->v_mount->mnt_iflag & IMNT_SHRLOOKUP) != 0 &&
+	(cnp->cn_nameiop == LOOKUP || (cnp->cn_flags & ISLASTCN) == 0)) {
+		return LK_SHARED;
+	} else {
+		return LK_EXCLUSIVE;
+	}
+}
+
+/*
  * Call VOP_LOOKUP for a single lookup; return a new search directory
  * (used when crossing mountpoints up or searching union mounts down) and
  * the found object, which for create operations may be NULL on success.
@@ -1100,6 +1122,11 @@ lookup_once(struct namei_state *state,
 foundobj = searchdir;
 vref(foundobj);
 *foundobj_ret = foundobj;
+if (cnp->cn_flags & LOCKPARENT) {
+	lktype = lookup_lktype(searchdir, cnp);
+	vn_lock(searchdir, lktype | LK_RETRY);
+	searchdir_locked = true;
+}
 error = 0;
 goto done;
 			}
@@ -1137,19 +1164,7 @@ lookup_once(struct namei_state *state,
 		}
 	}
 
-	/*
-	 * If the file system supports VOP_LOOKUP() with a shared lock, and
-	 * we are not making any modifications (nameiop LOOKUP) or this is
-	 * not the last component then get a shared lock.  Where we can't do
-	 * fast-forwarded lookups (for example with layered file systems)
-	 * then this is the fallback for reducing lock contention.
-	 */
-	if ((searchdir->v_mount->mnt_iflag & IMNT_SHRLOOKUP) != 0 &&
-	(cnp->cn_nameiop == LOOKUP || (cnp->cn_flags & ISLASTCN) == 0)) {
-		lktype = LK_SHARED;
-	} else {
-		lktype = LK_EXCLUSIVE;
-	}
+	lktype = lookup_lktype(searchdir, cnp);
 
 	/*
 	 * We now have a segment name to search for, and a directory to search.



CVS commit: src/usr.bin/xlint

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 21:32:46 UTC 2020

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

Log Message:
lint: fix typo in comments


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.98 -r1.99 src/usr.bin/xlint/lint1/tree.c
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/xlint/lint2/lint2.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.78 src/usr.bin/xlint/lint1/decl.c:1.79
--- src/usr.bin/xlint/lint1/decl.c:1.78	Tue Dec 29 17:29:31 2020
+++ src/usr.bin/xlint/lint1/decl.c	Tue Dec 29 21:32:46 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.78 2020/12/29 17:29:31 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.79 2020/12/29 21:32:46 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.78 2020/12/29 17:29:31 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.79 2020/12/29 21:32:46 rillig Exp $");
 #endif
 
 #include 
@@ -1259,10 +1259,10 @@ bitfield(sym_t *dsym, int len)
 }
 
 /*
- * Collect informations about a sequence of asterisks and qualifiers
- * in a list of type pqinf_t.
- * Qualifiers refer always to the left asterisk. The rightmost asterisk
- * will be at the top of the list.
+ * Collect information about a sequence of asterisks and qualifiers in a
+ * list of type pqinf_t.
+ * Qualifiers always refer to the left asterisk.
+ * The rightmost asterisk will be at the top of the list.
  */
 pqinf_t *
 merge_pointers_and_qualifiers(pqinf_t *p1, pqinf_t *p2)
@@ -1969,8 +1969,8 @@ decl1ext(sym_t *dsym, int initflg)
 			}
 
 			/*
-			 * Copy informations about usage of the name into
-			 * the new symbol.
+			 * Copy usage information of the name into the new
+			 * symbol.
 			 */
 			copy_usage_info(dsym, rdsym);
 

Index: src/usr.bin/xlint/lint1/emit1.c
diff -u src/usr.bin/xlint/lint1/emit1.c:1.24 src/usr.bin/xlint/lint1/emit1.c:1.25
--- src/usr.bin/xlint/lint1/emit1.c:1.24	Tue Dec 29 11:35:11 2020
+++ src/usr.bin/xlint/lint1/emit1.c	Tue Dec 29 21:32:46 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.24 2020/12/29 11:35:11 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.25 2020/12/29 21:32:46 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.24 2020/12/29 11:35:11 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.25 2020/12/29 21:32:46 rillig Exp $");
 #endif
 
 #include 
@@ -435,7 +435,7 @@ outcall(tnode_t *tn, int rvused, int rvd
 	args = tn->tn_right;
 	for (arg = args; arg != NULL; arg = arg->tn_right)
 		narg++;
-	/* informations about arguments */
+	/* information about arguments */
 	for (n = 1; n <= narg; n++) {
 		/* the last argument is the top one in the tree */
 		for (i = narg, arg = args; i > n; i--, arg = arg->tn_right)

Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.34 src/usr.bin/xlint/lint1/lint1.h:1.35
--- src/usr.bin/xlint/lint1/lint1.h:1.34	Tue Dec 29 12:18:42 2020
+++ src/usr.bin/xlint/lint1/lint1.h	Tue Dec 29 21:32:46 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.34 2020/12/29 12:18:42 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.35 2020/12/29 21:32:46 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -266,7 +266,7 @@ typedef	struct sym {
 #define	s_args	u._s_args
 
 /*
- * Used to keep some informations about symbols before they are entered
+ * Used to keep some information about symbols before they are entered
  * into the symbol table.
  */
 typedef	struct sbuf {
@@ -388,7 +388,7 @@ typedef	struct clst {
 } clst_t;
 
 /*
- * Used to keep informations about nested control statements.
+ * Used to keep information about nested control statements.
  */
 typedef struct cstk {
 	int	c_env;			/* type of statement (T_IF, ...) */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.98 src/usr.bin/xlint/lint1/tree.c:1.99
--- src/usr.bin/xlint/lint1/tree.c:1.98	Tue Dec 29 13:33:03 2020
+++ src/usr.bin/xlint/lint1/tree.c	Tue Dec 29 21:32:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.98 2020/12/29 13:33:03 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.99 2020/12/29 21:32:46 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.98 2020/12/29 13:33:03 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.99 2020/12/29 21:32:46 rillig Exp $");
 #endif
 
 #include 
@@ -683,7 +683,7 @@ cconv(tnode_t *tn)

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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 20:56:28 UTC 2020

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

Log Message:
lint: untangle conditions in initstack_next_nobrace


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.41 src/usr.bin/xlint/lint1/init.c:1.42
--- src/usr.bin/xlint/lint1/init.c:1.41	Tue Dec 29 20:07:04 2020
+++ src/usr.bin/xlint/lint1/init.c	Tue Dec 29 20:56:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.41 2020/12/29 20:07:04 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.42 2020/12/29 20:56:28 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.41 2020/12/29 20:07:04 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.42 2020/12/29 20:56:28 rillig Exp $");
 #endif
 
 #include 
@@ -459,10 +459,11 @@ initstack_next_nobrace(void)
 	/* Make sure an entry with a scalar type is at the top of the stack. */
 	if (!initerr)
 		initstack_check_too_many();
-	while (!initerr && (initstk->i_type == NULL ||
-			!tspec_is_scalar(initstk->i_type->t_tspec))) {
-		if (!initerr)
-			initstack_push();
+	while (!initerr) {
+		if ((initstk->i_type != NULL &&
+		 tspec_is_scalar(initstk->i_type->t_tspec)))
+			break;
+		initstack_push();
 	}
 }
 



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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 20:07:04 UTC 2020

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

Log Message:
lint: clean up debug logging for initializations


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.40 src/usr.bin/xlint/lint1/init.c:1.41
--- src/usr.bin/xlint/lint1/init.c:1.40	Tue Dec 29 19:57:44 2020
+++ src/usr.bin/xlint/lint1/init.c	Tue Dec 29 20:07:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.40 2020/12/29 19:57:44 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.41 2020/12/29 20:07:04 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.40 2020/12/29 19:57:44 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.41 2020/12/29 20:07:04 rillig Exp $");
 #endif
 
 #include 
@@ -153,21 +153,20 @@ initstack_pop_item(void)
 	istk_t	*istk;
 	sym_t	*m;
 
+	istk = initstk;
 	DPRINTF(("%s: pop type=%s, brace=%d remaining=%d named=%d\n", __func__,
-	tyname(buf, sizeof(buf),
-		initstk->i_type ? initstk->i_type : initstk->i_subt),
-	initstk->i_brace, initstk->i_cnt, initstk->i_namedmem));
+	tyname(buf, sizeof buf, istk->i_type ? istk->i_type : istk->i_subt),
+	istk->i_brace, istk->i_cnt, istk->i_namedmem));
 
-	initstk = (istk = initstk)->i_nxt;
+	initstk = istk->i_nxt;
 	free(istk);
 	istk = initstk;
 	if (istk == NULL)
 		LERROR("initstack_pop_item()");
 
 	DPRINTF(("%s: top type=%s, brace=%d remaining=%d named=%d\n", __func__,
-	tyname(buf, sizeof(buf),
-		initstk->i_type ? initstk->i_type : initstk->i_subt),
-	initstk->i_brace, initstk->i_cnt, initstk->i_namedmem));
+	tyname(buf, sizeof buf, istk->i_type ? istk->i_type : istk->i_subt),
+	istk->i_brace, istk->i_cnt, istk->i_namedmem));
 
 	istk->i_cnt--;
 	if (istk->i_cnt < 0)



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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 19:57:44 UTC 2020

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

Log Message:
lint: make debug output for initializations more uniform


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.39 src/usr.bin/xlint/lint1/init.c:1.40
--- src/usr.bin/xlint/lint1/init.c:1.39	Tue Dec 29 19:09:53 2020
+++ src/usr.bin/xlint/lint1/init.c	Tue Dec 29 19:57:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.39 2020/12/29 19:09:53 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.40 2020/12/29 19:57:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.39 2020/12/29 19:09:53 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.40 2020/12/29 19:57:44 rillig Exp $");
 #endif
 
 #include 
@@ -153,18 +153,18 @@ initstack_pop_item(void)
 	istk_t	*istk;
 	sym_t	*m;
 
-	DPRINTF(("%s+(%s): brace=%d remaining=%d namedmem %d\n", __func__,
+	DPRINTF(("%s: pop type=%s, brace=%d remaining=%d named=%d\n", __func__,
 	tyname(buf, sizeof(buf),
 		initstk->i_type ? initstk->i_type : initstk->i_subt),
 	initstk->i_brace, initstk->i_cnt, initstk->i_namedmem));
+
 	initstk = (istk = initstk)->i_nxt;
 	free(istk);
-
 	istk = initstk;
 	if (istk == NULL)
 		LERROR("initstack_pop_item()");
 
-	DPRINTF(("%s-(%s): brace=%d remaining=%d namedmem %d\n", __func__,
+	DPRINTF(("%s: top type=%s, brace=%d remaining=%d named=%d\n", __func__,
 	tyname(buf, sizeof(buf),
 		initstk->i_type ? initstk->i_type : initstk->i_subt),
 	initstk->i_brace, initstk->i_cnt, initstk->i_namedmem));
@@ -173,16 +173,18 @@ initstack_pop_item(void)
 	if (istk->i_cnt < 0)
 		LERROR("initstack_pop_item()");
 
-	DPRINTF(("%s(): remaining=%d name=%s\n", __func__, istk->i_cnt,
-	namedmem ? namedmem->n_name : "*null*"));
+	DPRINTF(("%s: top remaining=%d rhs.name=%s\n", __func__,
+	istk->i_cnt, namedmem ? namedmem->n_name : "*null*"));
+
 	if (istk->i_cnt >= 0 && namedmem != NULL) {
-		DPRINTF(("%s(): remaining=%d type=%s name=%s\n", __func__,
-		istk->i_cnt, tyname(buf, sizeof(buf), istk->i_type),
-		namedmem->n_name));
+
+		DPRINTF(("%s: named remaining=%d type=%s, rhs.name=%s\n",
+		__func__, istk->i_cnt,
+		tyname(buf, sizeof(buf), istk->i_type), namedmem->n_name));
 
 		for (m = istk->i_type->t_str->memb; m != NULL; m = m->s_nxt) {
-			DPRINTF(("%s(): pop [%s %s]\n", __func__,
-			namedmem->n_name, m->s_name));
+			DPRINTF(("%s: pop lhs.name=%s rhs.name=%s\n", __func__,
+			m->s_name, namedmem->n_name));
 			if (m->s_field && m->s_name == unnamed)
 continue;
 			if (strcmp(m->s_name, namedmem->n_name) == 0) {
@@ -193,7 +195,7 @@ initstack_pop_item(void)
 			}
 		}
 		error(101, namedmem->n_name);
-		DPRINTF(("%s(): namedmem %s\n", __func__, namedmem->n_name));
+		DPRINTF(("%s: end rhs.name=%s\n", __func__, namedmem->n_name));
 		pop_member();
 		istk->i_namedmem = 1;
 		return;
@@ -208,7 +210,7 @@ initstack_pop_item(void)
 			m = istk->i_mem = istk->i_mem->s_nxt;
 			if (m == NULL)
 LERROR("initstack_pop_item()");
-			DPRINTF(("%s(): pop %s\n", __func__, m->s_name));
+			DPRINTF(("%s: pop %s\n", __func__, m->s_name));
 		} while (m->s_field && m->s_name == unnamed);
 		istk->i_subt = m->s_type;
 	}
@@ -328,14 +330,14 @@ again:
 			return;
 		}
 		cnt = 0;
-		DPRINTF(("%s: 2. member lookup %s %s i_namedmem=%d\n", __func__,
+		DPRINTF(("%s: lookup type=%s, name=%s named=%d\n", __func__,
 		tyname(buf, sizeof(buf), istk->i_type),
 		namedmem ? namedmem->n_name : "*none*", istk->i_namedmem));
 		for (m = istk->i_type->t_str->memb; m != NULL; m = m->s_nxt) {
 			if (m->s_field && m->s_name == unnamed)
 continue;
 			if (namedmem != NULL) {
-DPRINTF(("%s():[member:%s, looking:%s]\n",
+DPRINTF(("%s: named lhs.member=%s, rhs.member=%s\n",
 __func__, m->s_name, namedmem->n_name));
 if (strcmp(m->s_name, namedmem->n_name) == 0) {
 	cnt++;
@@ -350,19 +352,19 @@ again:
 		}
 		if (namedmem != NULL) {
 			if (m == NULL) {
-DPRINTF(("%s(): struct pop\n", __func__));
+DPRINTF(("%s: pop struct\n", __func__));
 goto pop;
 			}
 			istk->i_mem = m;
 			istk->i_subt = m->s_type;
 			istk->i_namedmem = 1;
-			DPRINTF(("%s(): namedmem %s\n", __func__,
+			DPRINTF(("%s: named name=%s\n", __func__,
 			namedmem->n_name));
 			pop_member();
 			cnt = istk->i_type->t_tspec == STRUCT ? 2 : 1;
 		}
 		istk->i_brace = 1;
-		DPRINTF(("%s(): %s brace=%d\n", __func__,
+		DPRINTF(("%s: unnamed type=%s, brace=%d\n", __func__,
 		tyname(buf, sizeof(buf),
 			istk->i_type ? istk->i_type : istk->i_subt),
 		istk->i_brace));
@@ -376,7 +378,7 @@ again:
 		break;
 	default:
 		if 

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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 19:09:53 UTC 2020

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

Log Message:
lint: remove redundant function prototypes


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.38 src/usr.bin/xlint/lint1/init.c:1.39
--- src/usr.bin/xlint/lint1/init.c:1.38	Tue Dec 29 19:02:16 2020
+++ src/usr.bin/xlint/lint1/init.c	Tue Dec 29 19:09:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.38 2020/12/29 19:02:16 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.39 2020/12/29 19:09:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.38 2020/12/29 19:02:16 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.39 2020/12/29 19:09:53 rillig Exp $");
 #endif
 
 #include 
@@ -69,13 +69,7 @@ typedef struct namlist {
 namlist_t	*namedmem = NULL;
 
 
-static	void	initstack_push(void);
-static	void	initstack_check_too_many(void);
-static	void	initstack_pop_brace(void);
-static	void	initstack_pop_nobrace(void);
-static	void	initstack_pop_item(void);
 static	int	initstack_string(tnode_t *);
-static	void	pop_member(void);
 
 #ifndef DEBUG
 #define DPRINTF(a)



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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 19:02:16 UTC 2020

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

Log Message:
lint: improve debug output for initializing structs

Still trying to find out where the wrong warning in d_struct_init_nested
comes from.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.37 src/usr.bin/xlint/lint1/init.c:1.38
--- src/usr.bin/xlint/lint1/init.c:1.37	Tue Dec 29 16:59:12 2020
+++ src/usr.bin/xlint/lint1/init.c	Tue Dec 29 19:02:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.37 2020/12/29 16:59:12 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.38 2020/12/29 19:02:16 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.37 2020/12/29 16:59:12 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.38 2020/12/29 19:02:16 rillig Exp $");
 #endif
 
 #include 
@@ -136,6 +136,8 @@ initstack_init(void)
 		free(istk);
 	}
 
+	DPRINTF(("%s\n", __func__));
+
 	/*
 	 * If the type which is to be initialized is an incomplete type,
 	 * it must be duplicated.
@@ -146,7 +148,6 @@ initstack_init(void)
 	istk = initstk = xcalloc(1, sizeof (istk_t));
 	istk->i_subt = initsym->s_type;
 	istk->i_cnt = 1;
-
 }
 
 static void
@@ -158,7 +159,7 @@ initstack_pop_item(void)
 	istk_t	*istk;
 	sym_t	*m;
 
-	DPRINTF(("%s+(%s): brace=%d count=%d namedmem %d\n", __func__,
+	DPRINTF(("%s+(%s): brace=%d remaining=%d namedmem %d\n", __func__,
 	tyname(buf, sizeof(buf),
 		initstk->i_type ? initstk->i_type : initstk->i_subt),
 	initstk->i_brace, initstk->i_cnt, initstk->i_namedmem));
@@ -169,7 +170,7 @@ initstack_pop_item(void)
 	if (istk == NULL)
 		LERROR("initstack_pop_item()");
 
-	DPRINTF(("%s-(%s): brace=%d count=%d namedmem %d\n", __func__,
+	DPRINTF(("%s-(%s): brace=%d remaining=%d namedmem %d\n", __func__,
 	tyname(buf, sizeof(buf),
 		initstk->i_type ? initstk->i_type : initstk->i_subt),
 	initstk->i_brace, initstk->i_cnt, initstk->i_namedmem));
@@ -178,11 +179,13 @@ initstack_pop_item(void)
 	if (istk->i_cnt < 0)
 		LERROR("initstack_pop_item()");
 
-	DPRINTF(("%s(): %d %s\n", __func__, istk->i_cnt,
+	DPRINTF(("%s(): remaining=%d name=%s\n", __func__, istk->i_cnt,
 	namedmem ? namedmem->n_name : "*null*"));
 	if (istk->i_cnt >= 0 && namedmem != NULL) {
-		DPRINTF(("%s(): %d %s %s\n", __func__, istk->i_cnt,
-		tyname(buf, sizeof(buf), istk->i_type), namedmem->n_name));
+		DPRINTF(("%s(): remaining=%d type=%s name=%s\n", __func__,
+		istk->i_cnt, tyname(buf, sizeof(buf), istk->i_type),
+		namedmem->n_name));
+
 		for (m = istk->i_type->t_str->memb; m != NULL; m = m->s_nxt) {
 			DPRINTF(("%s(): pop [%s %s]\n", __func__,
 			namedmem->n_name, m->s_name));
@@ -229,7 +232,7 @@ initstack_pop_brace(void)
 	DPRINTF(("%s\n", __func__));
 	do {
 		brace = initstk->i_brace;
-		DPRINTF(("%s: loop %d\n", __func__, brace));
+		DPRINTF(("%s: loop brace=%d\n", __func__, brace));
 		initstack_pop_item();
 	} while (!brace);
 	DPRINTF(("%s: done\n", __func__));
@@ -561,7 +564,7 @@ mkinit(tnode_t *tn)
 		return;
 
 	initstk->i_cnt--;
-	DPRINTF(("%s() cnt=%d tn=%p\n", __func__, initstk->i_cnt, tn));
+	DPRINTF(("%s() remaining=%d tn=%p\n", __func__, initstk->i_cnt, tn));
 	/* Create a temporary node for the left side. */
 	ln = tgetblk(sizeof (tnode_t));
 	ln->tn_op = NAME;
@@ -582,7 +585,7 @@ mkinit(tnode_t *tn)
 		return;
 
 	/*
-	 * Store the tree memory. This is nessesary because otherwise
+	 * Store the tree memory. This is necessary because otherwise
 	 * expr() would free it.
 	 */
 	tmem = tsave();



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

2020-12-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec 29 17:53:08 UTC 2020

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

Log Message:
Add /var/db/obsolete/xdebug


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 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/xdebug/mi
diff -u src/distrib/sets/lists/xdebug/mi:1.40 src/distrib/sets/lists/xdebug/mi:1.41
--- src/distrib/sets/lists/xdebug/mi:1.40	Tue Dec 29 12:43:36 2020
+++ src/distrib/sets/lists/xdebug/mi	Tue Dec 29 17:53:08 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.40 2020/12/29 12:43:36 martin Exp $
+# $NetBSD: mi,v 1.41 2020/12/29 17:53:08 martin Exp $
 ./etc/mtree/set.xdebug	comp-sys-root
 ./usr/X11R7/lib		base-x11-root	xorg,debuglib,compatx11dir
 ./usr/X11R7/lib/libEGL_g.axdebug-libEGL-debuglib	xorg,debuglib,compatx11file,xorg_glamor
@@ -235,3 +235,4 @@
 ./usr/libdata/debug/usr/X11R7/bin/xwud.debug		xdebug-xwud-debug	xorg,debug
 ./usr/libdata/debug/usr/X11R7/lib/modules/dri/gallium_dri.so.0.debug	xdebug-gallium-debug		xorg,debug
 ./usr/libdata/debug/usr/X11R7/libexec/chooser.debug	xdebug-chooser-debug	xorg,debug
+./var/db/obsolete/xdebugbase-sys-root		xorg,debug



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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 17:29:31 UTC 2020

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

Log Message:
lint: split complete_tag into separate functions


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.77 -r1.78 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/xlint/lint1/externs1.h

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

Modified files:

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.115 src/usr.bin/xlint/lint1/cgram.y:1.116
--- src/usr.bin/xlint/lint1/cgram.y:1.115	Tue Dec 29 16:48:53 2020
+++ src/usr.bin/xlint/lint1/cgram.y	Tue Dec 29 17:29:31 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.115 2020/12/29 16:48:53 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.116 2020/12/29 17:29:31 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.115 2020/12/29 16:48:53 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.116 2020/12/29 17:29:31 rillig Exp $");
 #endif
 
 #include 
@@ -705,12 +705,12 @@ struct_spec:
 	| struct struct_tag {
 		dcs->d_tagtyp = mktag($2, $1, 1, 0);
 	  } struct_declaration {
-		$$ = complete_tag(dcs->d_tagtyp, $4);
+		$$ = complete_tag_struct_or_union(dcs->d_tagtyp, $4);
 	  }
 	| struct {
 		dcs->d_tagtyp = mktag(NULL, $1, 1, 0);
 	  } struct_declaration {
-		$$ = complete_tag(dcs->d_tagtyp, $3);
+		$$ = complete_tag_struct_or_union(dcs->d_tagtyp, $3);
 	  }
 	| struct error {
 		symtyp = FVFT;
@@ -901,12 +901,12 @@ enum_spec:
 	| enum enum_tag {
 		dcs->d_tagtyp = mktag($2, ENUM, 1, 0);
 	  } enum_declaration {
-		$$ = complete_tag(dcs->d_tagtyp, $4);
+		$$ = complete_tag_enum(dcs->d_tagtyp, $4);
 	  }
 	| enum {
 		dcs->d_tagtyp = mktag(NULL, ENUM, 1, 0);
 	  } enum_declaration {
-		$$ = complete_tag(dcs->d_tagtyp, $3);
+		$$ = complete_tag_enum(dcs->d_tagtyp, $3);
 	  }
 	| enum error {
 		symtyp = FVFT;

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.77 src/usr.bin/xlint/lint1/decl.c:1.78
--- src/usr.bin/xlint/lint1/decl.c:1.77	Tue Dec 29 13:33:03 2020
+++ src/usr.bin/xlint/lint1/decl.c	Tue Dec 29 17:29:31 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.77 2020/12/29 13:33:03 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.78 2020/12/29 17:29:31 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.77 2020/12/29 13:33:03 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.78 2020/12/29 17:29:31 rillig Exp $");
 #endif
 
 #include 
@@ -1773,10 +1773,10 @@ storage_class_name(scl_t sc)
 }
 
 /*
- * tp points to the type of the tag, fmem to the list of members/enums.
+ * tp points to the type of the tag, fmem to the list of members.
  */
 type_t *
-complete_tag(type_t *tp, sym_t *fmem)
+complete_tag_struct_or_union(type_t *tp, sym_t *fmem)
 {
 	tspec_t	t;
 	str_t	*sp;
@@ -1785,47 +1785,53 @@ complete_tag(type_t *tp, sym_t *fmem)
 
 	setcomplete(tp, 1);
 
-	if ((t = tp->t_tspec) != ENUM) {
-		align(dcs->d_stralign, 0);
-		sp = tp->t_str;
-		sp->align = dcs->d_stralign;
-		sp->memb = fmem;
-		if (tp->t_ispacked)
-			setpackedsize(tp);
-		else
-			sp->size = dcs->d_offset;
-
-		if (sp->size == 0) {
-			/* zero sized %s */
-			(void)c99ism(47, ttab[t].tt_name);
-		}
+	t = tp->t_tspec;
+	align(dcs->d_stralign, 0);
+	sp = tp->t_str;
+	sp->align = dcs->d_stralign;
+	sp->memb = fmem;
+	if (tp->t_ispacked)
+		setpackedsize(tp);
+	else
+		sp->size = dcs->d_offset;
 
-		n = 0;
-		for (mem = fmem; mem != NULL; mem = mem->s_nxt) {
-			/* bind anonymous members to the structure */
-			if (mem->s_styp == NULL) {
-mem->s_styp = sp;
-if (mem->s_type->t_isfield) {
-	sp->size += bitfieldsize();
-	if (mem == NULL)
-		break;
-}
-sp->size += tsize(mem->s_type);
+	if (sp->size == 0) {
+		/* zero sized %s */
+		(void)c99ism(47, ttab[t].tt_name);
+	}
+
+	n = 0;
+	for (mem = fmem; mem != NULL; mem = mem->s_nxt) {
+		/* bind anonymous members to the structure */
+		if (mem->s_styp == NULL) {
+			mem->s_styp = sp;
+			if (mem->s_type->t_isfield) {
+sp->size += bitfieldsize();
+if (mem == NULL)
+	break;
 			}
-			if (mem->s_name != unnamed)
-n++;
+			sp->size += tsize(mem->s_type);
 		}
+		if (mem->s_name != unnamed)
+			n++;
+	}
 
-		if (n == 0 && sp->size != 0) {
-			/* %s has no named members */
-			warning(65, t == STRUCT ? "structure" : "union");
-		}
-	} else {
-		tp->t_enum->elem = fmem;
+	if (n == 0 && sp->size != 0) {
+		/* %s has no named members */
+		warning(65, t == STRUCT ? "structure" : "union");
 	}
 	return tp;
 }
 
+type_t *
+complete_tag_enum(type_t *tp, sym_t *fmem)
+{
+
+	setcomplete(tp, 1);
+	

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

2020-12-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Dec 29 17:17:14 UTC 2020

Modified Files:
src/sys/arch/luna68k/dev: lcd.c siotty.c xp.c

Log Message:
Make local functions static.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/luna68k/dev/lcd.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/luna68k/dev/siotty.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/dev/xp.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/luna68k/dev/lcd.c
diff -u src/sys/arch/luna68k/dev/lcd.c:1.11 src/sys/arch/luna68k/dev/lcd.c:1.12
--- src/sys/arch/luna68k/dev/lcd.c:1.11	Sun Jun 30 05:04:48 2019
+++ src/sys/arch/luna68k/dev/lcd.c	Tue Dec 29 17:17:14 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lcd.c,v 1.11 2019/06/30 05:04:48 tsutsui Exp $ */
+/* $NetBSD: lcd.c,v 1.12 2020/12/29 17:17:14 tsutsui Exp $ */
 /* $OpenBSD: lcd.c,v 1.7 2015/02/10 22:42:35 miod Exp $ */
 
 /*-
@@ -32,7 +32,7 @@
 
 #include 		/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lcd.c,v 1.11 2019/06/30 05:04:48 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lcd.c,v 1.12 2020/12/29 17:17:14 tsutsui Exp $");
 
 #include 
 #include 
@@ -82,10 +82,10 @@ struct pio {
 static int  lcd_match(device_t, cfdata_t, void *);
 static void lcd_attach(device_t, device_t, void *);
 
-dev_type_open(lcdopen);
-dev_type_close(lcdclose);
-dev_type_write(lcdwrite);
-dev_type_ioctl(lcdioctl);
+static dev_type_open(lcdopen);
+static dev_type_close(lcdclose);
+static dev_type_write(lcdwrite);
+static dev_type_ioctl(lcdioctl);
 
 const struct cdevsw lcd_cdevsw = {
 	.d_open = lcdopen,
@@ -111,11 +111,11 @@ struct lcd_softc {
 CFATTACH_DECL_NEW(lcd, sizeof(struct lcd_softc),
 lcd_match, lcd_attach, NULL, NULL);
 
-void lcdbusywait(void);
-void lcdput(int);
-void lcdctrl(int);
-void lcdshow(char *);
-void greeting(void);
+static void lcdbusywait(void);
+static void lcdput(int);
+static void lcdctrl(int);
+static void lcdshow(char *);
+static void greeting(void);
 			   /* "1234567890123456" */
 static char lcd_boot_message1[] = " NetBSD/luna68k ";
 static char lcd_boot_message2[] = "   SX-9100/DT   ";
@@ -148,7 +148,7 @@ lcd_attach(device_t parent, device_t sel
 /*
  * open/close/write/ioctl
  */
-int
+static int
 lcdopen(dev_t dev, int flags, int fmt, struct lwp *l)
 {
 	int unit;
@@ -165,7 +165,7 @@ lcdopen(dev_t dev, int flags, int fmt, s
 	return 0;
 }
 
-int
+static int
 lcdclose(dev_t dev, int flags, int fmt, struct lwp *l)
 {
 	int unit;
@@ -178,7 +178,7 @@ lcdclose(dev_t dev, int flags, int fmt, 
 	return 0;
 }
 
-int
+static int
 lcdwrite(dev_t dev, struct uio *uio, int flag)
 {
 	int error;
@@ -201,7 +201,7 @@ lcdwrite(dev_t dev, struct uio *uio, int
 	return 0;
 }
 
-int
+static int
 lcdioctl(dev_t dev, u_long cmd, void *addr, int flag, struct lwp *l)
 {
 	int val;
@@ -278,7 +278,7 @@ lcdioctl(dev_t dev, u_long cmd, void *ad
 	return EPASSTHROUGH;
 }
 
-void
+static void
 lcdbusywait(void)
 {
 	struct pio *p1 = (struct pio *)OBIO_PIO1_BASE;
@@ -299,7 +299,7 @@ lcdbusywait(void)
 	splx(s);
 }	
 
-void
+static void
 lcdput(int cc)
 {
 	struct pio *p1 = (struct pio *)OBIO_PIO1_BASE;
@@ -316,7 +316,7 @@ lcdput(int cc)
 	splx(s);
 }
 
-void
+static void
 lcdctrl(int cc)
 {
 	struct pio *p1 = (struct pio *)OBIO_PIO1_BASE;
@@ -333,7 +333,7 @@ lcdctrl(int cc)
 	splx(s);
 }
 
-void
+static void
 lcdshow(char *s)
 {
 	int cc;
@@ -342,7 +342,7 @@ lcdshow(char *s)
 		lcdput(cc);
 }
 
-void
+static void
 greeting(void)
 {
 

Index: src/sys/arch/luna68k/dev/siotty.c
diff -u src/sys/arch/luna68k/dev/siotty.c:1.46 src/sys/arch/luna68k/dev/siotty.c:1.47
--- src/sys/arch/luna68k/dev/siotty.c:1.46	Tue Oct  1 18:00:07 2019
+++ src/sys/arch/luna68k/dev/siotty.c	Tue Dec 29 17:17:14 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: siotty.c,v 1.46 2019/10/01 18:00:07 chs Exp $ */
+/* $NetBSD: siotty.c,v 1.47 2020/12/29 17:17:14 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.46 2019/10/01 18:00:07 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.47 2020/12/29 17:17:14 tsutsui Exp $");
 
 #include "opt_ddb.h"
 
@@ -119,14 +119,14 @@ static void siotty_attach(device_t, devi
 CFATTACH_DECL_NEW(siotty, sizeof(struct siotty_softc),
 siotty_match, siotty_attach, NULL, NULL);
 
-dev_type_open(sioopen);
-dev_type_close(sioclose);
-dev_type_read(sioread);
-dev_type_write(siowrite);
-dev_type_ioctl(sioioctl);
-dev_type_stop(siostop);
-dev_type_tty(siotty);
-dev_type_poll(siopoll);
+static dev_type_open(sioopen);
+static dev_type_close(sioclose);
+static dev_type_read(sioread);
+static dev_type_write(siowrite);
+static dev_type_ioctl(sioioctl);
+static dev_type_stop(siostop);
+static dev_type_tty(siotty);
+static dev_type_poll(siopoll);
 
 const struct cdevsw siotty_cdevsw = {
 	.d_open = sioopen,
@@ -367,7 

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

2020-12-29 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Dec 29 17:16:15 UTC 2020

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

Log Message:
>From the Infinitesimal Optimizations Department: in pmap_kremove(), update
the globally visible stats outside of the loop.


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

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

Modified files:

Index: src/sys/arch/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.273 src/sys/arch/alpha/alpha/pmap.c:1.274
--- src/sys/arch/alpha/alpha/pmap.c:1.273	Fri Sep 11 03:54:14 2020
+++ src/sys/arch/alpha/alpha/pmap.c	Tue Dec 29 17:16:15 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.273 2020/09/11 03:54:14 simonb Exp $ */
+/* $NetBSD: pmap.c,v 1.274 2020/12/29 17:16:15 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008, 2020
@@ -135,7 +135,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.273 2020/09/11 03:54:14 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.274 2020/12/29 17:16:15 thorpej Exp $");
 
 #include 
 #include 
@@ -2309,6 +2309,7 @@ pmap_kremove(vaddr_t va, vsize_t size)
 	pt_entry_t *pte, opte;
 	pmap_t const pmap = pmap_kernel();
 	struct pmap_tlb_context tlbctx;
+	int count = 0;
 
 #ifdef DEBUG
 	if (pmapdebug & (PDB_FOLLOW|PDB_ENTER))
@@ -2330,12 +2331,16 @@ pmap_kremove(vaddr_t va, vsize_t size)
 			atomic_store_relaxed(pte, PG_NV);
 			pmap_tlb_shootdown(pmap, va, opte, );
 
-			/* Update stats. */
-			PMAP_STAT_DECR(pmap->pm_stats.resident_count, 1);
-			PMAP_STAT_DECR(pmap->pm_stats.wired_count, 1);
+			count++;
 		}
 	}
 
+	/* Update stats. */
+	if (__predict_true(count != 0)) {
+		PMAP_STAT_DECR(pmap->pm_stats.resident_count, count);
+		PMAP_STAT_DECR(pmap->pm_stats.wired_count, count);
+	}
+
 	pmap_tlb_shootnow();
 	TLB_COUNT(reason_kremove);
 }



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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 16:59:12 UTC 2020

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

Log Message:
lint: split initstack_next into separate functions


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.36 src/usr.bin/xlint/lint1/init.c:1.37
--- src/usr.bin/xlint/lint1/init.c:1.36	Tue Dec 29 16:53:36 2020
+++ src/usr.bin/xlint/lint1/init.c	Tue Dec 29 16:59:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.36 2020/12/29 16:53:36 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.37 2020/12/29 16:59:12 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.36 2020/12/29 16:53:36 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.37 2020/12/29 16:59:12 rillig Exp $");
 #endif
 
 #include 
@@ -70,7 +70,6 @@ namlist_t	*namedmem = NULL;
 
 
 static	void	initstack_push(void);
-static	void	initstack_next(int);
 static	void	initstack_check_too_many(void);
 static	void	initstack_pop_brace(void);
 static	void	initstack_pop_nobrace(void);
@@ -424,49 +423,49 @@ initstack_check_too_many(void)
 }
 
 static void
-initstack_next(int brace)
+initstack_next_brace(void)
 {
 	char buf[64];
 
-	DPRINTF(("%s(%d)\n", __func__, brace));
-	if (!brace) {
-		if (initstk->i_type == NULL &&
-		!tspec_is_scalar(initstk->i_subt->t_tspec)) {
-			/* {}-enclosed initializer required */
-			error(181);
-		}
-		/*
-		 * Make sure an entry with a scalar type is at the top
-		 * of the stack.
-		 */
-		if (!initerr)
-			initstack_check_too_many();
-		while (!initerr && (initstk->i_type == NULL ||
-!tspec_is_scalar(
-initstk->i_type->t_tspec))) {
-			if (!initerr)
-initstack_push();
-		}
-	} else {
-		if (initstk->i_type != NULL &&
-		tspec_is_scalar(initstk->i_type->t_tspec)) {
-			/* invalid initializer */
-			error(176, tyname(buf, sizeof(buf), initstk->i_type));
-			initerr = 1;
-		}
-		if (!initerr)
-			initstack_check_too_many();
+	DPRINTF(("%s\n", __func__));
+	if (initstk->i_type != NULL &&
+	tspec_is_scalar(initstk->i_type->t_tspec)) {
+		/* invalid initializer */
+		error(176, tyname(buf, sizeof(buf), initstk->i_type));
+		initerr = 1;
+	}
+	if (!initerr)
+		initstack_check_too_many();
+	if (!initerr)
+		initstack_push();
+	if (!initerr) {
+		initstk->i_brace = 1;
+		DPRINTF(("%s(): %p %s brace=%d\n", __func__,
+		namedmem,
+		tyname(buf, sizeof(buf),
+			initstk->i_type ? initstk->i_type : initstk->i_subt),
+		initstk->i_brace));
+	}
+}
+
+static void
+initstack_next_nobrace(void)
+{
+
+	DPRINTF(("%s\n", __func__));
+	if (initstk->i_type == NULL &&
+	!tspec_is_scalar(initstk->i_subt->t_tspec)) {
+		/* {}-enclosed initializer required */
+		error(181);
+	}
+
+	/* Make sure an entry with a scalar type is at the top of the stack. */
+	if (!initerr)
+		initstack_check_too_many();
+	while (!initerr && (initstk->i_type == NULL ||
+			!tspec_is_scalar(initstk->i_type->t_tspec))) {
 		if (!initerr)
 			initstack_push();
-		if (!initerr) {
-			initstk->i_brace = 1;
-			DPRINTF(("%s(): %p %s brace=%d\n", __func__,
-			namedmem,
-			tyname(buf, sizeof(buf),
-initstk->i_type ? initstk->i_type
-		: initstk->i_subt),
-			initstk->i_brace));
-		}
 	}
 }
 
@@ -491,7 +490,7 @@ init_lbrace(void)
 	 */
 	initstack_pop_nobrace();
 
-	initstack_next(1);
+	initstack_next_brace();
 }
 
 void
@@ -557,7 +556,7 @@ mkinit(tnode_t *tn)
 	if (initstack_string(tn))
 		return;
 
-	initstack_next(0);
+	initstack_next_nobrace();
 	if (initerr || tn == NULL)
 		return;
 



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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 16:53:36 UTC 2020

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

Log Message:
lint: split initstack_pop into separate functions


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.35 src/usr.bin/xlint/lint1/init.c:1.36
--- src/usr.bin/xlint/lint1/init.c:1.35	Tue Dec 29 16:48:53 2020
+++ src/usr.bin/xlint/lint1/init.c	Tue Dec 29 16:53:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.35 2020/12/29 16:48:53 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.36 2020/12/29 16:53:36 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.35 2020/12/29 16:48:53 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.36 2020/12/29 16:53:36 rillig Exp $");
 #endif
 
 #include 
@@ -72,7 +72,8 @@ namlist_t	*namedmem = NULL;
 static	void	initstack_push(void);
 static	void	initstack_next(int);
 static	void	initstack_check_too_many(void);
-static	void	initstack_pop(int);
+static	void	initstack_pop_brace(void);
+static	void	initstack_pop_nobrace(void);
 static	void	initstack_pop_item(void);
 static	int	initstack_string(tnode_t *);
 static	void	pop_member(void);
@@ -217,36 +218,36 @@ initstack_pop_item(void)
 	}
 }
 
+/*
+ * Take all entries, including the first which requires a closing brace,
+ * from the stack.
+ */
 static void
-initstack_pop(int brace)
+initstack_pop_brace(void)
 {
-	DPRINTF(("%s(%d)\n", __func__, brace));
+	int brace;
 
-	if (brace) {
-		/*
-		 * Take all entries, including the first which requires
-		 * a closing brace, from the stack.
-		 */
-		DPRINTF(("%s: brace\n", __func__));
-		do {
-			brace = initstk->i_brace;
-			DPRINTF(("%s: loop brace %d\n", __func__, brace));
-			initstack_pop_item();
-		} while (!brace);
-		DPRINTF(("%s: brace done\n", __func__));
-	} else {
-		/*
-		 * Take all entries which cannot be used for further
-		 * initializers from the stack, but do this only if
-		 * they do not require a closing brace.
-		 */
-		DPRINTF(("%s: no brace\n", __func__));
-		while (!initstk->i_brace &&
-		   initstk->i_cnt == 0 && !initstk->i_nolimit) {
-			initstack_pop_item();
-		}
-		DPRINTF(("%s: no brace done\n", __func__));
-	}
+	DPRINTF(("%s\n", __func__));
+	do {
+		brace = initstk->i_brace;
+		DPRINTF(("%s: loop %d\n", __func__, brace));
+		initstack_pop_item();
+	} while (!brace);
+	DPRINTF(("%s: done\n", __func__));
+}
+
+/*
+ * Take all entries which cannot be used for further initializers from the
+ * stack, but do this only if they do not require a closing brace.
+ */
+static void
+initstack_pop_nobrace(void)
+{
+
+	DPRINTF(("%s\n", __func__));
+	while (!initstk->i_brace && initstk->i_cnt == 0 && !initstk->i_nolimit)
+		initstack_pop_item();
+	DPRINTF(("%s: done\n", __func__));
 }
 
 static void
@@ -488,7 +489,7 @@ init_lbrace(void)
 	 * Remove all entries which cannot be used for further initializers
 	 * and do not expect a closing brace.
 	 */
-	initstack_pop(0);
+	initstack_pop_nobrace();
 
 	initstack_next(1);
 }
@@ -501,7 +502,7 @@ init_rbrace(void)
 	if (initerr)
 		return;
 
-	initstack_pop(1);
+	initstack_pop_brace();
 }
 
 void
@@ -550,7 +551,7 @@ mkinit(tnode_t *tn)
 	 * Remove all entries which cannot be used for further initializers
 	 * and do not require a closing brace.
 	 */
-	initstack_pop(0);
+	initstack_pop_nobrace();
 
 	/* Initialisations by strings are done in initstack_string(). */
 	if (initstack_string(tn))



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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 16:48:53 UTC 2020

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

Log Message:
lint: rename functions for handling the initialization stack


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.38 -r1.39 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/xlint/lint1/init.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.114 src/usr.bin/xlint/lint1/cgram.y:1.115
--- src/usr.bin/xlint/lint1/cgram.y:1.114	Tue Dec 29 13:33:03 2020
+++ src/usr.bin/xlint/lint1/cgram.y	Tue Dec 29 16:48:53 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.114 2020/12/29 13:33:03 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.115 2020/12/29 16:48:53 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.114 2020/12/29 13:33:03 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.115 2020/12/29 16:48:53 rillig Exp $");
 #endif
 
 #include 
@@ -2150,7 +2150,7 @@ idecl(sym_t *decl, int initflg, sbuf_t *
 	}
 
 	if (initflg && !initerr)
-		prepinit();
+		initstack_init();
 }
 
 /*

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.38 src/usr.bin/xlint/lint1/externs1.h:1.39
--- src/usr.bin/xlint/lint1/externs1.h:1.38	Tue Dec 29 13:33:03 2020
+++ src/usr.bin/xlint/lint1/externs1.h	Tue Dec 29 16:48:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.38 2020/12/29 13:33:03 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.39 2020/12/29 16:48:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -280,7 +280,7 @@ extern	int	initerr;
 extern	sym_t	*initsym;
 extern	int	startinit;
 
-extern	void	prepinit(void);
+extern	void	initstack_init(void);
 extern	void	init_rbrace(void);
 extern	void	init_lbrace(void);
 extern	void	mkinit(tnode_t *);

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.34 src/usr.bin/xlint/lint1/init.c:1.35
--- src/usr.bin/xlint/lint1/init.c:1.34	Tue Dec 29 13:33:03 2020
+++ src/usr.bin/xlint/lint1/init.c	Tue Dec 29 16:48:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.34 2020/12/29 13:33:03 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.35 2020/12/29 16:48:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.34 2020/12/29 13:33:03 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.35 2020/12/29 16:48:53 rillig Exp $");
 #endif
 
 #include 
@@ -69,12 +69,12 @@ typedef struct namlist {
 namlist_t	*namedmem = NULL;
 
 
-static	void	popi2(void);
-static	void	popinit(int);
-static	void	pushinit(void);
-static	void	testinit(void);
-static	void	nextinit(int);
-static	int	strginit(tnode_t *);
+static	void	initstack_push(void);
+static	void	initstack_next(int);
+static	void	initstack_check_too_many(void);
+static	void	initstack_pop(int);
+static	void	initstack_pop_item(void);
+static	int	initstack_string(tnode_t *);
 static	void	pop_member(void);
 
 #ifndef DEBUG
@@ -123,7 +123,7 @@ pop_member(void)
  * which is to be initialized on it.
  */
 void
-prepinit(void)
+initstack_init(void)
 {
 	istk_t	*istk;
 
@@ -150,7 +150,7 @@ prepinit(void)
 }
 
 static void
-popi2(void)
+initstack_pop_item(void)
 {
 #ifdef DEBUG
 	char	buf[64];
@@ -167,7 +167,7 @@ popi2(void)
 
 	istk = initstk;
 	if (istk == NULL)
-		LERROR("popi2()");
+		LERROR("initstack_pop_item()");
 
 	DPRINTF(("%s-(%s): brace=%d count=%d namedmem %d\n", __func__,
 	tyname(buf, sizeof(buf),
@@ -176,7 +176,7 @@ popi2(void)
 
 	istk->i_cnt--;
 	if (istk->i_cnt < 0)
-		LERROR("popi2()");
+		LERROR("initstack_pop_item()");
 
 	DPRINTF(("%s(): %d %s\n", __func__, istk->i_cnt,
 	namedmem ? namedmem->n_name : "*null*"));
@@ -210,7 +210,7 @@ popi2(void)
 		do {
 			m = istk->i_mem = istk->i_mem->s_nxt;
 			if (m == NULL)
-LERROR("popi2()");
+LERROR("initstack_pop_item()");
 			DPRINTF(("%s(): pop %s\n", __func__, m->s_name));
 		} while (m->s_field && m->s_name == unnamed);
 		istk->i_subt = m->s_type;
@@ -218,7 +218,7 @@ popi2(void)
 }
 
 static void
-popinit(int brace)
+initstack_pop(int brace)
 {
 	DPRINTF(("%s(%d)\n", __func__, brace));
 
@@ -231,7 +231,7 @@ popinit(int brace)
 		do {
 			brace = initstk->i_brace;
 			DPRINTF(("%s: loop brace %d\n", __func__, brace));
-			popi2();
+			initstack_pop_item();
 		} while (!brace);
 		DPRINTF(("%s: brace done\n", __func__));
 	} else {
@@ -243,14 +243,14 @@ popinit(int brace)
 		DPRINTF(("%s: no brace\n", __func__));
 		while (!initstk->i_brace &&
 		   initstk->i_cnt == 0 && !initstk->i_nolimit) {
-			popi2();
+			initstack_pop_item();
 		}
 		DPRINTF(("%s: no brace 

CVS commit: src/etc

2020-12-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec 29 16:46:44 UTC 2020

Modified Files:
src/etc: Makefile

Log Message:
If MKX11 and MKDEBUG, add the xdebug set to the obsolete file handling.


To generate a diff of this commit:
cvs rdiff -u -r1.448 -r1.449 src/etc/Makefile

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

Modified files:

Index: src/etc/Makefile
diff -u src/etc/Makefile:1.448 src/etc/Makefile:1.449
--- src/etc/Makefile:1.448	Wed Sep  9 12:06:02 2020
+++ src/etc/Makefile	Tue Dec 29 16:46:44 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.448 2020/09/09 12:06:02 jmcneill Exp $
+#	$NetBSD: Makefile,v 1.449 2020/12/29 16:46:44 martin Exp $
 #	from: @(#)Makefile	8.7 (Berkeley) 5/25/95
 
 # Environment variables without default values:
@@ -383,6 +383,9 @@ OBSOLETE.files+=	tests
 .endif
 .if ${MKX11} != "no"
 OBSOLETE.files+=	xbase xcomp xetc xfont xserver
+.if ${MKDEBUG} != "no"
+OBSOLETE.files+=	xdebug
+.endif
 .endif
 
 # XXX make "makeobsolete" set wise; then generate files respectively



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

2020-12-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Dec 29 16:02:01 UTC 2020

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

Log Message:
Use C99 designated initializers for struct consdev.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/hp300/dev/dcm.c

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

Modified files:

Index: src/sys/arch/hp300/dev/dcm.c
diff -u src/sys/arch/hp300/dev/dcm.c:1.88 src/sys/arch/hp300/dev/dcm.c:1.89
--- src/sys/arch/hp300/dev/dcm.c:1.88	Sat Nov 15 19:20:01 2014
+++ src/sys/arch/hp300/dev/dcm.c	Tue Dec 29 16:02:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dcm.c,v 1.88 2014/11/15 19:20:01 christos Exp $	*/
+/*	$NetBSD: dcm.c,v 1.89 2020/12/29 16:02:01 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.88 2014/11/15 19:20:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.89 2020/12/29 16:02:01 tsutsui Exp $");
 
 #include "opt_kgdb.h"
 
@@ -306,16 +306,11 @@ static	int dcm_lastcnpri = CN_DEAD; 	/* 
 #endif
 
 static struct consdev dcm_cons = {
-	NULL,
-	NULL,
-	dcmcngetc,
-	dcmcnputc,
-	nullcnpollc,
-	NULL,
-	NULL,
-	NULL,
-	NODEV,
-	CN_REMOTE
+	.cn_getc = dcmcngetc,
+	.cn_putc = dcmcnputc,
+	.cn_pollc = nullcnpollc,
+	.cn_dev = NODEV,
+	.cn_pri = CN_REMOTE
 };
 int	dcmconscode;
 int	dcmdefaultrate = DEFAULT_BAUD_RATE;



CVS commit: src/sys/dev/pci

2020-12-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 29 15:49:45 UTC 2020

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

Log Message:
KNF a comment


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/pci_map.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/pci_map.c
diff -u src/sys/dev/pci/pci_map.c:1.43 src/sys/dev/pci/pci_map.c:1.44
--- src/sys/dev/pci/pci_map.c:1.43	Tue Dec 29 15:49:13 2020
+++ src/sys/dev/pci/pci_map.c	Tue Dec 29 15:49:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_map.c,v 1.43 2020/12/29 15:49:13 skrll Exp $	*/
+/*	$NetBSD: pci_map.c,v 1.44 2020/12/29 15:49:45 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.43 2020/12/29 15:49:13 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.44 2020/12/29 15:49:45 skrll Exp $");
 
 #include 
 #include 
@@ -636,7 +636,8 @@ pci_mapreg_submap(const struct pci_attac
 		}
 	}
 
-	/* If we're called with maxsize/offset of 0, behave like
+	/*
+	 * If we're called with maxsize/offset of 0, behave like
 	 * pci_mapreg_map.
 	 */
 



CVS commit: src/sys/dev/pci

2020-12-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 29 15:49:13 UTC 2020

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

Log Message:
More of the patch that adds support for Enhanced Allocations as seen in
the Cavium ThunderX based GIGABYTE MT30-GS2-00

>From thorpej@. Thanks!

(botched the copying of this from a branch previously)


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/pci/pci_map.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/pci_map.c
diff -u src/sys/dev/pci/pci_map.c:1.42 src/sys/dev/pci/pci_map.c:1.43
--- src/sys/dev/pci/pci_map.c:1.42	Tue Dec 29 15:39:59 2020
+++ src/sys/dev/pci/pci_map.c	Tue Dec 29 15:49:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_map.c,v 1.42 2020/12/29 15:39:59 skrll Exp $	*/
+/*	$NetBSD: pci_map.c,v 1.43 2020/12/29 15:49:13 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.42 2020/12/29 15:39:59 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.43 2020/12/29 15:49:13 skrll Exp $");
 
 #include 
 #include 
@@ -575,31 +575,65 @@ pci_mapreg_submap(const struct pci_attac
 	bus_size_t realmaxsize;
 	pcireg_t csr;
 	int flags, s;
+	int ea_cap_ptr;
+	bool have_ea = false;
+	struct pci_ea_entry entry;
 
 	if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO) {
 		if ((pa->pa_flags & PCI_FLAGS_IO_OKAY) == 0)
 			return 1;
-		if (pci_io_find(pa->pa_pc, pa->pa_tag, reg, type, ,
-		, ))
-			return 1;
 		tag = pa->pa_iot;
 	} else {
 		if ((pa->pa_flags & PCI_FLAGS_MEM_OKAY) == 0)
 			return 1;
-		if (pci_mem_find(pa->pa_pc, pa->pa_tag, reg, type, ,
-		, ))
-			return 1;
 		tag = pa->pa_memt;
 	}
 
+	if (pci_get_capability(pa->pa_pc, pa->pa_tag, PCI_CAP_EA, _cap_ptr,
+	NULL)) {
+		have_ea = true;
+		if (pci_ea_find(pa->pa_pc, pa->pa_tag, ea_cap_ptr, reg, type,
+		, , , ))
+			return 1;
+		if (reg != PCI_MAPREG_ROM && !entry.enabled) {
+			/* Entry not enabled.  Try the regular BAR? */
+			have_ea = false;
+		}
+	}
+
+	if (!have_ea) {
+		if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO) {
+			if (pci_io_find(pa->pa_pc, pa->pa_tag, reg, type,
+			, , ))
+return 1;
+		} else {
+			if (pci_mem_find(pa->pa_pc, pa->pa_tag, reg, type,
+			, , ))
+return 1;
+		}
+	}
+
 	if (reg == PCI_MAPREG_ROM) {
-		pcireg_t 	mask;
-		/* we have to enable the ROM address decoder... */
-		s = splhigh();
-		mask = pci_conf_read(pa->pa_pc, pa->pa_tag, reg);
-		mask |= PCI_MAPREG_ROM_ENABLE;
-		pci_conf_write(pa->pa_pc, pa->pa_tag, reg, mask);
-		splx(s);
+		/* Enable the ROM address decoder, if necessary. */
+		if (have_ea) {
+			if (!entry.enabled) {
+entry.dw0 |= PCI_EA_E;
+pci_conf_write(pa->pa_pc, pa->pa_tag,
+entry.ea_ptrs[EA_ptr_dw0],
+entry.dw0);
+entry.enabled = true;
+			}
+		} else {
+			s = splhigh();
+			pcireg_t mask =
+			pci_conf_read(pa->pa_pc, pa->pa_tag, reg);
+			if ((mask & PCI_MAPREG_ROM_ENABLE) == 0) {
+mask |= PCI_MAPREG_ROM_ENABLE;
+pci_conf_write(pa->pa_pc, pa->pa_tag, reg,
+mask);
+			}
+			splx(s);
+		}
 	}
 
 	/* If we're called with maxsize/offset of 0, behave like



CVS commit: src/sys/dev/pci

2020-12-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 29 15:39:59 UTC 2020

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

Log Message:
Add support for Enhanced Allocations as seen in the Cavium ThunderX based
GIGABYTE MT30-GS2-00

>From thorpej@. Thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pci/pci_map.c
cvs rdiff -u -r1.50 -r1.51 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/pci_map.c
diff -u src/sys/dev/pci/pci_map.c:1.41 src/sys/dev/pci/pci_map.c:1.42
--- src/sys/dev/pci/pci_map.c:1.41	Mon Dec 28 12:38:44 2020
+++ src/sys/dev/pci/pci_map.c	Tue Dec 29 15:39:59 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: pci_map.c,v 1.41 2020/12/28 12:38:44 skrll Exp $	*/
+/*	$NetBSD: pci_map.c,v 1.42 2020/12/29 15:39:59 skrll Exp $	*/
 
 /*-
- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 2000, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.41 2020/12/28 12:38:44 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.42 2020/12/29 15:39:59 skrll Exp $");
 
 #include 
 #include 
@@ -244,6 +244,252 @@ pci_mem_find(pci_chipset_tag_t pc, pcita
 	return 0;
 }
 
+static const char *
+bar_type_string(pcireg_t type)
+{
+	if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO)
+		return "IO";
+
+	switch (PCI_MAPREG_MEM_TYPE(type)) {
+	case PCI_MAPREG_MEM_TYPE_32BIT:
+		return "MEM32";
+	case PCI_MAPREG_MEM_TYPE_32BIT_1M:
+		return "MEM32-1M";
+	case PCI_MAPREG_MEM_TYPE_64BIT:
+		return "MEM64";
+	}
+	return "";
+}
+
+enum {
+	EA_ptr_dw0		= 0,
+	EA_ptr_base_lower	= 1,
+	EA_ptr_base_upper	= 2,
+	EA_ptr_maxoffset_lower	= 3,
+	EA_ptr_maxoffset_upper	= 4,
+
+	EA_PTR_COUNT		= 5
+};
+
+struct pci_ea_entry {
+	/* entry field pointers */
+	int		ea_ptrs[EA_PTR_COUNT];
+
+	/* Raw register values. */
+	pcireg_t	dw0;
+	pcireg_t	base_lower;
+	pcireg_t	base_upper;
+	pcireg_t	maxoffset_lower;
+	pcireg_t	maxoffset_upper;
+
+	/* Interesting tidbits derived from them. */
+	uint64_t	base;
+	uint64_t	maxoffset;
+	unsigned int	bei;
+	unsigned int	props[2];
+	bool		base_is_64;
+	bool		maxoffset_is_64;
+	bool		enabled;
+	bool		writable;
+};
+
+static int
+pci_ea_lookup(pci_chipset_tag_t pc, pcitag_t tag, int ea_cap_ptr,
+int reg, struct pci_ea_entry *entryp)
+{
+	struct pci_ea_entry entry = {
+		.ea_ptrs[EA_ptr_dw0] = ea_cap_ptr + 4,
+	};
+	unsigned int i, num_entries;
+	unsigned int wanted_bei;
+	pcireg_t val;
+
+	if (reg >= PCI_BAR0 && reg <= PCI_BAR5)
+		wanted_bei = PCI_EA_BEI_BAR0 + ((reg - PCI_BAR0) / 4);
+	else if (reg == PCI_MAPREG_ROM)
+		wanted_bei = PCI_EA_BEI_EXPROM;
+	else {
+		/* Invalid BAR. */
+		return 1;
+	}
+
+	val = pci_conf_read(pc, tag, ea_cap_ptr + PCI_EA_CAP1);
+	num_entries = __SHIFTOUT(val, PCI_EA_CAP1_NUMENTRIES);
+
+	val = pci_conf_read(pc, tag, PCI_BHLC_REG);
+	if (PCI_HDRTYPE_TYPE(val) == PCI_HDRTYPE_PPB) {
+		/* Need to skip over PCI_EA_CAP2 on PPBs. */
+		entry.ea_ptrs[EA_ptr_dw0] += 4;
+	}
+
+	for (i = 0; i < num_entries; i++) {
+		val = pci_conf_read(pc, tag, entry.ea_ptrs[EA_ptr_dw0]);
+		unsigned int entry_size = __SHIFTOUT(val, PCI_EA_ES);
+
+		entry.bei = __SHIFTOUT(val, PCI_EA_BEI);
+		entry.props[0] = __SHIFTOUT(val, PCI_EA_PP);
+		entry.props[1] = __SHIFTOUT(val, PCI_EA_SP);
+		entry.writable = (val & PCI_EA_W) ? true : false;
+		entry.enabled = (val & PCI_EA_E) ? true : false;
+
+		if (entry.bei != wanted_bei || entry_size == 0) {
+			entry.ea_ptrs[EA_ptr_dw0] += 4 * (entry_size + 1);
+			continue;
+		}
+
+		entry.ea_ptrs[EA_ptr_base_lower] =
+		entry.ea_ptrs[EA_ptr_dw0] + 4;
+		entry.ea_ptrs[EA_ptr_maxoffset_lower] =
+		entry.ea_ptrs[EA_ptr_dw0] + 8;
+
+		/* Base */
+		entry.base_lower = pci_conf_read(pc, tag,
+		entry.ea_ptrs[EA_ptr_base_lower]);
+		entry.base_is_64 =
+		(entry.base_lower & PCI_EA_BASEMAXOFFSET_64BIT)
+		? true : false;
+		if (entry.base_is_64) {
+			entry.ea_ptrs[EA_ptr_base_upper] =
+			entry.ea_ptrs[EA_ptr_dw0] + 12;
+			entry.base_upper = pci_conf_read(pc, tag,
+			entry.ea_ptrs[EA_ptr_base_upper]);
+		} else {
+			entry.ea_ptrs[EA_ptr_base_upper] = 0;
+			entry.base_upper = 0;
+		}
+
+		entry.base = (entry.base_lower & PCI_EA_LOWMASK) |
+		((uint64_t)entry.base_upper << 32);
+
+		/* MaxOffset */
+		entry.maxoffset_lower = pci_conf_read(pc, tag,
+		entry.ea_ptrs[EA_ptr_maxoffset_lower]);
+		entry.maxoffset_is_64 =
+		(entry.maxoffset_lower & PCI_EA_BASEMAXOFFSET_64BIT)
+		? true : false;
+		if (entry.maxoffset_is_64) {
+			entry.ea_ptrs[EA_ptr_maxoffset_upper] =
+			entry.ea_ptrs[EA_ptr_dw0] +
+			(entry.base_is_64 ? 16 : 12);
+			entry.maxoffset_upper = pci_conf_read(pc, tag,
+			entry.ea_ptrs[EA_ptr_maxoffset_upper]);
+		} else {
+			

CVS commit: src/usr.bin/xlint

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 13:33:03 UTC 2020

Modified Files:
src/usr.bin/xlint/common: externs.h tyname.c
src/usr.bin/xlint/lint1: cgram.y decl.c externs1.h func.c init.c
print.c scan.l tree.c

Log Message:
lint: rename functions with very short names


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/xlint/common/externs.h
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.113 -r1.114 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/xlint/lint1/print.c
cvs rdiff -u -r1.97 -r1.98 src/usr.bin/xlint/lint1/scan.l \
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/common/externs.h
diff -u src/usr.bin/xlint/common/externs.h:1.7 src/usr.bin/xlint/common/externs.h:1.8
--- src/usr.bin/xlint/common/externs.h:1.7	Mon Feb 10 04:54:01 2020
+++ src/usr.bin/xlint/common/externs.h	Tue Dec 29 13:33:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs.h,v 1.7 2020/02/10 04:54:01 christos Exp $	*/
+/*	$NetBSD: externs.h,v 1.8 2020/12/29 13:33:03 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -46,7 +46,7 @@ extern	void	inittyp(void);
  */
 extern	const	char *tyname(char *, size_t, const type_t *);
 extern	int	sametype(const type_t *, const type_t *);
-extern	const	char *basictyname(tspec_t);
+extern	const	char *basic_type_name(tspec_t);
 
 /*
  * mem.c

Index: src/usr.bin/xlint/common/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.15 src/usr.bin/xlint/common/tyname.c:1.16
--- src/usr.bin/xlint/common/tyname.c:1.15	Tue Dec 29 12:18:42 2020
+++ src/usr.bin/xlint/common/tyname.c	Tue Dec 29 13:33:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tyname.c,v 1.15 2020/12/29 12:18:42 rillig Exp $	*/
+/*	$NetBSD: tyname.c,v 1.16 2020/12/29 13:33:03 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.15 2020/12/29 12:18:42 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.16 2020/12/29 13:33:03 rillig Exp $");
 #endif
 
 #include 
@@ -54,7 +54,7 @@ __RCSID("$NetBSD: tyname.c,v 1.15 2020/1
 #endif
 
 const char *
-basictyname(tspec_t t)
+basic_type_name(tspec_t t)
 {
 	switch (t) {
 	case BOOL:	return "_Bool";
@@ -88,7 +88,7 @@ basictyname(tspec_t t)
 	case LCOMPLEX:	return "long double _Complex";
 	case COMPLEX:	return "_Complex";
 	default:
-		LERROR("basictyname(%d)", t);
+		LERROR("basic_type_name(%d)", t);
 		return NULL;
 	}
 }
@@ -170,7 +170,7 @@ tyname(char *buf, size_t bufsiz, const t
 	if ((t = tp->t_tspec) == INT && tp->t_isenum)
 		t = ENUM;
 
-	s = basictyname(t);
+	s = basic_type_name(t);
 
 	cv[0] = '\0';
 	if (tp->t_const)

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.113 src/usr.bin/xlint/lint1/cgram.y:1.114
--- src/usr.bin/xlint/lint1/cgram.y:1.113	Tue Dec 29 12:18:42 2020
+++ src/usr.bin/xlint/lint1/cgram.y	Tue Dec 29 13:33:03 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.113 2020/12/29 12:18:42 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.114 2020/12/29 13:33:03 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.113 2020/12/29 12:18:42 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.114 2020/12/29 13:33:03 rillig Exp $");
 #endif
 
 #include 
@@ -351,11 +351,11 @@ translation_unit:
 ext_decl:
 	  asm_stmnt
 	| func_def {
-		glclup(0);
+		global_clean_up_decl(0);
 		CLRWFLGS(__FILE__, __LINE__);
 	  }
 	| data_def {
-		glclup(0);
+		global_clean_up_decl(0);
 		CLRWFLGS(__FILE__, __LINE__);
 	  }
 	;
@@ -400,10 +400,10 @@ data_def:
 	  }
 	| declspecs deftyp type_init_decls T_SEMI
 	| error T_SEMI {
-		globclup();
+		global_clean_up();
 	  }
 	| error T_RBRACE {
-		globclup();
+		global_clean_up();
 	  }
 	;
 
@@ -573,10 +573,10 @@ type_attribute_spec:
 	| T_AT_FORMAT T_LPARN type_attribute_format_type T_COMMA
 	constant T_COMMA constant T_RPARN
 	| T_AT_USED {
-		addused();
+		add_attr_used();
 	}
 	| T_AT_UNUSED {
-		addused();
+		add_attr_used();
 	}
 	| T_AT_WARN_UNUSED_RESULT
 	| T_AT_WEAK
@@ -624,34 +624,34 @@ deftyp:
 
 declspecs:
 	  clrtyp_typespec {
-		addtype($1);
+		add_type($1);
 	  }
 	| declmods typespec {
-		addtype($2);
+		add_type($2);
 	  }
 	| type_attribute declspecs
 	| declspecs declmod
 	| declspecs notype_typespec {
-		addtype($2);
+		add_type($2);
 	  }
 	;
 
 declmods:
 	  clrtyp T_QUAL {
-		addqual($2);
+		add_qualifier($2);
 	  }
 	| clrtyp T_SCLASS {
-		addscl($2);
+		

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

2020-12-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec 29 12:43:36 UTC 2020

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

Log Message:
Mark resize debug info as obsolete


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 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/xdebug/mi
diff -u src/distrib/sets/lists/xdebug/mi:1.39 src/distrib/sets/lists/xdebug/mi:1.40
--- src/distrib/sets/lists/xdebug/mi:1.39	Wed Oct 28 08:10:09 2020
+++ src/distrib/sets/lists/xdebug/mi	Tue Dec 29 12:43:36 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.39 2020/10/28 08:10:09 nia Exp $
+# $NetBSD: mi,v 1.40 2020/12/29 12:43:36 martin Exp $
 ./etc/mtree/set.xdebug	comp-sys-root
 ./usr/X11R7/lib		base-x11-root	xorg,debuglib,compatx11dir
 ./usr/X11R7/lib/libEGL_g.axdebug-libEGL-debuglib	xorg,debuglib,compatx11file,xorg_glamor
@@ -144,7 +144,7 @@
 ./usr/libdata/debug/usr/X11R7/bin/oclock.debug		xdebug-oclock-debug	xorg,debug
 ./usr/libdata/debug/usr/X11R7/bin/pcitweak.debug	xdebug-obsolete	xorg,obsolete
 ./usr/libdata/debug/usr/X11R7/bin/proxymngr.debug	xdebug-proxymngr-debug	xorg,debug
-./usr/libdata/debug/usr/X11R7/bin/resize.debug		xdebug-xterm-debug	xorg,debug
+./usr/libdata/debug/usr/X11R7/bin/resize.debug		xdebug-obsolete	xorg,obsolete
 ./usr/libdata/debug/usr/X11R7/bin/revpath.debug		xdebug-revpath-debug	xorg,debug
 ./usr/libdata/debug/usr/X11R7/bin/scanpci.debug		xdebug-obsolete	xorg,obsolete
 ./usr/libdata/debug/usr/X11R7/bin/sessreg.debug		xdebug-sessreg-debug	xorg,debug



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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 12:29:03 UTC 2020

Modified Files:
src/usr.bin/xlint/lint1: scan.l

Log Message:
lint: remove redundant parentheses around return value


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/usr.bin/xlint/lint1/scan.l

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/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.96 src/usr.bin/xlint/lint1/scan.l:1.97
--- src/usr.bin/xlint/lint1/scan.l:1.96	Tue Dec 29 12:18:42 2020
+++ src/usr.bin/xlint/lint1/scan.l	Tue Dec 29 12:29:03 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.96 2020/12/29 12:18:42 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.97 2020/12/29 12:29:03 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.96 2020/12/29 12:18:42 rillig Exp $");
+__RCSID("$NetBSD: scan.l,v 1.97 2020/12/29 12:29:03 rillig Exp $");
 #endif
 
 #include 
@@ -101,66 +101,66 @@ TL	([fFlL]?[i]?)
 
 %%
 
-{L}({L}|{D})*			return (name());
-0[bB]{BD}+[lLuU]*		return (icon(2));
-0{OD}*[lLuU]*			return (icon(8));
-{NZD}{D}*[lLuU]*		return (icon(10));
-0[xX]{HD}+[lLuU]*		return (icon(16));
+{L}({L}|{D})*			return name();
+0[bB]{BD}+[lLuU]*		return icon(2);
+0{OD}*[lLuU]*			return icon(8);
+{NZD}{D}*[lLuU]*		return icon(10);
+0[xX]{HD}+[lLuU]*		return icon(16);
 {D}+\.{D}*{EX}?{TL}	|
 {D}+{EX}{TL}		|
 0[xX]{HD}+\.{HD}*{HX}{TL} |
 0[xX]{HD}+{HX}{TL}	|
-\.{D}+{EX}?{TL}		return (fcon());
-"="return (operator(T_ASSIGN, ASSIGN));
-"*="return (operator(T_OPASS, MULASS));
-"/="return (operator(T_OPASS, DIVASS));
-"%="return (operator(T_OPASS, MODASS));
-"+="return (operator(T_OPASS, ADDASS));
-"-="return (operator(T_OPASS, SUBASS));
-"<<="return (operator(T_OPASS, SHLASS));
-">>="return (operator(T_OPASS, SHRASS));
-"&="return (operator(T_OPASS, ANDASS));
-"^="return (operator(T_OPASS, XORASS));
-"|="return (operator(T_OPASS, ORASS));
-"||"return (operator(T_LOGOR, LOGOR));
-"&&"return (operator(T_LOGAND, LOGAND));
-"|"return (operator(T_OR, OR));
-"&"return (operator(T_AND, AND));
-"^"return (operator(T_XOR, XOR));
-"=="return (operator(T_EQOP, EQ));
-"!="return (operator(T_EQOP, NE));
-"<"return (operator(T_RELOP, LT));
-">"return (operator(T_RELOP, GT));
-"<="return (operator(T_RELOP, LE));
-">="return (operator(T_RELOP, GE));
-"<<"return (operator(T_SHFTOP, SHL));
-">>"return (operator(T_SHFTOP, SHR));
-"++"return (operator(T_INCDEC, INC));
-"--"return (operator(T_INCDEC, DEC));
-"->"return (operator(T_STROP, ARROW));
-"."return (operator(T_STROP, POINT));
-"+"return (operator(T_ADDOP, PLUS));
-"-"return (operator(T_ADDOP, MINUS));
-"*"return (operator(T_MULT, MULT));
-"/"return (operator(T_DIVOP, DIV));
-"%"return (operator(T_DIVOP, MOD));
-"!"return (operator(T_UNOP, NOT));
-"~"return (operator(T_UNOP, COMPL));
-"\""return (string());
-"L\""return (wcstrg());
-";"return (T_SEMI);
-"{"return (T_LBRACE);
-"}"return (T_RBRACE);
-","return (T_COMMA);
-":"return (T_COLON);
-"?"return (T_QUEST);
-"["return (T_LBRACK);
-"]"return (T_RBRACK);
-"("return (T_LPARN);
-")"return (T_RPARN);
-"..."return (T_ELLIPSE);
-"'"return (ccon());
-"L'"return (wccon());
+\.{D}+{EX}?{TL}		return fcon();
+"="return operator(T_ASSIGN, ASSIGN);
+"*="return operator(T_OPASS, MULASS);
+"/="return operator(T_OPASS, DIVASS);
+"%="return operator(T_OPASS, MODASS);
+"+="return operator(T_OPASS, ADDASS);
+"-="return operator(T_OPASS, SUBASS);
+"<<="return operator(T_OPASS, SHLASS);
+">>="return operator(T_OPASS, SHRASS);
+"&="return operator(T_OPASS, ANDASS);
+"^="return operator(T_OPASS, XORASS);
+"|="return operator(T_OPASS, ORASS);
+"||"return operator(T_LOGOR, LOGOR);
+"&&"return operator(T_LOGAND, LOGAND);
+"|"return operator(T_OR, OR);
+"&"return operator(T_AND, AND);
+"^"return operator(T_XOR, XOR);
+"=="return operator(T_EQOP, EQ);
+"!="return operator(T_EQOP, NE);
+"<"return operator(T_RELOP, LT);
+">"return operator(T_RELOP, GT);
+"<="return operator(T_RELOP, LE);
+">="return operator(T_RELOP, GE);
+"<<"return operator(T_SHFTOP, SHL);
+">>"return operator(T_SHFTOP, SHR);
+"++"return operator(T_INCDEC, INC);
+"--"return operator(T_INCDEC, DEC);
+"->"return operator(T_STROP, ARROW);
+"."return operator(T_STROP, POINT);
+"+"return operator(T_ADDOP, PLUS);
+"-"return operator(T_ADDOP, MINUS);
+"*"return operator(T_MULT, MULT);
+"/"return operator(T_DIVOP, DIV);
+"%"return operator(T_DIVOP, MOD);
+"!"return operator(T_UNOP, NOT);
+"~"return 

CVS commit: src/usr.bin/xlint

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 12:18:42 UTC 2020

Modified Files:
src/usr.bin/xlint/common: tyname.c
src/usr.bin/xlint/lint1: cgram.y err.c func.c lint1.h scan.l tree.c
src/usr.bin/xlint/lint2: read.c

Log Message:
lint: fix indentation and alignment that used space-tab


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.112 -r1.113 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.95 -r1.96 src/usr.bin/xlint/lint1/scan.l
cvs rdiff -u -r1.96 -r1.97 src/usr.bin/xlint/lint1/tree.c
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/xlint/lint2/read.c

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

Modified files:

Index: src/usr.bin/xlint/common/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.14 src/usr.bin/xlint/common/tyname.c:1.15
--- src/usr.bin/xlint/common/tyname.c:1.14	Tue Dec 29 11:35:11 2020
+++ src/usr.bin/xlint/common/tyname.c	Tue Dec 29 12:18:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tyname.c,v 1.14 2020/12/29 11:35:11 rillig Exp $	*/
+/*	$NetBSD: tyname.c,v 1.15 2020/12/29 12:18:42 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.14 2020/12/29 11:35:11 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.15 2020/12/29 12:18:42 rillig Exp $");
 #endif
 
 #include 
@@ -46,10 +46,11 @@ __RCSID("$NetBSD: tyname.c,v 1.14 2020/1
 #include PASS
 
 #ifndef LERROR
-#define LERROR(fmt, args...) 	do { \
-(void)warnx("%s, %d: " fmt, __FILE__, __LINE__, ##args); \
-abort(); \
-} while (/*CONSTCOND*/0)
+#define LERROR(fmt, args...) \
+	do { \
+		(void)warnx("%s, %d: " fmt, __FILE__, __LINE__, ##args); \
+		abort(); \
+	} while (/*CONSTCOND*/0)
 #endif
 
 const char *

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.112 src/usr.bin/xlint/lint1/cgram.y:1.113
--- src/usr.bin/xlint/lint1/cgram.y:1.112	Tue Dec 29 11:35:11 2020
+++ src/usr.bin/xlint/lint1/cgram.y	Tue Dec 29 12:18:42 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.112 2020/12/29 11:35:11 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.113 2020/12/29 12:18:42 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.112 2020/12/29 11:35:11 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.113 2020/12/29 12:18:42 rillig Exp $");
 #endif
 
 #include 
@@ -1952,7 +1952,7 @@ term:
 	| T_LPARN type_name T_RPARN term		%prec T_UNOP {
 		$$ = cast($4, $2);
 	  }
-	| T_LPARN type_name T_RPARN 			%prec T_UNOP {
+	| T_LPARN type_name T_RPARN			%prec T_UNOP {
 		sym_t *tmp = mktempsym($2);
 		idecl(tmp, 1, NULL);
 	  } init_lbrace init_expr_list init_rbrace {

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.57 src/usr.bin/xlint/lint1/err.c:1.58
--- src/usr.bin/xlint/lint1/err.c:1.57	Tue Dec 29 11:35:11 2020
+++ src/usr.bin/xlint/lint1/err.c	Tue Dec 29 12:18:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.57 2020/12/29 11:35:11 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.58 2020/12/29 12:18:42 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.57 2020/12/29 11:35:11 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.58 2020/12/29 12:18:42 rillig Exp $");
 #endif
 
 #include 
@@ -215,9 +215,9 @@ const	char *msgs[] = {
 	"argument has incompatible pointer type, arg #%d (%s != %s)", /* 153 */
 	"illegal combination of %s (%s) and %s (%s), arg #%d",	  /* 154 */
 	"argument is incompatible with prototype, arg #%d",	  /* 155 */
-	"enum type mismatch, arg #%d",			   	  /* 156 */
+	"enum type mismatch, arg #%d",  /* 156 */
 	"ANSI C treats constant as unsigned",			  /* 157 */
-	"%s may be used before set",			  	  /* 158 */
+	"%s may be used before set",  /* 158 */
 	"assignment in conditional context",			  /* 159 */
 	"operator '==' found where '=' was expected",		  /* 160 */
 	"constant in conditional context",			  /* 161 */
@@ -242,7 +242,7 @@ const	char *msgs[] = {
 	"bit-field initializer does not fit",			  /* 180 */
 	"{}-enclosed initializer required",			  /* 181 */
 	"incompatible pointer types (%s != %s)",		  /* 182 */
-	"illegal combination of %s (%s) and %s (%s)",	  	  /* 183 */
+	"illegal combination of %s (%s) and %s (%s)",		  /* 183 */
 	"illegal pointer combination",  /* 184 */
 	"initialisation type mismatch (%s) and (%s)",		  /* 185 */
 	"bit-field initialisation is illegal in traditional C",	  /* 186 

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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 11:54:56 UTC 2020

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

Log Message:
lint: spell check


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.95 -r1.96 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/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.32 src/usr.bin/xlint/lint1/lint1.h:1.33
--- src/usr.bin/xlint/lint1/lint1.h:1.32	Mon Dec 28 12:56:33 2020
+++ src/usr.bin/xlint/lint1/lint1.h	Tue Dec 29 11:54:56 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.32 2020/12/28 12:56:33 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.33 2020/12/29 11:54:56 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -204,7 +204,7 @@ typedef enum {
 	ENUMTAG,
 	MOS,		/* member of struct */
 	MOU,		/* member of union */
-	ENUMCON,	/* enumerator */
+	ENUMCON,	/* enumerator, enum constant */
 	ABSTRACT,	/* abstract symbol (sizeof, casts, unnamed argument) */
 	ARG,		/* argument */
 	PARG,		/* used in declaration stack during prototype
@@ -216,7 +216,7 @@ typedef enum {
  * symbol table entry
  */
 typedef	struct sym {
-	const	char *s_name;	/* name */
+	const	char *s_name;
 	const	char *s_rename;	/* renamed symbol's given name */
 	pos_t	s_dpos;		/* position of last (prototype)definition,
    prototypedeclaration, no-prototype-def.,
@@ -235,18 +235,18 @@ typedef	struct sym {
    definition */
 	u_int	s_rimpl : 1;	/* return value of function implicit decl. */
 	u_int	s_osdef : 1;	/* symbol stems from old style function def. */
-	u_int	s_inline : 1;	/* true if this is a inline function */
+	u_int	s_inline : 1;	/* true if this is an inline function */
 	struct	sym *s_xsym;	/* for local declared external symbols pointer
    to external symbol with same name */
 	def_t	s_def;		/* declared, tentative defined, defined */
 	scl_t	s_scl;		/* storage class */
 	int	s_blklev;	/* level of declaration, -1 if not in symbol
    table */
-	type_t	*s_type;	/* type */
-	val_t	s_value;	/* value (if enumcon) */
+	type_t	*s_type;
+	val_t	s_value;	/* value (if enum constant) */
 	union {
 		str_t	*_s_st;	/* tag, if it is a struct/union member */
-		tenum_t	*_s_et;	/* tag, if it is a enumerator */
+		tenum_t	*_s_et;	/* tag, if it is an enumerator */
 		tspec_t	_s_tsp;	/* type (only for keywords) */
 		tqual_t	_s_tqu;	/* qualifier (only for keywords) */
 		struct	sym *_s_args; /* arguments in old style function

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.95 src/usr.bin/xlint/lint1/tree.c:1.96
--- src/usr.bin/xlint/lint1/tree.c:1.95	Tue Dec 29 11:35:11 2020
+++ src/usr.bin/xlint/lint1/tree.c	Tue Dec 29 11:54:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.95 2020/12/29 11:35:11 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.96 2020/12/29 11:54:56 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.95 2020/12/29 11:35:11 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.96 2020/12/29 11:54:56 rillig Exp $");
 #endif
 
 #include 
@@ -1780,8 +1780,7 @@ ptconv(int arg, tspec_t nt, tspec_t ot, 
 }
 
 /*
- * Print warnings for conversions of integer types which my cause
- * problems.
+ * Print warnings for conversions of integer types which may cause problems.
  */
 /* ARGSUSED */
 static void



CVS commit: src/usr.bin/xlint

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 11:35:11 UTC 2020

Modified Files:
src/usr.bin/xlint/common: mem.c tyname.c
src/usr.bin/xlint/lint1: cgram.y decl.c emit1.c err.c init.c main1.c
mem1.c tree.c
src/usr.bin/xlint/lint2: chk.c emit2.c hash.c mem2.c msg.c read.c
src/usr.bin/xlint/xlint: xlint.c

Log Message:
lint: remove redundant parentheses around return value


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/xlint/common/mem.c
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.111 -r1.112 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.75 -r1.76 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/xlint/lint1/main1.c
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/xlint/lint1/mem1.c
cvs rdiff -u -r1.94 -r1.95 src/usr.bin/xlint/lint1/tree.c
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/xlint/lint2/chk.c
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/lint2/emit2.c
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/xlint/lint2/hash.c
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/xlint/lint2/mem2.c
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/xlint/lint2/msg.c
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/xlint/lint2/read.c
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/xlint/xlint/xlint.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/common/mem.c
diff -u src/usr.bin/xlint/common/mem.c:1.10 src/usr.bin/xlint/common/mem.c:1.11
--- src/usr.bin/xlint/common/mem.c:1.10	Mon Dec 28 22:16:42 2020
+++ src/usr.bin/xlint/common/mem.c	Tue Dec 29 11:35:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.10 2020/12/28 22:16:42 rillig Exp $	*/
+/*	$NetBSD: mem.c,v 1.11 2020/12/29 11:35:11 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem.c,v 1.10 2020/12/28 22:16:42 rillig Exp $");
+__RCSID("$NetBSD: mem.c,v 1.11 2020/12/29 11:35:11 rillig Exp $");
 #endif
 
 #include 
@@ -56,7 +56,7 @@ xmalloc(size_t s)
 
 	if ((p = malloc(s)) == NULL)
 		nomem();
-	return (p);
+	return p;
 }
 
 void *
@@ -66,7 +66,7 @@ xcalloc(size_t n, size_t s)
 
 	if ((p = calloc(n, s)) == NULL)
 		nomem();
-	return (p);
+	return p;
 }
 
 void *
@@ -79,7 +79,7 @@ xrealloc(void *p, size_t s)
 		nomem();
 	}
 	p = n;
-	return (p);
+	return p;
 }
 
 char *
@@ -89,7 +89,7 @@ xstrdup(const char *s)
 
 	if ((s2 = strdup(s)) == NULL)
 		nomem();
-	return (s2);
+	return s2;
 }
 
 void

Index: src/usr.bin/xlint/common/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.13 src/usr.bin/xlint/common/tyname.c:1.14
--- src/usr.bin/xlint/common/tyname.c:1.13	Fri Sep  7 15:16:15 2018
+++ src/usr.bin/xlint/common/tyname.c	Tue Dec 29 11:35:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tyname.c,v 1.13 2018/09/07 15:16:15 christos Exp $	*/
+/*	$NetBSD: tyname.c,v 1.14 2020/12/29 11:35:11 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.13 2018/09/07 15:16:15 christos Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.14 2020/12/29 11:35:11 rillig Exp $");
 #endif
 
 #include 
@@ -235,5 +235,5 @@ tyname(char *buf, size_t bufsiz, const t
 	default:
 		LERROR("tyname(%d)", t);
 	}
-	return (buf);
+	return buf;
 }

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.111 src/usr.bin/xlint/lint1/cgram.y:1.112
--- src/usr.bin/xlint/lint1/cgram.y:1.111	Tue Dec 29 10:24:22 2020
+++ src/usr.bin/xlint/lint1/cgram.y	Tue Dec 29 11:35:11 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.111 2020/12/29 10:24:22 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.112 2020/12/29 11:35:11 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.111 2020/12/29 10:24:22 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.112 2020/12/29 11:35:11 rillig Exp $");
 #endif
 
 #include 
@@ -2026,7 +2026,7 @@ yyerror(const char *msg)
 	error(249, yytext);
 	if (++sytxerr >= 5)
 		norecover();
-	return (0);
+	return 0;
 }
 
 static __inline int uq_gt(uint64_t, uint64_t);
@@ -2036,14 +2036,14 @@ static __inline int
 uq_gt(uint64_t a, uint64_t b)
 {
 
-	return (a > b);
+	return a > b;
 }
 
 static __inline int
 q_gt(int64_t a, int64_t b)
 {
 
-	return (a > b);
+	return a > b;
 }
 
 #define	q_lt(a, b)	q_gt(b, a)
@@ -2096,7 +2096,7 @@ toicon(tnode_t *tn, int required)
 		}
 	}
 	free(v);
-	return (i);
+	return i;
 }
 
 static void

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.75 src/usr.bin/xlint/lint1/decl.c:1.76
--- 

CVS commit: src/sys/dev/pci

2020-12-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 29 11:07:48 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.1408 -r1.1409 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1407 -r1.1408 src/sys/dev/pci/pcidevs_data.h

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

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1408 src/sys/dev/pci/pcidevs.h:1.1409
--- src/sys/dev/pci/pcidevs.h:1.1408	Fri Nov 20 01:29:46 2020
+++ src/sys/dev/pci/pcidevs.h	Tue Dec 29 11:07:47 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1408 2020/11/20 01:29:46 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1409 2020/12/29 11:07:47 skrll Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1421 2020/11/20 01:29:12 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1423 2020/12/29 11:05:56 skrll Exp
  */
 
 /*
@@ -2159,25 +2159,13 @@
 #define	PCI_PRODUCT_CAVIUM_NITROX	0x0001		/* Nitrox XL */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_MRML	0xa001		/* Master RML Bridge to RSL devices */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_PCIB	0xa002		/* PCI Bridge */
-#define	PCI_PRODUCT_CAVIUM_THUNDERX_RESET	0xa00e		/* Reset Controller */
-#define	PCI_PRODUCT_CAVIUM_THUNDERX_RNG	0xa018		/* Random Number Generator */
-#define	PCI_PRODUCT_CAVIUM_THUNDERX_XHCI	0xa01b		/* xHCI USB Controller */
-#define	PCI_PRODUCT_CAVIUM_THUNDERX_AHCI	0xa01c		/* AHCI SATA Controller */
-#define	PCI_PRODUCT_CAVIUM_THUNDERX_RAID	0xa01d		/* RAID Coprocessor */
-#define	PCI_PRODUCT_CAVIUM_THUNDERX_NIC	0xa01e		/* Network Interface Controller */
-#define	PCI_PRODUCT_CAVIUM_THUNDERX_TNS	0xa01f		/* Traffic Network Switch */
-#define	PCI_PRODUCT_CAVIUM_THUNDERX_LMC	0xa022		/* DRAM Controller */
-#define	PCI_PRODUCT_CAVIUM_THUNDERX_BGX	0xa026		/* Common Ethernet Interface */
-#define	PCI_PRODUCT_CAVIUM_THUNDERX_L2C_TAD	0xa02e		/* Level 2 cache tag and data */
-#define	PCI_PRODUCT_CAVIUM_THUNDERX_L2C_CBC	0xa02f		/* L2C-CBC */
-#define	PCI_PRODUCT_CAVIUM_THUNDERX_L2C_MCI	0xa030		/* L2C-MCI */
-
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_SMMU	0xa008		/* SMMU */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_GIC	0xa009		/* Generic Interrupt Controller */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_GPIO	0xa00a		/* GPIO Controller */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_MPI_SPI	0xa00b		/* MPI / SPI Controller */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_MIO_PTP	0xa00c		/* MIO-PTP Controller */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_MIX	0xa00d		/* MIX Network Controller */
+#define	PCI_PRODUCT_CAVIUM_THUNDERX_RESET	0xa00e		/* Reset Controller */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_UART	0xa00f		/* UART Controller */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_EMMC_SD	0xa010		/* eMMC/SD Controller */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_MIO_BOOT	0xa011		/* MIO-BOOT Controller */
@@ -2187,19 +2175,30 @@
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_PSLI	0xa015		/* PCIe Switch Logic Interface */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_KM	0xa016		/* Key Memory */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_GST	0xa017		/* GTI (Global System Timers) */
+#define	PCI_PRODUCT_CAVIUM_THUNDERX_RNG	0xa018		/* Random Number Generator */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_DFA	0xa019		/* DFA */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_ZIP	0xa01a		/* Zip Coprocessor */
+#define	PCI_PRODUCT_CAVIUM_THUNDERX_XHCI	0xa01b		/* xHCI USB Controller */
+#define	PCI_PRODUCT_CAVIUM_THUNDERX_AHCI	0xa01c		/* AHCI SATA Controller */
+#define	PCI_PRODUCT_CAVIUM_THUNDERX_RAID	0xa01d		/* RAID Coprocessor */
+#define	PCI_PRODUCT_CAVIUM_THUNDERX_NIC	0xa01e		/* Network Interface Controller */
+#define	PCI_PRODUCT_CAVIUM_THUNDERX_TNS	0xa01f		/* Traffic Network Switch */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_PEM	0xa020		/* PEM (PCI Express Interface) */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_L2C	0xa021		/* L2C (Level-2 Cache Controller) */
+#define	PCI_PRODUCT_CAVIUM_THUNDERX_LMC	0xa022		/* DRAM Controller */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_OCLA	0xa023		/* OCLA (On-Chip Logic Analyzer) */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_OSM	0xa024		/* OSM */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_GSER	0xa025		/* GSER (General Serializer/Deserializer) */
+#define	PCI_PRODUCT_CAVIUM_THUNDERX_BGX	0xa026		/* Common Ethernet Interface */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_IOBN	0xa027		/* IOBN */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_NCSCI	0xa029		/* NCSI (Network Controller Sideband Interface) */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_SGPIO	0xa02a		/* SGPIO (Serial GPIO controller for SATA disk lights) */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_SMI_MDIO	0xa02b		/* SMI / MDIO Controller */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_DAP	0xa02c		/* DAP (Debug Access Port) */
 #define	PCI_PRODUCT_CAVIUM_THUNDERX_PCIERC	0xa02d		/* PCIERC (PCIe Root Complex) */
+#define	PCI_PRODUCT_CAVIUM_THUNDERX_L2C_TAD	0xa02e		/* Level 2 cache tag and data */
+#define	

CVS commit: src/sys/dev/pci

2020-12-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 29 11:05:57 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Sort Cavium devices


To generate a diff of this commit:
cvs rdiff -u -r1.1422 -r1.1423 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1422 src/sys/dev/pci/pcidevs:1.1423
--- src/sys/dev/pci/pcidevs:1.1422	Tue Dec 29 11:04:53 2020
+++ src/sys/dev/pci/pcidevs	Tue Dec 29 11:05:56 2020
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1422 2020/12/29 11:04:53 skrll Exp $
+$NetBSD: pcidevs,v 1.1423 2020/12/29 11:05:56 skrll Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -2152,25 +2152,13 @@ product C4T GPPCI		0x6773	GPPCI
 product CAVIUM NITROX			0x0001	Nitrox XL
 product CAVIUM THUNDERX_MRML		0xa001	Master RML Bridge to RSL devices
 product CAVIUM THUNDERX_PCIB		0xa002	PCI Bridge
-product CAVIUM THUNDERX_RESET		0xa00e	Reset Controller
-product CAVIUM THUNDERX_RNG		0xa018	Random Number Generator
-product CAVIUM THUNDERX_XHCI		0xa01b	xHCI USB Controller
-product CAVIUM THUNDERX_AHCI		0xa01c	AHCI SATA Controller
-product CAVIUM THUNDERX_RAID		0xa01d	RAID Coprocessor
-product CAVIUM THUNDERX_NIC		0xa01e	Network Interface Controller
-product CAVIUM THUNDERX_TNS		0xa01f	Traffic Network Switch
-product CAVIUM THUNDERX_LMC		0xa022	DRAM Controller
-product CAVIUM THUNDERX_BGX		0xa026	Common Ethernet Interface
-product CAVIUM THUNDERX_L2C_TAD		0xa02e	Level 2 cache tag and data
-product CAVIUM THUNDERX_L2C_CBC		0xa02f	L2C-CBC
-product CAVIUM THUNDERX_L2C_MCI		0xa030	L2C-MCI
-
 product CAVIUM THUNDERX_SMMU		0xa008	SMMU
 product CAVIUM THUNDERX_GIC		0xa009	Generic Interrupt Controller
 product CAVIUM THUNDERX_GPIO		0xa00a	GPIO Controller
 product CAVIUM THUNDERX_MPI_SPI		0xa00b	MPI / SPI Controller
 product CAVIUM THUNDERX_MIO_PTP		0xa00c	MIO-PTP Controller
 product CAVIUM THUNDERX_MIX		0xa00d	MIX Network Controller
+product CAVIUM THUNDERX_RESET		0xa00e	Reset Controller
 product CAVIUM THUNDERX_UART		0xa00f	UART Controller
 product CAVIUM THUNDERX_EMMC_SD		0xa010	eMMC/SD Controller
 product CAVIUM THUNDERX_MIO_BOOT	0xa011	MIO-BOOT Controller
@@ -2180,19 +2168,30 @@ product CAVIUM THUNDERX_VRM		0xa014	Volt
 product CAVIUM THUNDERX_PSLI		0xa015	PCIe Switch Logic Interface
 product CAVIUM THUNDERX_KM		0xa016	Key Memory
 product CAVIUM THUNDERX_GST		0xa017	GTI (Global System Timers)
+product CAVIUM THUNDERX_RNG		0xa018	Random Number Generator
 product CAVIUM THUNDERX_DFA		0xa019	DFA
 product CAVIUM THUNDERX_ZIP		0xa01a	Zip Coprocessor
+product CAVIUM THUNDERX_XHCI		0xa01b	xHCI USB Controller
+product CAVIUM THUNDERX_AHCI		0xa01c	AHCI SATA Controller
+product CAVIUM THUNDERX_RAID		0xa01d	RAID Coprocessor
+product CAVIUM THUNDERX_NIC		0xa01e	Network Interface Controller
+product CAVIUM THUNDERX_TNS		0xa01f	Traffic Network Switch
 product CAVIUM THUNDERX_PEM		0xa020	PEM (PCI Express Interface)
 product CAVIUM THUNDERX_L2C		0xa021	L2C (Level-2 Cache Controller)
+product CAVIUM THUNDERX_LMC		0xa022	DRAM Controller
 product CAVIUM THUNDERX_OCLA		0xa023	OCLA (On-Chip Logic Analyzer)
 product CAVIUM THUNDERX_OSM		0xa024	OSM
 product CAVIUM THUNDERX_GSER		0xa025	GSER (General Serializer/Deserializer)
+product CAVIUM THUNDERX_BGX		0xa026	Common Ethernet Interface
 product CAVIUM THUNDERX_IOBN		0xa027	IOBN
 product CAVIUM THUNDERX_NCSCI		0xa029	NCSI (Network Controller Sideband Interface)
 product CAVIUM THUNDERX_SGPIO		0xa02a	SGPIO (Serial GPIO controller for SATA disk lights)
 product CAVIUM THUNDERX_SMI_MDIO	0xa02b	SMI / MDIO Controller
 product CAVIUM THUNDERX_DAP		0xa02c	DAP (Debug Access Port)
 product CAVIUM THUNDERX_PCIERC		0xa02d	PCIERC (PCIe Root Complex)
+product CAVIUM THUNDERX_L2C_TAD		0xa02e	Level 2 cache tag and data
+product CAVIUM THUNDERX_L2C_CBC		0xa02f	L2C-CBC
+product CAVIUM THUNDERX_L2C_MCI		0xa030	L2C-MCI
 product CAVIUM THUNDERX_MIOS_FUS	0xa031	MIO-FUS (Fuse Access Controller)
 product CAVIUM THUNDERX_FUSE		0xa032	FUSF (Fuse Controller)
 product CAVIUM THUNDERX_RNGVF		0xa033	Random Number Generator virtual function



CVS commit: src/sys/dev/pci

2020-12-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 29 11:04:53 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.1421 -r1.1422 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1421 src/sys/dev/pci/pcidevs:1.1422
--- src/sys/dev/pci/pcidevs:1.1421	Fri Nov 20 01:29:12 2020
+++ src/sys/dev/pci/pcidevs	Tue Dec 29 11:04:53 2020
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1421 2020/11/20 01:29:12 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1422 2020/12/29 11:04:53 skrll Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -687,7 +687,7 @@ vendor ADP		0x9004	Adaptec
 vendor ADP2		0x9005	Adaptec (2nd PCI Vendor ID)
 vendor ATRONICS		0x907f	Atronics
 vendor NETMOS		0x9710	Netmos
-vendor PARALLELS	0x	Parallels	
+vendor PARALLELS	0x	Parallels
 vendor MICRON		0xc0a9	Micron/Crucial Technology
 vendor CHRYSALIS	0xcafe	Chrysalis-ITS
 vendor MIDDLE_DIGITAL	0xdeaf	Middle Digital
@@ -1749,7 +1749,7 @@ product ATI RADEON_RS300_7834	0x7834	Rad
 product ATI RADEON_RS300_7835	0x7835	Radeon 9200 IGP
 product ATI RS690_HB_7910	0x7910	RS690 Host Bridge
 product ATI RS690_HB_7911	0x7911	RS740 Host Bridge
-product ATI RS690_PPB_7912	0x7912	RS690 GFX Bridge 
+product ATI RS690_PPB_7912	0x7912	RS690 GFX Bridge
 product ATI RS690_PPB_7913	0x7913	RS690 PCI Express Bridge GFX
 product ATI RS690_PPB_7914	0x7914	RS690 PCI Express Bridge GPP Port A
 product ATI RS690_PPB_7915	0x7915	RS690 PCI Express Bridge GPP Port B
@@ -1826,7 +1826,7 @@ product ATI RADEON_RX_460_HDA	0xaae0	Rad
 product ATI RADEON_RX_550_HDA	0xaae8	Radeon R9 Nano, FURY HD Audio Controller
 product ATI RADEON_RX_470_HDA	0xaaf0	Radeon RX 470/480/570/580/590 HD Audio Controller
 product ATI RADEON_VEGA56_HDA	0xaaf8	Radeon Vega 56/64 HD Audio
-product ATI RADEON_RX_550_HDA2	0xab00	Radeon RX 550/640SP/560/560X HD Audio Controller  
+product ATI RADEON_RX_550_HDA2	0xab00	Radeon RX 550/640SP/560/560X HD Audio Controller
 
 /* Auravision products */
 product AURAVISION VXP524	0x01f7	VxP524 PCI Video Processor
@@ -2840,9 +2840,9 @@ product MARVELL MV64460		0x6480	MV6446x 
 product MARVELL MV6707		0x6707	MV6707 SoC Armada 370
 product MARVELL MV6710		0x6710	MV6710 SoC Armada 370
 product MARVELL MV6W11		0x6711	MV6W11 SoC Armada 370
-product MARVELL 88F6810 0x6810  88F6810 SoC Armada 38x 
-product MARVELL 88F6820 0x6820  88F6820 SoC Armada 38x 
-product MARVELL 88F6828 0x6828  88F6828 SoC Armada 38x 
+product MARVELL 88F6810 0x6810  88F6810 SoC Armada 38x
+product MARVELL 88F6820 0x6820  88F6820 SoC Armada 38x
+product MARVELL 88F6828 0x6828  88F6828 SoC Armada 38x
 product MARVELL 88SX7042	0x7042	88SX7042 SATA IIe
 product MARVELL MV78100		0x7810	MV78100 SoC Discovery Innovation
 product MARVELL MV78130		0x7813	MV78130 SoC Armada XP
@@ -3274,7 +3274,7 @@ product INTEL 4HS_H_UART_1	0x06a9	400 Se
 product INTEL 4HS_H_GSPI_0	0x06aa	400 Series GSPI 0
 product INTEL 4HS_H_GSPI_1	0x06ab	400 Series GSPI 1
 product INTEL 4HS_H_PCIE_21	0x06ac	400 Series PCIe Root Port 21
-product INTEL 4HS_H_PCIE_22	0x06ad	400 Series PCIe Root Port 22 
+product INTEL 4HS_H_PCIE_22	0x06ad	400 Series PCIe Root Port 22
 product INTEL 4HS_H_PCIE_23	0x06ae	400 Series PCIe Root Port 23
 product INTEL 4HS_H_PCIE_24	0x06af	400 Series PCIe Root Port 24
 product INTEL 4HS_H_PCIE_9	0x06b0	400 Series PCIe Root Port 9
@@ -4667,7 +4667,7 @@ product INTEL XE5_V3_QDT_CH1	0x2f21	Xeon
 product INTEL XE5_V3_QDT_CH2	0x2f22	Xeon E5 v3 QDT DMA Channel 2
 product INTEL XE5_V3_QDT_CH3	0x2f23	Xeon E5 v3 QDT DMA Channel 3
 product INTEL XE5_V3_QDT_CH4	0x2f24	Xeon E5 v3 QDT DMA Channel 4
-product INTEL XE5_V3_QDT_CH5	0x2f25	Xeon E5 v3 QDT DMA Channel 5 
+product INTEL XE5_V3_QDT_CH5	0x2f25	Xeon E5 v3 QDT DMA Channel 5
 product INTEL XE5_V3_QDT_CH6	0x2f26	Xeon E5 v3 QDT DMA Channel 6
 product INTEL XE5_V3_QDT_CH7	0x2f27	Xeon E5 v3 QDT DMA Channel 7
 product INTEL XE5_V3_IIO_AM	0x2f28	Xeon E5 v3 Address Map, VTd, SMM
@@ -6564,7 +6564,7 @@ product	SYMBIOS	SAS3324_9		0x00c8	SAS332
 product	SYMBIOS	SAS3324_10		0x00c9	SAS3324
 product SYMBIOS MEGARAID_320X		0x0407	LSI Megaraid SCSI 320-X
 product SYMBIOS MEGARAID_320E		0x0408	LSI Megaraid SCSI 320-E
-product SYMBIOS MEGARAID_300X		0x0409	LSI Megaraid SATA (300-6X/300-8X) 
+product SYMBIOS MEGARAID_300X		0x0409	LSI Megaraid SATA (300-6X/300-8X)
 product SYMBIOS MEGARAID_SAS		0x0411	MegaRAID SAS
 product SYMBIOS MEGARAID_VERDE_ZCR	0x0413	MegaRAID Verde ZCR
 product SYMBIOS FC909			0x0620	FC909
@@ -7508,7 +7508,7 @@ product RALINK	RT5390_2	0x5392	RT5390
 product RALINK	RT5390_3	0x539a	RT5390
 product RALINK	RT5390_4	0x539b	RT5390
 product RALINK	RT5390_5	0x539f	RT5390
-	
+
 /* RATOC Systems products */
 product RATOC	REXPCI31	0x0853	REX PCI-31/33 SCSI
 
@@ 

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

2020-12-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 10:24:22 UTC 2020

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

Log Message:
lint: rename functions that had very short names

C99 guarantees that the first 31 characters of an identifier with
external linkage are significant.  This removes the need to use
abbreviations for common words.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.74 -r1.75 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/xlint/lint1/main1.c
cvs rdiff -u -r1.93 -r1.94 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.110 src/usr.bin/xlint/lint1/cgram.y:1.111
--- src/usr.bin/xlint/lint1/cgram.y:1.110	Mon Dec 28 21:24:55 2020
+++ src/usr.bin/xlint/lint1/cgram.y	Tue Dec 29 10:24:22 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.110 2020/12/28 21:24:55 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.111 2020/12/29 10:24:22 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.110 2020/12/28 21:24:55 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.111 2020/12/29 10:24:22 rillig Exp $");
 #endif
 
 #include 
@@ -846,23 +846,23 @@ noclass_declmods:
 
 notype_member_decls:
 	  notype_member_decl {
-		$$ = decl1str($1);
+		$$ = declarator_1_struct_union($1);
 	  }
 	| notype_member_decls {
 		symtyp = FMOS;
 	  } T_COMMA type_member_decl {
-		$$ = lnklst($1, decl1str($4));
+		$$ = lnklst($1, declarator_1_struct_union($4));
 	  }
 	;
 
 type_member_decls:
 	  type_member_decl {
-		$$ = decl1str($1);
+		$$ = declarator_1_struct_union($1);
 	  }
 	| type_member_decls {
 		symtyp = FMOS;
 	  } T_COMMA type_member_decl {
-		$$ = lnklst($1, decl1str($4));
+		$$ = lnklst($1, declarator_1_struct_union($4));
 	  }
 	;
 
@@ -997,24 +997,24 @@ type_init_decls:
 notype_init_decl:
 	  notype_decl opt_asm_or_symbolrename {
 		idecl($1, 0, $2);
-		chksz($1);
+		check_size($1);
 	  }
 	| notype_decl opt_asm_or_symbolrename {
 		idecl($1, 1, $2);
 	  } T_ASSIGN initializer {
-		chksz($1);
+		check_size($1);
 	  }
 	;
 
 type_init_decl:
 	  type_decl opt_asm_or_symbolrename {
 		idecl($1, 0, $2);
-		chksz($1);
+		check_size($1);
 	  }
 	| type_decl opt_asm_or_symbolrename {
 		idecl($1, 1, $2);
 	  } T_ASSIGN initializer {
-		chksz($1);
+		check_size($1);
 	  }
 	;
 
@@ -1023,13 +1023,13 @@ notype_decl:
 		$$ = $1;
 	  }
 	| pointer notype_direct_decl {
-		$$ = addptr($2, $1);
+		$$ = add_pointer($2, $1);
 	  }
 	;
 
 notype_direct_decl:
 	  T_NAME {
-		$$ = dname(getsym($1));
+		$$ = declarator_name(getsym($1));
 	  }
 	| T_LPARN type_decl T_RPARN {
 		$$ = $2;
@@ -1038,13 +1038,13 @@ notype_direct_decl:
 		$$ = $2;
 	}
 	| notype_direct_decl T_LBRACK T_RBRACK {
-		$$ = addarray($1, 0, 0);
+		$$ = add_array($1, 0, 0);
 	  }
 	| notype_direct_decl T_LBRACK constant T_RBRACK {
-		$$ = addarray($1, 1, toicon($3, 0));
+		$$ = add_array($1, 1, toicon($3, 0));
 	  }
 	| notype_direct_decl param_list opt_asm_or_symbolrename {
-		$$ = addfunc(symbolrename($1, $3), $2);
+		$$ = add_function(symbolrename($1, $3), $2);
 		popdecl();
 		blklev--;
 	  }
@@ -1056,13 +1056,13 @@ type_decl:
 		$$ = $1;
 	  }
 	| pointer type_direct_decl {
-		$$ = addptr($2, $1);
+		$$ = add_pointer($2, $1);
 	  }
 	;
 
 type_direct_decl:
 	  identifier {
-		$$ = dname(getsym($1));
+		$$ = declarator_name(getsym($1));
 	  }
 	| T_LPARN type_decl T_RPARN {
 		$$ = $2;
@@ -1071,13 +1071,13 @@ type_direct_decl:
 		$$ = $2;
 	}
 	| type_direct_decl T_LBRACK T_RBRACK {
-		$$ = addarray($1, 0, 0);
+		$$ = add_array($1, 0, 0);
 	  }
 	| type_direct_decl T_LBRACK constant T_RBRACK {
-		$$ = addarray($1, 1, toicon($3, 0));
+		$$ = add_array($1, 1, toicon($3, 0));
 	  }
 	| type_direct_decl param_list opt_asm_or_symbolrename {
-		$$ = addfunc(symbolrename($1, $3), $2);
+		$$ = add_function(symbolrename($1, $3), $2);
 		popdecl();
 		blklev--;
 	  }
@@ -1096,28 +1096,28 @@ param_decl:
 		$$ = $1;
 	  }
 	| pointer direct_param_decl {
-		$$ = addptr($2, $1);
+		$$ = add_pointer($2, $1);
 	  }
 	;
 
 direct_param_decl:
 	  identifier type_attribute_list {
-		$$ = dname(getsym($1));
+		$$ = declarator_name(getsym($1));
 	  }
 	| identifier {
-		$$ = dname(getsym($1));
+		$$ = declarator_name(getsym($1));
 	  }
 	| T_LPARN notype_param_decl T_RPARN {
 		$$ = $2;
 	  }
 	| direct_param_decl T_LBRACK T_RBRACK {
-		$$ = addarray($1, 0, 0);
+		$$ = add_array($1, 0, 0);
 	  }
 	| direct_param_decl T_LBRACK constant T_RBRACK {
-		$$ = addarray($1, 1, 

CVS commit: src/sys/dev/usb

2020-12-29 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Tue Dec 29 08:04:59 UTC 2020

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

Log Message:
During detach, re-use the functions that halt playback and record DMA.
Prevents a panic during shutdown when media is playing.


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/dev/usb/uaudio.c

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

Modified files:

Index: src/sys/dev/usb/uaudio.c
diff -u src/sys/dev/usb/uaudio.c:1.165 src/sys/dev/usb/uaudio.c:1.166
--- src/sys/dev/usb/uaudio.c:1.165	Sat Mar 14 02:35:33 2020
+++ src/sys/dev/usb/uaudio.c	Tue Dec 29 08:04:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaudio.c,v 1.165 2020/03/14 02:35:33 christos Exp $	*/
+/*	$NetBSD: uaudio.c,v 1.166 2020/12/29 08:04:59 jdc Exp $	*/
 
 /*
  * Copyright (c) 1999, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.165 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.166 2020/12/29 08:04:59 jdc Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -343,6 +343,8 @@ Static int	uaudio_trigger_input
 	 const audio_params_t *);
 Static int	uaudio_halt_in_dma(void *);
 Static int	uaudio_halt_out_dma(void *);
+Static void	uaudio_halt_in_dma_unlocked(struct uaudio_softc *);
+Static void	uaudio_halt_out_dma_unlocked(struct uaudio_softc *);
 Static int	uaudio_getdev(void *, struct audio_device *);
 Static int	uaudio_mixer_set_port(void *, mixer_ctrl_t *);
 Static int	uaudio_mixer_get_port(void *, mixer_ctrl_t *);
@@ -519,10 +521,13 @@ uaudio_detach(device_t self, int flags)
 	struct uaudio_softc *sc = device_private(self);
 	int rv = 0;
 
+	sc->sc_dying = 1;
+
 	pmf_device_deregister(self);
 
 	/* Wait for outstanding requests to complete. */
-	usbd_delay_ms(sc->sc_udev, UAUDIO_NCHANBUFS * UAUDIO_NFRAMES);
+	uaudio_halt_out_dma_unlocked(sc);
+	uaudio_halt_in_dma_unlocked(sc);
 
 	if (sc->sc_audiodev != NULL)
 		rv = config_detach(sc->sc_audiodev, flags);
@@ -2167,15 +2172,21 @@ uaudio_halt_out_dma(void *addr)
 	DPRINTF("%s", "enter\n");
 
 	mutex_exit(>sc_intr_lock);
+	uaudio_halt_out_dma_unlocked(sc);
+	mutex_enter(>sc_intr_lock);
+
+	return 0;
+}
+
+Static void
+uaudio_halt_out_dma_unlocked(struct uaudio_softc *sc)
+{
 	if (sc->sc_playchan.pipe != NULL) {
 		uaudio_chan_abort(sc, >sc_playchan);
 		uaudio_chan_free_buffers(sc, >sc_playchan);
 		uaudio_chan_close(sc, >sc_playchan);
 		sc->sc_playchan.intr = NULL;
 	}
-	mutex_enter(>sc_intr_lock);
-
-	return 0;
 }
 
 Static int
@@ -2186,15 +2197,21 @@ uaudio_halt_in_dma(void *addr)
 	DPRINTF("%s", "enter\n");
 
 	mutex_exit(>sc_intr_lock);
+	uaudio_halt_in_dma_unlocked(sc);
+	mutex_enter(>sc_intr_lock);
+
+	return 0;
+}
+
+Static void
+uaudio_halt_in_dma_unlocked(struct uaudio_softc *sc)
+{
 	if (sc->sc_recchan.pipe != NULL) {
 		uaudio_chan_abort(sc, >sc_recchan);
 		uaudio_chan_free_buffers(sc, >sc_recchan);
 		uaudio_chan_close(sc, >sc_recchan);
 		sc->sc_recchan.intr = NULL;
 	}
-	mutex_enter(>sc_intr_lock);
-
-	return 0;
 }
 
 Static int



CVS commit: src/sys/dev/ic

2020-12-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 29 08:00:48 UTC 2020

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

Log Message:
Some more whitespace consistency / KNF


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/ic/ahcisata_core.c

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

Modified files:

Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.93 src/sys/dev/ic/ahcisata_core.c:1.94
--- src/sys/dev/ic/ahcisata_core.c:1.93	Tue Dec 29 07:56:22 2020
+++ src/sys/dev/ic/ahcisata_core.c	Tue Dec 29 08:00:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.93 2020/12/29 07:56:22 skrll Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.94 2020/12/29 08:00:48 skrll Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.93 2020/12/29 07:56:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.94 2020/12/29 08:00:48 skrll Exp $");
 
 #include 
 #include 
@@ -702,7 +702,6 @@ ahci_intr_port_common(struct ata_channel
 
 			AHCIDEBUG_PRINT(("%s port %d: transfer aborted 0x%x\n",
 			AHCINAME(sc), chp->ch_channel, tfd), DEBUG_INTR);
-
 		}
 	} else {
 		tfd = 0;
@@ -1170,7 +1169,7 @@ ahci_cmd_start(struct ata_channel *chp, 
 
 	cmd_tbl = achp->ahcic_cmd_tbl[slot];
 	AHCIDEBUG_PRINT(("%s port %d tbl %p\n", AHCINAME(sc), chp->ch_channel,
-	  cmd_tbl), DEBUG_XFERS);
+	cmd_tbl), DEBUG_XFERS);
 
 	satafis_rhd_construct_cmd(ata_c, cmd_tbl->cmdt_cfis);
 	cmd_tbl->cmdt_cfis[rhd_c] |= xfer->c_drive;
@@ -1763,7 +1762,7 @@ ahci_dma_setup(struct ata_channel *chp, 
 	bus_dmamap_sync(sc->sc_dmat, achp->ahcic_datad[slot], 0,
 	achp->ahcic_datad[slot]->dm_mapsize,
 	(op == BUS_DMA_READ) ? BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
-	for (seg = 0; seg <  achp->ahcic_datad[slot]->dm_nsegs; seg++) {
+	for (seg = 0; seg < achp->ahcic_datad[slot]->dm_nsegs; seg++) {
 		cmd_tbl->cmdt_prd[seg].prd_dba = htole64(
 		 achp->ahcic_datad[slot]->dm_segs[seg].ds_addr);
 		cmd_tbl->cmdt_prd[seg].prd_dbc = htole32(