CVS commit: othersrc/usr.bin/tnftp/buildaux

2021-08-25 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Thu Aug 26 00:32:36 UTC 2021

Added Files:
othersrc/usr.bin/tnftp/buildaux: ar-lib compile

Log Message:
add files missed in previous regen


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 othersrc/usr.bin/tnftp/buildaux/ar-lib \
othersrc/usr.bin/tnftp/buildaux/compile

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



CVS commit: othersrc/usr.bin/tnftp/buildaux

2021-08-25 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Thu Aug 26 00:32:36 UTC 2021

Added Files:
othersrc/usr.bin/tnftp/buildaux: ar-lib compile

Log Message:
add files missed in previous regen


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 othersrc/usr.bin/tnftp/buildaux/ar-lib \
othersrc/usr.bin/tnftp/buildaux/compile

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

Added files:

Index: othersrc/usr.bin/tnftp/buildaux/ar-lib
diff -u /dev/null othersrc/usr.bin/tnftp/buildaux/ar-lib:1.1
--- /dev/null	Thu Aug 26 00:32:36 2021
+++ othersrc/usr.bin/tnftp/buildaux/ar-lib	Thu Aug 26 00:32:35 2021
@@ -0,0 +1,270 @@
+#! /bin/sh
+# Wrapper for Microsoft lib.exe
+
+me=ar-lib
+scriptversion=2012-03-01.08; # UTC
+
+# Copyright (C) 2010-2018 Free Software Foundation, Inc.
+# Written by Peter Rosin .
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to  or send patches to
+# .
+
+
+# func_error message
+func_error ()
+{
+  echo "$me: $1" 1>&2
+  exit 1
+}
+
+file_conv=
+
+# func_file_conv build_file
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+/ | /[!/]*) # absolute file, and not a UNC file
+  if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	file_conv=mingw
+	;;
+	  CYGWIN*)
+	file_conv=cygwin
+	;;
+	  *)
+	file_conv=wine
+	;;
+	esac
+  fi
+  case $file_conv in
+	mingw)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+  esac
+  ;;
+  esac
+}
+
+# func_at_file at_file operation archive
+# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
+# for each of them.
+# When interpreting the content of the @FILE, do NOT use func_file_conv,
+# since the user would need to supply preconverted file names to
+# binutils ar, at least for MinGW.
+func_at_file ()
+{
+  operation=$2
+  archive=$3
+  at_file_contents=`cat "$1"`
+  eval set x "$at_file_contents"
+  shift
+
+  for member
+  do
+$AR -NOLOGO $operation:"$member" "$archive" || exit $?
+  done
+}
+
+case $1 in
+  '')
+ func_error "no command.  Try '$0 --help' for more information."
+ ;;
+  -h | --h*)
+cat <.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to  or send patches to
+# .
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+/ | /[!/]*) # absolute file, and not a UNC file
+  if test -z "$file_conv"; then
+	# lazily determine how 

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

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:00:27 UTC 2021

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

Log Message:
lint: rename local variable in plength

The assertion in build_plus_minus is safe since that function is only
called if the types are compatible.  Pointer and floating are not
compatible.

No functional change.


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

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



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

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:00:27 UTC 2021

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

Log Message:
lint: rename local variable in plength

The assertion in build_plus_minus is safe since that function is only
called if the types are compatible.  Pointer and floating are not
compatible.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.351 -r1.352 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.351 src/usr.bin/xlint/lint1/tree.c:1.352
--- src/usr.bin/xlint/lint1/tree.c:1.351	Mon Aug 23 17:03:23 2021
+++ src/usr.bin/xlint/lint1/tree.c	Wed Aug 25 22:00:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.351 2021/08/23 17:03:23 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.352 2021/08/25 22:00:26 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.351 2021/08/23 17:03:23 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.352 2021/08/25 22:00:26 rillig Exp $");
 #endif
 
 #include 
@@ -2769,8 +2769,6 @@ build_plus_minus(op_t op, tnode_t *ln, t
 	}
 
 	if (ln->tn_type->t_tspec == PTR && rn->tn_type->t_tspec != PTR) {
-
-		/* XXX: this assertion should be easy to trigger */
 		lint_assert(is_integer(rn->tn_type->t_tspec));
 
 		check_ctype_macro_invocation(ln, rn);
@@ -2946,18 +2944,19 @@ build_assignment(op_t op, tnode_t *ln, t
 }
 
 /*
- * Get length of type tp->t_subt.
+ * Get length of type tp->t_subt, as a constant expression of type ptrdiff_t
+ * as seen from the target platform.
  */
 static tnode_t *
 plength(type_t *tp)
 {
-	int	elem, elsz;
+	int elem, elsz_in_bits;
 
 	lint_assert(tp->t_tspec == PTR);
 	tp = tp->t_subt;
 
 	elem = 1;
-	elsz = 0;
+	elsz_in_bits = 0;
 
 	while (tp->t_tspec == ARRAY) {
 		elem *= tp->t_dim;
@@ -2975,7 +2974,7 @@ plength(type_t *tp)
 		break;
 	case STRUCT:
 	case UNION:
-		if ((elsz = tp->t_str->sou_size_in_bits) == 0)
+		if ((elsz_in_bits = tp->t_str->sou_size_in_bits) == 0)
 			/* cannot do pointer arithmetic on operand of ... */
 			error(136);
 		break;
@@ -2986,25 +2985,25 @@ plength(type_t *tp)
 		}
 		/* FALLTHROUGH */
 	default:
-		if ((elsz = size_in_bits(tp->t_tspec)) == 0) {
+		if ((elsz_in_bits = size_in_bits(tp->t_tspec)) == 0) {
 			/* cannot do pointer arithmetic on operand of ... */
 			error(136);
 		} else {
-			lint_assert(elsz != -1);
+			lint_assert(elsz_in_bits != -1);
 		}
 		break;
 	}
 
-	if (elem == 0 && elsz != 0) {
+	if (elem == 0 && elsz_in_bits != 0) {
 		/* cannot do pointer arithmetic on operand of unknown size */
 		error(136);
 	}
 
-	if (elsz == 0)
-		elsz = CHAR_SIZE;
+	if (elsz_in_bits == 0)
+		elsz_in_bits = CHAR_SIZE;
 
 	return build_integer_constant(PTRDIFF_TSPEC,
-	(int64_t)(elem * elsz / CHAR_SIZE));
+	(int64_t)(elem * elsz_in_bits / CHAR_SIZE));
 }
 
 /*



CVS commit: src/usr.bin/base64

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:43:20 UTC 2021

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

Log Message:
base64: fix lint warning about 'strchr' discarding 'const'

No change to the resulting binary.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/base64/base64.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/base64/base64.c
diff -u src/usr.bin/base64/base64.c:1.3 src/usr.bin/base64/base64.c:1.4
--- src/usr.bin/base64/base64.c:1.3	Fri Aug 14 13:40:25 2020
+++ src/usr.bin/base64/base64.c	Wed Aug 25 22:43:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: base64.c,v 1.3 2020/08/14 13:40:25 christos Exp $	*/
+/*	$NetBSD: base64.c,v 1.4 2021/08/25 22:43:20 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: base64.c,v 1.3 2020/08/14 13:40:25 christos Exp $");
+__RCSID("$NetBSD: base64.c,v 1.4 2021/08/25 22:43:20 rillig Exp $");
 
 #include 
 #include 
@@ -132,7 +132,7 @@ b64_decode(FILE *fout, FILE *fin, bool i
 {
 	int state, c;
 	uint8_t b, out;
-	char *pos;
+	const char *pos;
 
 	state = 0;
 	out = 0;



CVS commit: src/usr.bin/base64

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:43:20 UTC 2021

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

Log Message:
base64: fix lint warning about 'strchr' discarding 'const'

No change to the resulting binary.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/base64/base64.c

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



CVS commit: src/usr.bin/indent

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:26:30 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c lexi.c

Log Message:
indent: fix lint warnings about type conversions on ilp32

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/indent/lexi.c

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



CVS commit: src/usr.bin/indent

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:26:30 UTC 2021

Modified Files:
src/usr.bin/indent: indent.c lexi.c

Log Message:
indent: fix lint warnings about type conversions on ilp32

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/indent/lexi.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/indent/indent.c
diff -u src/usr.bin/indent/indent.c:1.60 src/usr.bin/indent/indent.c:1.61
--- src/usr.bin/indent/indent.c:1.60	Fri Mar 26 22:02:00 2021
+++ src/usr.bin/indent/indent.c	Wed Aug 25 22:26:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.c,v 1.60 2021/03/26 22:02:00 rillig Exp $	*/
+/*	$NetBSD: indent.c,v 1.61 2021/08/25 22:26:30 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -46,7 +46,7 @@ static char sccsid[] = "@(#)indent.c	5.1
 #include 
 #ifndef lint
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: indent.c,v 1.60 2021/03/26 22:02:00 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.61 2021/08/25 22:26:30 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $");
 #endif
@@ -1197,7 +1197,7 @@ process_preprocessing(void)
 	}
 	if (sc_end - save_com + com_end - com_start > sc_size)
 		errx(1, "input too long");
-	memmove(sc_end, s_lab + com_start, com_end - com_start);
+	memmove(sc_end, s_lab + com_start, (size_t)(com_end - com_start));
 	sc_end += com_end - com_start;
 	e_lab = s_lab + com_start;
 	while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t'))
@@ -1235,22 +1235,12 @@ process_preprocessing(void)
 	else
 	ifdef_level--;
 } else {
-	static const struct directives {
-	int size;
-	const char *string;
-	} recognized[] = {
-		{7, "include"},
-		{6, "define"},
-		{5, "undef"},
-		{4, "line"},
-		{5, "error"},
-		{6, "pragma"}
-	};
-	int d = nitems(recognized);
-	while (--d >= 0)
-	if (strncmp(s_lab + 1, recognized[d].string, recognized[d].size) == 0)
-		break;
-	if (d < 0) {
+	if (strncmp(s_lab + 1, "pragma", 6) != 0 &&
+	strncmp(s_lab + 1, "error", 5) != 0 &&
+	strncmp(s_lab + 1, "line", 4) != 0 &&
+	strncmp(s_lab + 1, "undef", 5) != 0 &&
+	strncmp(s_lab + 1, "define", 6) != 0 &&
+	strncmp(s_lab + 1, "include", 7) != 0) {
 	diag(1, "Unrecognized cpp directive");
 	return;
 	}
@@ -1538,13 +1528,13 @@ indent_declaration(int cur_dec_ind, int 
 if (tabs_to_var) {
 	int tpos;
 
-	check_size_code(cur_dec_ind / opt.tabsize);
+	check_size_code((size_t)(cur_dec_ind / opt.tabsize));
 	while ((tpos = opt.tabsize * (1 + pos / opt.tabsize)) <= cur_dec_ind) {
 	*e_code++ = '\t';
 	pos = tpos;
 	}
 }
-check_size_code(cur_dec_ind - pos + 1);
+check_size_code((size_t)(cur_dec_ind - pos + 1));
 while (pos < cur_dec_ind) {
 	*e_code++ = ' ';
 	pos++;

Index: src/usr.bin/indent/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.41 src/usr.bin/indent/lexi.c:1.42
--- src/usr.bin/indent/lexi.c:1.41	Sun Mar 14 00:22:16 2021
+++ src/usr.bin/indent/lexi.c	Wed Aug 25 22:26:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.41 2021/03/14 00:22:16 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.42 2021/08/25 22:26:30 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -46,7 +46,7 @@ static char sccsid[] = "@(#)lexi.c	8.1 (
 #include 
 #ifndef lint
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.41 2021/03/14 00:22:16 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.42 2021/08/25 22:26:30 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -377,7 +377,7 @@ lexi(struct parser_state *state)
 	/* ... so maybe a type_t or a typedef */
 	if ((opt.auto_typedefs && ((u = strrchr(s_token, '_')) != NULL) &&
 	strcmp(u, "_t") == 0) || (typename_top >= 0 &&
-		  bsearch(s_token, typenames, typename_top + 1,
+		  bsearch(s_token, typenames, (size_t)typename_top + 1,
 		sizeof typenames[0], compare_string_array))) {
 		state->keyword = rw_type;
 		state->last_u_d = true;



CVS commit: src/usr.bin/cksum

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 23:03:01 UTC 2021

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

Log Message:
cksum: remove trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/cksum/cksum.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/cksum/cksum.c
diff -u src/usr.bin/cksum/cksum.c:1.50 src/usr.bin/cksum/cksum.c:1.51
--- src/usr.bin/cksum/cksum.c:1.50	Wed Aug 25 22:59:57 2021
+++ src/usr.bin/cksum/cksum.c	Wed Aug 25 23:03:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cksum.c,v 1.50 2021/08/25 22:59:57 rillig Exp $	*/
+/*	$NetBSD: cksum.c,v 1.51 2021/08/25 23:03:01 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)cksum.c	8.2 (Berkeley) 4/28/95";
 #endif
-__RCSID("$NetBSD: cksum.c,v 1.50 2021/08/25 22:59:57 rillig Exp $");
+__RCSID("$NetBSD: cksum.c,v 1.51 2021/08/25 23:03:01 rillig Exp $");
 #endif /* not lint */
 
 #include 
@@ -303,7 +303,7 @@ main(int argc, char **argv)
 		if (f == NULL)
 			err(1, "Cannot read %s",
 			argc>0?argv[0]:"stdin");
-		
+
 		while(fgets(buf, sizeof(buf), f) != NULL) {
 			s = strrchr(buf, '\n');
 			if (s)
@@ -332,7 +332,7 @@ main(int argc, char **argv)
 
 l_cksum = strlen(p_cksum);
 l_filename = p_cksum - p_filename - 4;
-	
+
 /* Sanity check, and find proper hash if
  * it's not the same as the current program
  */
@@ -343,7 +343,7 @@ main(int argc, char **argv)
 	 * Search proper hash
 	 */
 	const struct hash *nhash;
-	
+
 	for (nhash = hashes ;
 	 nhash->hashname != NULL;
 	 nhash++)
@@ -351,8 +351,8 @@ main(int argc, char **argv)
 			nhash->hashname,
 			strlen(nhash->hashname)) == 0)
 			break;
-	
-	
+
+
 	if (nhash->hashname == NULL) {
 		if (check_warn)
 			warnx("unknown hash: %s",
@@ -373,7 +373,7 @@ main(int argc, char **argv)
 	 */
 	print_flags |= PRINT_NORMAL;
 	nspaces = 1;
-	
+
 	p_cksum = buf;
 	p_filename = strchr(buf, ' ');
 	if (p_filename == NULL) {
@@ -433,11 +433,11 @@ main(int argc, char **argv)
 	rval = 1;
 	ok = 0;
 } else {
-	if (cfncn(fd, , )) 
+	if (cfncn(fd, , ))
 		ok = 0;
 	else {
 		uint32_t should_val;
-		
+
 		should_val =
 		  strtoul(cksum, NULL, 10);
 		if (val == should_val)
@@ -460,9 +460,9 @@ main(int argc, char **argv)
 		}
 		fclose(f);
 
-		if (badcnt > 0) 
+		if (badcnt > 0)
 			rval = 1;
-		
+
 	} else {
 		/*
 		 * Calculate checksums
@@ -489,7 +489,7 @@ main(int argc, char **argv)
 			} else if (hash && !nohashstdin) {
 hash->filterfunc(pflag);
 			}
-			
+
 			if (hash == NULL) {
 if (cfncn(fd, , )) {
 	warn("%s", fn ? fn : "stdin");



CVS commit: src/usr.bin/cksum

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 23:03:01 UTC 2021

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

Log Message:
cksum: remove trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/cksum/cksum.c

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



CVS commit: src/usr.bin/db

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 23:11:51 UTC 2021

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

Log Message:
db: fix lint warnings about wrong call to ctype functions


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

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



CVS commit: src/usr.bin/db

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 23:11:51 UTC 2021

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

Log Message:
db: fix lint warnings about wrong call to ctype functions


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/db/db.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/db/db.c
diff -u src/usr.bin/db/db.c:1.26 src/usr.bin/db/db.c:1.27
--- src/usr.bin/db/db.c:1.26	Fri Feb 17 11:37:33 2012
+++ src/usr.bin/db/db.c	Wed Aug 25 23:11:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: db.c,v 1.26 2012/02/17 11:37:33 apb Exp $	*/
+/*	$NetBSD: db.c,v 1.27 2021/08/25 23:11:51 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2002-2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #include 
 #ifndef lint
 #ifdef __RCSID
-__RCSID("$NetBSD: db.c,v 1.26 2012/02/17 11:37:33 apb Exp $");
+__RCSID("$NetBSD: db.c,v 1.27 2021/08/25 23:11:51 rillig Exp $");
 #endif /* __RCSID */
 #endif /* not lint */
 
@@ -139,7 +139,7 @@ main(int argc, char *argv[])
 		case 'E':
 			if (! optarg[0] || optarg[1])
 goto badendian;
-			switch (toupper((int)optarg[0])) {
+			switch (toupper((unsigned char)optarg[0])) {
 			case 'B':
 flags |= F_ENDIAN_BIG;
 break;
@@ -441,8 +441,8 @@ db_makekey(DBT *key, char *keystr, int d
 	key->size = klen + (flags & F_INCLUDE_NUL ? 0 : 1);
 	if (downcase && (flags & F_IGNORECASE)) {
 		for (p = ks; *p; p++)
-			if (isupper((int)*p))
-*p = tolower((int)*p);
+			if (isupper((unsigned char)*p))
+*p = tolower((unsigned char)*p);
 	}
 }
 
@@ -705,7 +705,6 @@ parse_encode_option(char **arg)
 break;
 			default:
 return (0);
-break;
 		}
 	}
 	return (r);



CVS commit: src/sys/dev

2021-08-25 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Aug 25 21:50:29 UTC 2021

Modified Files:
src/sys/dev/mii: smscphy.c
src/sys/dev/pci: pm3fb.c pm3reg.h

Log Message:
Add missing RCSID and __KERNEL_RCSID().


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mii/smscphy.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/pm3fb.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/pm3reg.h

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



CVS commit: src/sys/dev

2021-08-25 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Aug 25 21:50:29 UTC 2021

Modified Files:
src/sys/dev/mii: smscphy.c
src/sys/dev/pci: pm3fb.c pm3reg.h

Log Message:
Add missing RCSID and __KERNEL_RCSID().


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mii/smscphy.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/pm3fb.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/pm3reg.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/mii/smscphy.c
diff -u src/sys/dev/mii/smscphy.c:1.3 src/sys/dev/mii/smscphy.c:1.4
--- src/sys/dev/mii/smscphy.c:1.3	Sun Mar 15 23:04:50 2020
+++ src/sys/dev/mii/smscphy.c	Wed Aug 25 21:50:29 2021
@@ -1,3 +1,5 @@
+/* $NetBSD: smscphy.c,v 1.4 2021/08/25 21:50:29 andvar Exp $ */
+
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
@@ -24,13 +26,15 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include 
 /* $FreeBSD: head/sys/dev/mii/smscphy.c 326255 2017-11-27 14:52:40Z pfg $ */
 
 /*
  * Driver for the SMSC LAN8710A
  */
 
+#include 
+__KERNEL_RCSID(0, "$NetBSD: smscphy.c,v 1.4 2021/08/25 21:50:29 andvar Exp $");
+
 #include 
 #include 
 #include 

Index: src/sys/dev/pci/pm3fb.c
diff -u src/sys/dev/pci/pm3fb.c:1.7 src/sys/dev/pci/pm3fb.c:1.8
--- src/sys/dev/pci/pm3fb.c:1.7	Sat Aug  7 16:19:14 2021
+++ src/sys/dev/pci/pm3fb.c	Wed Aug 25 21:50:29 2021
@@ -1,3 +1,5 @@
+/* $NetBSD: pm3fb.c,v 1.8 2021/08/25 21:50:29 andvar Exp $ */
+
 /*
  * Copyright (c) 2015 Naruaki Etomi
  * All rights reserved.
@@ -29,6 +31,9 @@
  * pm3_accel.c, pm3_dac.c and pm2fb framebuffer console driver
  */
 
+#include 
+__KERNEL_RCSID(0, "$NetBSD: pm3fb.c,v 1.8 2021/08/25 21:50:29 andvar Exp $");
+
 #include 
 #include 
 #include 

Index: src/sys/dev/pci/pm3reg.h
diff -u src/sys/dev/pci/pm3reg.h:1.2 src/sys/dev/pci/pm3reg.h:1.3
--- src/sys/dev/pci/pm3reg.h:1.2	Sat Jun 17 16:11:14 2017
+++ src/sys/dev/pci/pm3reg.h	Wed Aug 25 21:50:29 2021
@@ -1,3 +1,5 @@
+/* $NetBSD: pm3reg.h,v 1.3 2021/08/25 21:50:29 andvar Exp $ */
+
 /*
  * Copyright (c) 2015 Naruaki Etomi
  * All rights reserved.



CVS commit: src/usr.bin/btkey

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:52:26 UTC 2021

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

Log Message:
btkey: fix lint warning about wrong call to tolower


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/btkey/btkey.c

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



CVS commit: src/usr.bin/btkey

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:52:26 UTC 2021

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

Log Message:
btkey: fix lint warning about wrong call to tolower


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/btkey/btkey.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/btkey/btkey.c
diff -u src/usr.bin/btkey/btkey.c:1.4 src/usr.bin/btkey/btkey.c:1.5
--- src/usr.bin/btkey/btkey.c:1.4	Mon Aug 29 14:24:03 2011
+++ src/usr.bin/btkey/btkey.c	Wed Aug 25 22:52:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: btkey.c,v 1.4 2011/08/29 14:24:03 joerg Exp $	*/
+/*	$NetBSD: btkey.c,v 1.5 2021/08/25 22:52:25 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2007 Iain Hibbert
@@ -29,7 +29,7 @@
 
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2007 Iain Hibbert.  All rights reserved.");
-__RCSID("$NetBSD: btkey.c,v 1.4 2011/08/29 14:24:03 joerg Exp $");
+__RCSID("$NetBSD: btkey.c,v 1.5 2021/08/25 22:52:25 rillig Exp $");
 
 #include 
 #include 
@@ -254,7 +254,9 @@ scan_key(const char *arg)
 			if (*arg == '\0')
 return true;
 
-			for (p = digits ; *p != tolower((int)*arg) ; p++)
+			for (p = digits ;
+			*p != tolower((unsigned char)*arg) ;
+			p++)
 if (*p == '\0')
 	return false;
 



CVS commit: src

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:04:52 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/xlint/lint1: Makefile decl_struct_member.c
decl_struct_member.exp msg_132.c msg_132.exp
Added Files:
src/tests/usr.bin/xlint/lint1: msg_132_ilp32.c msg_132_ilp32.exp

Log Message:
tests/lint: test conversion from long long to intptr_t on ilp32

Seen in usr.bin/make/var.c:1608.


To generate a diff of this commit:
cvs rdiff -u -r1.1116 -r1.1117 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.106 -r1.107 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/decl_struct_member.c
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/decl_struct_member.exp
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_132.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_132.exp
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/msg_132_ilp32.c \
src/tests/usr.bin/xlint/lint1/msg_132_ilp32.exp

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1116 src/distrib/sets/lists/tests/mi:1.1117
--- src/distrib/sets/lists/tests/mi:1.1116	Tue Aug 24 21:30:52 2021
+++ src/distrib/sets/lists/tests/mi	Wed Aug 25 22:04:51 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1116 2021/08/24 21:30:52 rillig Exp $
+# $NetBSD: mi,v 1.1117 2021/08/25 22:04:51 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6583,6 +6583,8 @@
 ./usr/tests/usr.bin/xlint/lint1/msg_131.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/msg_132.c			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/msg_132.exp			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/msg_132_ilp32.c			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/msg_132_ilp32.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/msg_133.c			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/msg_133.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/msg_134.c			tests-usr.bin-tests	compattestfile,atf

Index: src/tests/usr.bin/xlint/lint1/Makefile
diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.106 src/tests/usr.bin/xlint/lint1/Makefile:1.107
--- src/tests/usr.bin/xlint/lint1/Makefile:1.106	Sun Aug 22 20:56:51 2021
+++ src/tests/usr.bin/xlint/lint1/Makefile	Wed Aug 25 22:04:52 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.106 2021/08/22 20:56:51 rillig Exp $
+# $NetBSD: Makefile,v 1.107 2021/08/25 22:04:52 rillig Exp $
 
 NOMAN=		# defined
 MAX_MESSAGE=	346		# see lint1/err.c
@@ -208,6 +208,8 @@ FILES+=		msg_001_c90.c
 FILES+=		msg_001_c90.exp
 FILES+=		msg_000_c90.c
 FILES+=		msg_000_c90.exp
+FILES+=		msg_132_ilp32.c
+FILES+=		msg_132_ilp32.exp
 FILES+=		msg_230_uchar.c
 FILES+=		msg_230_uchar.exp
 FILES+=		msg_259_ilp32.c

Index: src/tests/usr.bin/xlint/lint1/decl_struct_member.c
diff -u src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.10 src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.11
--- src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.10	Wed Jul 21 21:17:57 2021
+++ src/tests/usr.bin/xlint/lint1/decl_struct_member.c	Wed Aug 25 22:04:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: decl_struct_member.c,v 1.10 2021/07/21 21:17:57 rillig Exp $	*/
+/*	$NetBSD: decl_struct_member.c,v 1.11 2021/08/25 22:04:52 rillig Exp $	*/
 # 3 "decl_struct_member.c"
 
 struct multi_attributes {
@@ -57,6 +57,22 @@ struct cover_notype_struct_declarator_bi
 };
 
 /*
+ * An array of bit-fields sounds like a strange idea since a bit-field member
+ * is not addressable, while an array needs to be addressable.  Due to this
+ * contradiction, this combination may have gone without mention in the C
+ * standards.
+ *
+ * GCC 10.3.0 complains that the bit-field has invalid type.
+ *
+ * Clang 12.0.1 complains that the bit-field has non-integral type 'unsigned
+ * int [8]'.
+ */
+struct array_of_bit_fields {
+	/* expect+1: warning: illegal bit-field type 'array[8] of unsigned int' [35] */
+	unsigned int bits[8]: 1;
+};
+
+/*
  * Before decl.c 1.188 from 2021-06-20, lint ran into a segmentation fault.
  */
 struct {

Index: src/tests/usr.bin/xlint/lint1/decl_struct_member.exp
diff -u src/tests/usr.bin/xlint/lint1/decl_struct_member.exp:1.8 src/tests/usr.bin/xlint/lint1/decl_struct_member.exp:1.9
--- src/tests/usr.bin/xlint/lint1/decl_struct_member.exp:1.8	Thu Jul 15 21:00:05 2021
+++ src/tests/usr.bin/xlint/lint1/decl_struct_member.exp	Wed Aug 25 22:04:52 2021
@@ -3,5 +3,6 @@ decl_struct_member.c(36): error: illegal
 decl_struct_member.c(38): error: syntax error '}' [249]
 decl_struct_member.c(38): warning: empty declaration [0]
 decl_struct_member.c(47): error: syntax error 'unnamed member' [249]

CVS commit: src

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:04:52 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/xlint/lint1: Makefile decl_struct_member.c
decl_struct_member.exp msg_132.c msg_132.exp
Added Files:
src/tests/usr.bin/xlint/lint1: msg_132_ilp32.c msg_132_ilp32.exp

Log Message:
tests/lint: test conversion from long long to intptr_t on ilp32

Seen in usr.bin/make/var.c:1608.


To generate a diff of this commit:
cvs rdiff -u -r1.1116 -r1.1117 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.106 -r1.107 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/decl_struct_member.c
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/decl_struct_member.exp
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_132.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_132.exp
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/msg_132_ilp32.c \
src/tests/usr.bin/xlint/lint1/msg_132_ilp32.exp

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



CVS commit: src/usr.bin/make

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:14:38 UTC 2021

Modified Files:
src/usr.bin/make: arch.c var.c

Log Message:
make: fix lint warnings on ilp32 platforms

The warnings in arch.c were about conversions from int to long.

The warnings in var.c were about conversions from long long to
ptrdiff_t.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.202 -r1.203 src/usr.bin/make/arch.c
cvs rdiff -u -r1.947 -r1.948 src/usr.bin/make/var.c

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



CVS commit: src/usr.bin/make

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:14:38 UTC 2021

Modified Files:
src/usr.bin/make: arch.c var.c

Log Message:
make: fix lint warnings on ilp32 platforms

The warnings in arch.c were about conversions from int to long.

The warnings in var.c were about conversions from long long to
ptrdiff_t.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.202 -r1.203 src/usr.bin/make/arch.c
cvs rdiff -u -r1.947 -r1.948 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/arch.c
diff -u src/usr.bin/make/arch.c:1.202 src/usr.bin/make/arch.c:1.203
--- src/usr.bin/make/arch.c:1.202	Sat Aug 14 14:43:30 2021
+++ src/usr.bin/make/arch.c	Wed Aug 25 22:14:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.202 2021/08/14 14:43:30 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.203 2021/08/25 22:14:38 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -126,7 +126,7 @@
 #include "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.202 2021/08/14 14:43:30 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.203 2021/08/25 22:14:38 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -552,14 +552,14 @@ ArchStatMember(const char *archive, cons
 		if (strncmp(memName, AR_EFMT1, sizeof AR_EFMT1 - 1) == 0 &&
 		ch_isdigit(memName[sizeof AR_EFMT1 - 1])) {
 
-			int elen = atoi(memName + sizeof AR_EFMT1 - 1);
+			size_t elen = atoi(memName + sizeof AR_EFMT1 - 1);
 
-			if ((unsigned int)elen > MAXPATHLEN)
+			if (elen > MAXPATHLEN)
 goto badarch;
-			if (fread(memName, (size_t)elen, 1, arch) != 1)
+			if (fread(memName, elen, 1, arch) != 1)
 goto badarch;
 			memName[elen] = '\0';
-			if (fseek(arch, -elen, SEEK_CUR) != 0)
+			if (fseek(arch, -(long)elen, SEEK_CUR) != 0)
 goto badarch;
 			if (DEBUG(ARCH) || DEBUG(MAKE))
 debug_printf(
@@ -791,14 +791,15 @@ ArchFindMember(const char *archive, cons
 		if (strncmp(out_arh->ar_name, AR_EFMT1, sizeof AR_EFMT1 - 1) ==
 		0 &&
 		(ch_isdigit(out_arh->ar_name[sizeof AR_EFMT1 - 1]))) {
-			int elen = atoi(_arh->ar_name[sizeof AR_EFMT1 - 1]);
+			size_t elen = atoi(
+			_arh->ar_name[sizeof AR_EFMT1 - 1]);
 			char ename[MAXPATHLEN + 1];
 
-			if ((unsigned int)elen > MAXPATHLEN) {
+			if (elen > MAXPATHLEN) {
 fclose(arch);
 return NULL;
 			}
-			if (fread(ename, (size_t)elen, 1, arch) != 1) {
+			if (fread(ename, elen, 1, arch) != 1) {
 fclose(arch);
 return NULL;
 			}
@@ -811,14 +812,14 @@ ArchFindMember(const char *archive, cons
 			if (strncmp(ename, member, len) == 0) {
 /* Found as extended name */
 if (fseek(arch,
-	  -(long)sizeof(struct ar_hdr) - elen,
-	  SEEK_CUR) != 0) {
+-(long)(sizeof(struct ar_hdr) - elen),
+SEEK_CUR) != 0) {
 	fclose(arch);
 	return NULL;
 }
 return arch;
 			}
-			if (fseek(arch, -elen, SEEK_CUR) != 0) {
+			if (fseek(arch, -(long)elen, SEEK_CUR) != 0) {
 fclose(arch);
 return NULL;
 			}
@@ -834,7 +835,7 @@ ArchFindMember(const char *archive, cons
 		 */
 		out_arh->ar_size[sizeof out_arh->ar_size - 1] = '\0';
 		size = (int)strtol(out_arh->ar_size, NULL, 10);
-		if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0) {
+		if (fseek(arch, (size + 1) & ~1L, SEEK_CUR) != 0) {
 			fclose(arch);
 			return NULL;
 		}

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.947 src/usr.bin/make/var.c:1.948
--- src/usr.bin/make/var.c:1.947	Sat Aug 14 13:11:33 2021
+++ src/usr.bin/make/var.c	Wed Aug 25 22:14:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.947 2021/08/14 13:11:33 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.948 2021/08/25 22:14:38 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.947 2021/08/14 13:11:33 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.948 2021/08/25 22:14:38 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -1605,7 +1605,8 @@ RegexReplace(const char *replace, SepBuf
 
 		if (*rp == '&') {
 			SepBuf_AddBytesBetween(buf,
-			wp + m[0].rm_so, wp + m[0].rm_eo);
+			wp + (size_t)m[0].rm_so,
+			wp + (size_t)m[0].rm_eo);
 			continue;
 		}
 
@@ -1626,7 +1627,8 @@ RegexReplace(const char *replace, SepBuf
 			}
 		} else {
 			SepBuf_AddBytesBetween(buf,
-			wp + m[n].rm_so, wp + m[n].rm_eo);
+			wp + (size_t)m[n].rm_so,
+			wp + (size_t)m[n].rm_eo);
 		}
 	}
 }
@@ -1673,7 +1675,7 @@ ok:
 
 	RegexReplace(args->replace, buf, wp, m, args->nsub);
 
-	wp += m[0].rm_eo;
+	wp += (size_t)m[0].rm_eo;
 	if (args->pflags.subGlobal) {
 		flags |= REG_NOTBOL;
 		if (m[0].rm_so == 0 && m[0].rm_eo == 0) {



CVS commit: src/usr.bin/config

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 23:07:34 UTC 2021

Modified Files:
src/usr.bin/config: sem.c

Log Message:
config: remove unused local variable


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/usr.bin/config/sem.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/config/sem.c
diff -u src/usr.bin/config/sem.c:1.85 src/usr.bin/config/sem.c:1.86
--- src/usr.bin/config/sem.c:1.85	Tue Apr 13 03:09:42 2021
+++ src/usr.bin/config/sem.c	Wed Aug 25 23:07:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.85 2021/04/13 03:09:42 mrg Exp $	*/
+/*	$NetBSD: sem.c,v 1.86 2021/08/25 23:07:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: sem.c,v 1.85 2021/04/13 03:09:42 mrg Exp $");
+__RCSID("$NetBSD: sem.c,v 1.86 2021/08/25 23:07:34 rillig Exp $");
 
 #include 
 #include 
@@ -950,7 +950,7 @@ resolve(struct nvlist **nvp, const char 
 	const char *cp;
 	devmajor_t maj;
 	devminor_t min;
-	size_t i, l;
+	size_t l;
 	int unit;
 	char buf[NAMESIZE];
 
@@ -1000,7 +1000,7 @@ resolve(struct nvlist **nvp, const char 
 	 * suffix, remove it if there, and split into name ("ra") and
 	 * unit (2).
 	 */
-	l = i = strlen(nv->nv_str);
+	l = strlen(nv->nv_str);
 	cp = >nv_str[l];
 	if (l > 1 && *--cp >= 'a' && *cp < 'a' + maxpartitions &&
 	isdigit((unsigned char)cp[-1])) {



CVS commit: src/usr.bin/config

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 23:07:34 UTC 2021

Modified Files:
src/usr.bin/config: sem.c

Log Message:
config: remove unused local variable


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/usr.bin/config/sem.c

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



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

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:48:40 UTC 2021

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

Log Message:
lint: add __attribute__ regparm

Seen in libexec/ld.elf_so/rtld.h.


To generate a diff of this commit:
cvs rdiff -u -r1.357 -r1.358 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/xlint/lint1/lex.c

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



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

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:48:40 UTC 2021

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

Log Message:
lint: add __attribute__ regparm

Seen in libexec/ld.elf_so/rtld.h.


To generate a diff of this commit:
cvs rdiff -u -r1.357 -r1.358 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/xlint/lint1/lex.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.357 src/usr.bin/xlint/lint1/cgram.y:1.358
--- src/usr.bin/xlint/lint1/cgram.y:1.357	Sat Aug 21 07:03:30 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Wed Aug 25 22:48:40 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.357 2021/08/21 07:03:30 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.358 2021/08/25 22:48:40 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.357 2021/08/21 07:03:30 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.358 2021/08/25 22:48:40 rillig Exp $");
 #endif
 
 #include 
@@ -248,6 +248,7 @@ anonymize(sym_t *s)
 %token			T_AT_PACKED
 %token			T_AT_PCS
 %token			T_AT_PURE
+%token			T_AT_REGPARM
 %token			T_AT_RETURNS_NONNULL
 %token			T_AT_RETURNS_TWICE
 %token			T_AT_SECTION
@@ -2077,6 +2078,7 @@ gcc_attribute_spec:
 	  }
 	| T_AT_PCS T_LPAREN string T_RPAREN
 	| T_AT_PURE
+	| T_AT_REGPARM T_LPAREN constant_expr T_RPAREN
 	| T_AT_RETURNS_NONNULL
 	| T_AT_RETURNS_TWICE
 	| T_AT_SECTION T_LPAREN string T_RPAREN

Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.69 src/usr.bin/xlint/lint1/lex.c:1.70
--- src/usr.bin/xlint/lint1/lex.c:1.69	Mon Aug 23 06:26:37 2021
+++ src/usr.bin/xlint/lint1/lex.c	Wed Aug 25 22:48:40 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.69 2021/08/23 06:26:37 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.70 2021/08/25 22:48:40 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: lex.c,v 1.69 2021/08/23 06:26:37 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.70 2021/08/25 22:48:40 rillig Exp $");
 #endif
 
 #include 
@@ -205,6 +205,7 @@ static	struct	kwtab {
 	kwdef_gcc_attr(	"pure",		T_AT_PURE),
 	kwdef_token(	"__real__",	T_REAL,			0,0,1,0,1),
 	kwdef_sclass(	"register",	REG,			0,0,0,0,1),
+	kwdef_gcc_attr(	"regparm",	T_AT_REGPARM),
 	kwdef_tqual(	"restrict",	RESTRICT,		0,1,0,0,5),
 	kwdef_keyword(	"return",	T_RETURN),
 	kwdef_gcc_attr(	"returns_nonnull",T_AT_RETURNS_NONNULL),



CVS commit: src/usr.bin/cksum

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:59:57 UTC 2021

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

Log Message:
cksum: fix lint warning about wrong call to isspace


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/cksum/cksum.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/cksum/cksum.c
diff -u src/usr.bin/cksum/cksum.c:1.49 src/usr.bin/cksum/cksum.c:1.50
--- src/usr.bin/cksum/cksum.c:1.49	Thu Mar 18 18:12:35 2021
+++ src/usr.bin/cksum/cksum.c	Wed Aug 25 22:59:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cksum.c,v 1.49 2021/03/18 18:12:35 cheusov Exp $	*/
+/*	$NetBSD: cksum.c,v 1.50 2021/08/25 22:59:57 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)cksum.c	8.2 (Berkeley) 4/28/95";
 #endif
-__RCSID("$NetBSD: cksum.c,v 1.49 2021/03/18 18:12:35 cheusov Exp $");
+__RCSID("$NetBSD: cksum.c,v 1.50 2021/08/25 22:59:57 rillig Exp $");
 #endif /* not lint */
 
 #include 
@@ -383,7 +383,7 @@ main(int argc, char **argv)
 		rval = 1;
 		continue;
 	}
-	while (isspace((int)*++p_filename))
+	while (isspace((unsigned char)*++p_filename))
 		nspaces++;
 	l_filename = strlen(p_filename);
 	l_cksum = p_filename - buf - nspaces;



CVS commit: src/usr.bin/cksum

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:59:57 UTC 2021

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

Log Message:
cksum: fix lint warning about wrong call to isspace


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/cksum/cksum.c

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



CVS commit: src/sys/arch/arm/dts/overlays

2021-08-25 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Aug 26 00:00:35 UTC 2021

Added Files:
src/sys/arch/arm/dts/overlays: sunxi-h3-h5-nanopi-neo-nas-dock.dts

Log Message:
Device tree overlay for the FriendlyARM NanoPi NAS Dock for the NanoPi NEO,
NEO Air, and NEO2.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/sys/arch/arm/dts/overlays/sunxi-h3-h5-nanopi-neo-nas-dock.dts

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



CVS commit: src/sys/arch/arm/dts/overlays

2021-08-25 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Aug 26 00:00:35 UTC 2021

Added Files:
src/sys/arch/arm/dts/overlays: sunxi-h3-h5-nanopi-neo-nas-dock.dts

Log Message:
Device tree overlay for the FriendlyARM NanoPi NAS Dock for the NanoPi NEO,
NEO Air, and NEO2.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/sys/arch/arm/dts/overlays/sunxi-h3-h5-nanopi-neo-nas-dock.dts

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

Added files:

Index: src/sys/arch/arm/dts/overlays/sunxi-h3-h5-nanopi-neo-nas-dock.dts
diff -u /dev/null src/sys/arch/arm/dts/overlays/sunxi-h3-h5-nanopi-neo-nas-dock.dts:1.1
--- /dev/null	Thu Aug 26 00:00:35 2021
+++ src/sys/arch/arm/dts/overlays/sunxi-h3-h5-nanopi-neo-nas-dock.dts	Thu Aug 26 00:00:35 2021
@@ -0,0 +1,98 @@
+/* $NetBSD: sunxi-h3-h5-nanopi-neo-nas-dock.dts,v 1.1 2021/08/26 00:00:35 thorpej Exp $ */
+
+/*-
+ * Copyright (c) 2021 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Overlay for the FriendlyARM NanoPi NAS Dock for the NanoPi NEO, NEO Air,
+ * and NEO2.
+ */
+
+/dts-v1/;
+/plugin/;
+
+/ {
+	compatible = "friendlyarm,nanopi-neo2", "friendlyarm,nanopi-neo-air",
+	"friendlyarm,nanopi-neo";
+
+	/* ohci1/ehci1 is brought out to a connector on the board. */
+	fragment@0 {
+		target = <>;
+		__overlay__ {
+			status = "okay";
+		};
+	};
+
+	fragment@1 {
+		target = <>;
+		__overlay__ {
+			status = "okay";
+		};
+	};
+
+	/* ohci2/ehci2 has the JM20329 USB2->SATA bridge. */
+	fragment@2 {
+		target = <>;
+		__overlay__ {
+			status = "okay";
+		};
+	};
+
+	fragment@3 {
+		target = <>;
+		__overlay__ {
+			status = "okay";
+		};
+	};
+
+	/* i2c0 has the DS1307 real time clock chip. */
+	fragment@4 {
+		target = <>;
+		__overlay__ {
+			status = "okay";
+
+			dock_rtc: rtc@68 {
+compatible = "dallas,ds1307";
+reg = <0x68>;
+			};
+		};
+	};
+
+	/*
+	 * Alias rtc0 to the DS1307 so the kernel will use it
+	 * instead of the built-in RTC on the SoC (which is not
+	 * battery-backed).
+	 */
+	fragment@5 {
+		target-path = "/aliases";
+		__overlay__ {
+			rtc0 = _rtc;
+		};
+	};
+};



CVS commit: src

2021-08-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 25 09:06:03 UTC 2021

Modified Files:
src/share/man/man4: ixg.4 ixv.4
src/sys/dev/pci: files.pci
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h ixgbe_netbsd.c
ixgbe_netbsd.h ixgbe_osdep.h ixv.c

Log Message:
 Use MCLGET() instead of homegrown cluster (jcl) allocation mechanism.

- Before this commit, resource shortage was easily occurred because the total
  number of the clusters is small.

- Reviewed by knakahara and ryo.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man4/ixg.4
cvs rdiff -u -r1.7 -r1.8 src/share/man/man4/ixv.4
cvs rdiff -u -r1.437 -r1.438 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.288 -r1.289 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.164 -r1.165 src/sys/dev/pci/ixgbe/ixv.c

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

Modified files:

Index: src/share/man/man4/ixg.4
diff -u src/share/man/man4/ixg.4:1.14 src/share/man/man4/ixg.4:1.15
--- src/share/man/man4/ixg.4:1.14	Tue Mar  9 12:02:24 2021
+++ src/share/man/man4/ixg.4	Wed Aug 25 09:06:02 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: ixg.4,v 1.14 2021/03/09 12:02:24 wiz Exp $
+.\" $NetBSD: ixg.4,v 1.15 2021/08/25 09:06:02 msaitoh Exp $
 .\"
 .\" Copyright (c) 2001-2008, Intel Corporation
 .\" All rights reserved.
@@ -33,7 +33,7 @@
 .\"
 .\" $FreeBSD: src/share/man/man4/ixgbe.4,v 1.3 2010/12/19 23:54:31 yongari Exp $
 .\"
-.Dd March 9, 2021
+.Dd August 25, 2021
 .Dt IXG 4
 .Os
 .Sh NAME
@@ -83,26 +83,6 @@ go to the Intel support website at:
 .\" with a supported adapter, email the specific information related to the
 .\" issue to
 .\" .Aq freebsd...@mailbox.intel.com .
-.Sh OPTIONS
-The
-.Nm
-driver doesn't use the common
-.Xr MCLGET 9
-interface and use the driver specific cluster allocation mechanism.
-If it's exhausted, the
-.Xr evcnt 9
-counter "ixgX qY Rx no jumbo mbuf" is incremented.
-If this is observed,
-the number can be changed by the following config parameter:
-.Bl -tag -width IXGBE_JCLNUM_MULTI -offset 3n
-.It Dv IXGBE_JCLNUM_MULTI
-The number of RX jumbo buffers (clusters) per queue is calculated by
-.Dv IXGBE_JCLNUM_MULTI
-* (number of rx descriptors).
-The total number of clusters per queue is available via the
-.Li hw.ixgN.num_jcl_per_queue
-.Xr sysctl 7 .
-.El
 .Sh SEE ALSO
 .Xr arp 4 ,
 .Xr ixv 4 ,

Index: src/share/man/man4/ixv.4
diff -u src/share/man/man4/ixv.4:1.7 src/share/man/man4/ixv.4:1.8
--- src/share/man/man4/ixv.4:1.7	Tue Mar  9 12:02:24 2021
+++ src/share/man/man4/ixv.4	Wed Aug 25 09:06:02 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ixv.4,v 1.7 2021/03/09 12:02:24 wiz Exp $
+.\"	$NetBSD: ixv.4,v 1.8 2021/08/25 09:06:02 msaitoh Exp $
 .\"
 .\" Copyright (c) 2018 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 9, 2021
+.Dd August 25, 2021
 .Dt IXV 4
 .Os
 .Sh NAME
@@ -43,26 +43,6 @@ newer chips support.
 It can be used on a
 .Nx
 guest that the host supports SR-IOV.
-.Sh OPTIONS
-The
-.Nm
-driver doesn't use the common
-.Xr MCLGET 9
-interface and use the driver specific cluster allocation mechanism.
-If it's exhausted, the
-.Xr evcnt 9
-counter "ixgX qY Rx no jumbo mbuf" is incremented.
-If this is observed,
-the number can be changed by the following config parameter:
-.Bl -tag -width IXGBE_JCLNUM_MULTI -offset 3n
-.It Dv IXGBE_JCLNUM_MULTI
-The number of RX jumbo buffers (clusters) per queue is calculated by
-.Dv IXGBE_JCLNUM_MULTI
-* (number of rx descriptors).
-The total number of clusters per queue is available with the
-.Li hw.ixgN.num_jcl_per_queue
-.Xr sysctl 7 .
-.El
 .Sh SEE ALSO
 .Xr arp 4 ,
 .Xr ixg 4 ,

Index: src/sys/dev/pci/files.pci
diff -u src/sys/dev/pci/files.pci:1.437 src/sys/dev/pci/files.pci:1.438
--- src/sys/dev/pci/files.pci:1.437	Mon Apr 26 19:28:24 2021
+++ src/sys/dev/pci/files.pci	Wed Aug 25 09:06:02 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.437 2021/04/26 19:28:24 thorpej Exp $
+#	$NetBSD: files.pci,v 1.438 2021/08/25 09:06:02 msaitoh Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -664,7 +664,6 @@ file	dev/pci/ixgbe/ixgbe_phy.c	ixg | ixv
 file	dev/pci/ixgbe/ixgbe_vf.c	ixg | ixv
 file	dev/pci/ixgbe/if_bypass.c	ixg | ixv
 file	dev/pci/ixgbe/if_fdir.c		ixg | ixv
-defparam opt_ixgbe.h	IXGBE_JCLNUM_MULTI
 
 # This appears to be the driver for virtual instances of i82599.
 device	ixv: ether, ifnet, arp, mii, mii_phy

Index: 

CVS commit: src

2021-08-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 25 09:06:03 UTC 2021

Modified Files:
src/share/man/man4: ixg.4 ixv.4
src/sys/dev/pci: files.pci
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h ixgbe_netbsd.c
ixgbe_netbsd.h ixgbe_osdep.h ixv.c

Log Message:
 Use MCLGET() instead of homegrown cluster (jcl) allocation mechanism.

- Before this commit, resource shortage was easily occurred because the total
  number of the clusters is small.

- Reviewed by knakahara and ryo.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man4/ixg.4
cvs rdiff -u -r1.7 -r1.8 src/share/man/man4/ixv.4
cvs rdiff -u -r1.437 -r1.438 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.288 -r1.289 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.164 -r1.165 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/arch

2021-08-25 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Aug 25 13:28:51 UTC 2021

Modified Files:
src/sys/arch/alpha/alpha: lock_stubs.s
src/sys/arch/sparc64/sparc64: lock_stubs.s

Log Message:
G/C _lock_cas(); it is no longer needed (kern_mutex.c uses atomic_cas_ulong()
with appropriate memory barriers).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/alpha/alpha/lock_stubs.s
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc64/sparc64/lock_stubs.s

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



Re: CVS commit: src/sys

2021-08-25 Thread Jason Thorpe



> On Aug 24, 2021, at 10:21 PM, matthew green  wrote:
> 
>> - For alpha and sparc64, don't define MUTEX_CAS() in terms of their own
>>  _lock_cas(), which has its own memory barriers; the call sites in
>>  kern_mutex.c already have the appropriate memory barrier calls.  Thus,
>>  alpha and sparc64 can use default definition.
> 
> this seems to leave _lock_cas() unused on both platforms, should
> the backing code for _lock_cas() be removed now?

Yes, I intended for that to be a separate commit.

-- thorpej