CVS commit: src/usr.bin/make

2022-01-28 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sat Jan 29 07:42:10 UTC 2022

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

Log Message:
Document quirks of target local variable assignments


To generate a diff of this commit:
cvs rdiff -u -r1.302 -r1.303 src/usr.bin/make/make.1

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

2022-01-28 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sat Jan 29 07:42:10 UTC 2022

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

Log Message:
Document quirks of target local variable assignments


To generate a diff of this commit:
cvs rdiff -u -r1.302 -r1.303 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.302 src/usr.bin/make/make.1:1.303
--- src/usr.bin/make/make.1:1.302	Thu Jan 27 06:02:59 2022
+++ src/usr.bin/make/make.1	Sat Jan 29 07:42:10 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.302 2022/01/27 06:02:59 sjg Exp $
+.\"	$NetBSD: make.1,v 1.303 2022/01/29 07:42:10 sjg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)make.1	8.4 (Berkeley) 3/19/94
 .\"
-.Dd January 21, 2022
+.Dd January 28, 2022
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -711,6 +711,16 @@ will be impacted by that filter (in "met
 simply enabling/disabling any of the wrappers will not render all
 of those targets out-of-date.
 .Pp
+.Em NOTE :
+target local variable assignments behave differently in that;
+.Bl -tag -width Ds -offset indent
+.It Ic \&+=
+Only behaves as expected, if there is a previous
+local assignment for the same target and variable.
+.It Ic \&:=
+Is redundant since, the entire dependency line has already been expanded.
+.El
+.Pp
 The seven built-in local variables are as follows:
 .Bl -tag -width ".ARCHIVE" -offset indent
 .It Va .ALLSRC



CVS commit: src/sys/dev/wscons

2022-01-28 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Jan 29 01:19:30 UTC 2022

Modified Files:
src/sys/dev/wscons: wsdisplayvar.h

Log Message:
Default WSDISPLAY_BORDER_COLOR to WS_DEFAULT_BG.
Avoids black overscan area when WS_DEFAULT_BG is set.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/wscons/wsdisplayvar.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/wscons

2022-01-28 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Jan 29 01:19:30 UTC 2022

Modified Files:
src/sys/dev/wscons: wsdisplayvar.h

Log Message:
Default WSDISPLAY_BORDER_COLOR to WS_DEFAULT_BG.
Avoids black overscan area when WS_DEFAULT_BG is set.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/wscons/wsdisplayvar.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/wscons/wsdisplayvar.h
diff -u src/sys/dev/wscons/wsdisplayvar.h:1.55 src/sys/dev/wscons/wsdisplayvar.h:1.56
--- src/sys/dev/wscons/wsdisplayvar.h:1.55	Wed Jan 30 11:24:48 2019
+++ src/sys/dev/wscons/wsdisplayvar.h	Sat Jan 29 01:19:30 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplayvar.h,v 1.55 2019/01/30 11:24:48 jmcneill Exp $ */
+/* $NetBSD: wsdisplayvar.h,v 1.56 2022/01/29 01:19:30 uwe Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -277,7 +277,7 @@ const struct wsscreen_descr *wsdisplay_s
 #define WS_KERNEL_MONOATTR WS_DEFAULT_MONOATTR
 #  endif
 #  if !defined(WSDISPLAY_BORDER_COLOR)
-#define WSDISPLAY_BORDER_COLOR WSCOL_BLACK
+#define WSDISPLAY_BORDER_COLOR WS_DEFAULT_BG
 #  endif
 #endif /* _KERNEL */
 



CVS commit: src/usr.bin/make

2022-01-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 29 01:12:37 UTC 2022

Modified Files:
src/usr.bin/make: cond.c

Log Message:
make: rename labels in CondParser_Leaf

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.326 -r1.327 src/usr.bin/make/cond.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

2022-01-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 29 01:12:37 UTC 2022

Modified Files:
src/usr.bin/make: cond.c

Log Message:
make: rename labels in CondParser_Leaf

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.326 -r1.327 src/usr.bin/make/cond.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/cond.c
diff -u src/usr.bin/make/cond.c:1.326 src/usr.bin/make/cond.c:1.327
--- src/usr.bin/make/cond.c:1.326	Sat Jan 15 19:34:07 2022
+++ src/usr.bin/make/cond.c	Sat Jan 29 01:12:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.326 2022/01/15 19:34:07 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.327 2022/01/29 01:12:36 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.326 2022/01/15 19:34:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.327 2022/01/29 01:12:36 rillig Exp $");
 
 /*
  * Conditional expressions conform to this grammar:
@@ -478,7 +478,7 @@ CondParser_Leaf(CondParser *par, bool do
 		case '"':
 			par->p++;
 			if (quoted)
-goto got_str;	/* skip the closing quote */
+goto return_buf;	/* skip the closing quote */
 			Buf_AddByte(, '"');
 			continue;
 		case ')':	/* see is_separator */
@@ -489,14 +489,14 @@ CondParser_Leaf(CondParser *par, bool do
 		case ' ':
 		case '\t':
 			if (!quoted)
-goto got_str;
+goto return_buf;
 			Buf_AddByte(, par->p[0]);
 			par->p++;
 			continue;
 		case '$':
 			if (!CondParser_StringExpr(par,
 			start, doEval, quoted, , ))
-goto cleanup;
+goto return_str;
 			continue;
 		default:
 			if (!unquotedOK && !quoted && *start != '$' &&
@@ -506,17 +506,17 @@ CondParser_Leaf(CondParser *par, bool do
  * a variable expression or a number.
  */
 str = FStr_InitRefer(NULL);
-goto cleanup;
+goto return_str;
 			}
 			Buf_AddByte(, par->p[0]);
 			par->p++;
 			continue;
 		}
 	}
-got_str:
+return_buf:
 	str = FStr_InitOwn(buf.data);
 	buf.data = NULL;
-cleanup:
+return_str:
 	Buf_Done();
 	*out_str = str;
 }



CVS commit: src/usr.bin/make

2022-01-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 29 01:07:32 UTC 2022

Modified Files:
src/usr.bin/make: make.h parse.c var.c

Log Message:
make: inline functions that have a single call site

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.291 -r1.292 src/usr.bin/make/make.h
cvs rdiff -u -r1.657 -r1.658 src/usr.bin/make/parse.c
cvs rdiff -u -r1.1006 -r1.1007 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/make.h
diff -u src/usr.bin/make/make.h:1.291 src/usr.bin/make/make.h:1.292
--- src/usr.bin/make/make.h:1.291	Thu Jan 27 06:02:59 2022
+++ src/usr.bin/make/make.h	Sat Jan 29 01:07:31 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.291 2022/01/27 06:02:59 sjg Exp $	*/
+/*	$NetBSD: make.h,v 1.292 2022/01/29 01:07:31 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -987,7 +987,6 @@ void Var_Undef(const char *);
 void Var_Set(GNode *, const char *, const char *);
 void Var_SetExpand(GNode *, const char *, const char *);
 void Var_SetWithFlags(GNode *, const char *, const char *, VarSetFlags);
-void Var_SetExpandWithFlags(GNode *, const char *, const char *, VarSetFlags);
 void Var_Append(GNode *, const char *, const char *);
 void Var_AppendExpand(GNode *, const char *, const char *);
 bool Var_Exists(GNode *, const char *) MAKE_ATTR_USE;

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.657 src/usr.bin/make/parse.c:1.658
--- src/usr.bin/make/parse.c:1.657	Thu Jan 27 10:34:55 2022
+++ src/usr.bin/make/parse.c	Sat Jan 29 01:07:31 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.657 2022/01/27 10:34:55 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.658 2022/01/29 01:07:31 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -106,7 +106,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.657 2022/01/27 10:34:55 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.658 2022/01/29 01:07:31 rillig Exp $");
 
 /*
  * A file being read.
@@ -188,7 +188,7 @@ typedef struct VarAssign {
 } VarAssign;
 
 static bool Parse_IsVar(const char *, VarAssign *);
-static void Parse_Var_Keep(VarAssign *, GNode *);
+static void Parse_Var(VarAssign *, GNode *);
 
 /*
  * The target to be made if no targets are specified in the command line.
@@ -1282,18 +1282,12 @@ ParseDependencySourcesSpecial(char *star
 }
 
 static void
-LinkSourceVar(GNode *pgn, VarAssign *var)
-{
-	Parse_Var_Keep(var, pgn);
-}
-
-static void
 LinkVarToTargets(VarAssign *var)
 {
 	GNodeListNode *ln;
 
 	for (ln = targets->first; ln != NULL; ln = ln->next)
-		LinkSourceVar(ln->datum, var);
+		Parse_Var(var, ln->datum);
 }
 
 static bool
@@ -1725,7 +1719,7 @@ VarAssignSpecial(const char *name, const
 
 /* Perform the variable assignment in the given scope. */
 static void
-Parse_Var_Keep(VarAssign *var, GNode *scope)
+Parse_Var(VarAssign *var, GNode *scope)
 {
 	FStr avalue;		/* actual value (maybe expanded) */
 
@@ -1736,13 +1730,6 @@ Parse_Var_Keep(VarAssign *var, GNode *sc
 	}
 }
 
-static void
-Parse_Var(VarAssign *var, GNode *scope)
-{
-	Parse_Var_Keep(var, scope);
-	free(var->varname);
-}
-
 
 /*
  * See if the command possibly calls a sub-make by using the variable
@@ -2718,6 +2705,7 @@ Parse_VarAssign(const char *line, bool f
 	if (finishDependencyGroup)
 		FinishDependencyGroup();
 	Parse_Var(, scope);
+	free(var.varname);
 	return true;
 }
 

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1006 src/usr.bin/make/var.c:1.1007
--- src/usr.bin/make/var.c:1.1006	Thu Jan 27 06:02:59 2022
+++ src/usr.bin/make/var.c	Sat Jan 29 01:07:31 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1006 2022/01/27 06:02:59 sjg Exp $	*/
+/*	$NetBSD: var.c,v 1.1007 2022/01/29 01:07:31 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -139,7 +139,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.1006 2022/01/27 06:02:59 sjg Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1007 2022/01/29 01:07:31 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -1018,29 +1018,6 @@ Var_SetWithFlags(GNode *scope, const cha
 		VarFreeShortLived(v);
 }
 
-/* See Var_Set for documentation. */
-void
-Var_SetExpandWithFlags(GNode *scope, const char *name, const char *val,
-		   VarSetFlags flags)
-{
-	const char *unexpanded_name = name;
-	FStr varname = FStr_InitRefer(name);
-
-	assert(val != NULL);
-
-	Var_Expand(, scope, VARE_WANTRES);
-
-	if (varname.str[0] == '\0') {
-		DEBUG2(VAR,
-		"Var_SetExpand: variable name \"%s\" expands "
-		"to empty string, with value \"%s\" - ignored\n",
-		unexpanded_name, val);
-	} else
-		Var_SetWithFlags(scope, varname.str, val, flags);
-
-	FStr_Done();
-}
-
 void
 Var_Set(GNode *scope, const char *name, const char *val)
 {
@@ -1061,7 +1038,22 @@ Var_Set(GNode 

CVS commit: src/usr.bin/make

2022-01-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 29 01:07:32 UTC 2022

Modified Files:
src/usr.bin/make: make.h parse.c var.c

Log Message:
make: inline functions that have a single call site

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.291 -r1.292 src/usr.bin/make/make.h
cvs rdiff -u -r1.657 -r1.658 src/usr.bin/make/parse.c
cvs rdiff -u -r1.1006 -r1.1007 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/unit-tests

2022-01-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 29 00:52:53 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: check-expect.lua var-scope-local.exp
var-scope-local.mk

Log Message:
tests/make: extend and isolate tests for target-local variables

Reusing the target var-scope-local.o for several tests made the test
more difficult to understand than necessary.  The test names '2' and '3'
didn't convey any meaning.

Instead, add more test targets that are named after what they test.  Add
tests for each of the 5 variable assignment operators, to demonstrate an
inconsistency between '+=' and '?='.

Add tests for the built-in target-local variables as well and explain
the general concepts, in particular the exact point where target-local
expressions are expanded.

The lines in the expected output file are not generated in the same
order as they appear in the makefile, so allow the 'expect' lines in
non-linear order, in check-expect.lua.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/check-expect.lua
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/var-scope-local.exp \
src/usr.bin/make/unit-tests/var-scope-local.mk

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/unit-tests/check-expect.lua
diff -u src/usr.bin/make/unit-tests/check-expect.lua:1.1 src/usr.bin/make/unit-tests/check-expect.lua:1.2
--- src/usr.bin/make/unit-tests/check-expect.lua:1.1	Sat Jan 15 12:35:18 2022
+++ src/usr.bin/make/unit-tests/check-expect.lua	Sat Jan 29 00:52:53 2022
@@ -1,5 +1,5 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.1 2022/01/15 12:35:18 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.2 2022/01/29 00:52:53 rillig Exp $
 
 --[[
 
@@ -82,6 +82,9 @@ local function check_mk(mk_fname)
   mk_fname, mk_lineno, exp_fname, prev_expect_line + 1, text)
   end
 end
+if mk_line:match("^#%s*expect%-reset$") then
+  prev_expect_line = 0
+end
 
 ---@param text string
 for offset, text in mk_line:gmatch("#%s*expect([+%-]%d+):%s*(.*)") do

Index: src/usr.bin/make/unit-tests/var-scope-local.exp
diff -u src/usr.bin/make/unit-tests/var-scope-local.exp:1.2 src/usr.bin/make/unit-tests/var-scope-local.exp:1.3
--- src/usr.bin/make/unit-tests/var-scope-local.exp:1.2	Thu Jan 27 06:56:27 2022
+++ src/usr.bin/make/unit-tests/var-scope-local.exp	Sat Jan 29 00:52:53 2022
@@ -1,10 +1,21 @@
+Global: .ALLTARGETS =  one
+Global: .ALLTARGETS =  one two
+Var_Parse: ${.MAKE.TARGET_LOCAL_VARIABLES} (eval)
+Var_SetExpand: variable name "" expands to empty string, with value "three" - ignored
+Var_SetExpand: variable name "" expands to empty string, with value "three" - ignored
+Global: one two = 
+Global: one two = three
+Global: .MAKEFLAGS =  -r -k -d v -d
+Global: .MAKEFLAGS =  -r -k -d v -d 0
 : Making var-scope-local.c out of nothing.
 : Making var-scope-local.o from var-scope-local.c.
-: Making basename "var-scope-local.o" in "." from "var-scope-local.c" in "." VAR="local".
-: Making var-scope-local2.c out of nothing.
-: Making var-scope-local2.o from var-scope-local2.c.
-: Making basename "var-scope-local2.o" in "." from "var-scope-local2.c" in "." VAR="local to var-scope-local2.o".
-: Making var-scope-local3.c out of nothing.
-: var-scope-local3.o uses .USE VAR="global+local"
-: all overwritten VAR="global"
+: Making basename "var-scope-local.o" in "." from "var-scope-local.c" in ".".
+: Making var-scope-local-assign.o with VAR="local".
+: Making var-scope-local-append.o with VAR="local to var-scope-local-append.o".
+: Making var-scope-local-append-global.o with VAR="global+local".
+: Making var-scope-local-default.o with VAR="global".
+: Making var-scope-local-subst.o with VAR="global+local".
+: Making var-scope-local-shell.o with VAR="output".
+: var-scope-local-use.o uses .USE VAR="global"
+: all overwritten
 exit status 0
Index: src/usr.bin/make/unit-tests/var-scope-local.mk
diff -u src/usr.bin/make/unit-tests/var-scope-local.mk:1.2 src/usr.bin/make/unit-tests/var-scope-local.mk:1.3
--- src/usr.bin/make/unit-tests/var-scope-local.mk:1.2	Thu Jan 27 06:56:27 2022
+++ src/usr.bin/make/unit-tests/var-scope-local.mk	Sat Jan 29 00:52:53 2022
@@ -1,16 +1,67 @@
-# $NetBSD: var-scope-local.mk,v 1.2 2022/01/27 06:56:27 sjg Exp $
+# $NetBSD: var-scope-local.mk,v 1.3 2022/01/29 00:52:53 rillig Exp $
 #
-# Tests for target-local variables, such as ${.TARGET} or $@.
-
-# TODO: Implementation
-
-# Ensure that the name of the variable is exactly the given one.
-# The variable "@" is an alias for ".TARGET", so the implementation might
+# Tests for target-local variables, such as ${.TARGET} or $@.  These variables
+# are relatively short-lived as they are created just before making the
+# target.  In contrast, global variables are typically created when the
+# makefiles are read in.
+#
+# The 7 built-in target-local variables are 

CVS commit: src/usr.bin/make/unit-tests

2022-01-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 29 00:52:53 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: check-expect.lua var-scope-local.exp
var-scope-local.mk

Log Message:
tests/make: extend and isolate tests for target-local variables

Reusing the target var-scope-local.o for several tests made the test
more difficult to understand than necessary.  The test names '2' and '3'
didn't convey any meaning.

Instead, add more test targets that are named after what they test.  Add
tests for each of the 5 variable assignment operators, to demonstrate an
inconsistency between '+=' and '?='.

Add tests for the built-in target-local variables as well and explain
the general concepts, in particular the exact point where target-local
expressions are expanded.

The lines in the expected output file are not generated in the same
order as they appear in the makefile, so allow the 'expect' lines in
non-linear order, in check-expect.lua.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/check-expect.lua
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/var-scope-local.exp \
src/usr.bin/make/unit-tests/var-scope-local.mk

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



CVS commit: src/lib/librefuse

2022-01-28 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Jan 29 00:03:42 UTC 2022

Modified Files:
src/lib/librefuse: refuse_log.c

Log Message:
librefuse: default_log_func is __printflike


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/librefuse/refuse_log.c

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

Modified files:

Index: src/lib/librefuse/refuse_log.c
diff -u src/lib/librefuse/refuse_log.c:1.1 src/lib/librefuse/refuse_log.c:1.2
--- src/lib/librefuse/refuse_log.c:1.1	Sat Jan 22 07:39:22 2022
+++ src/lib/librefuse/refuse_log.c	Sat Jan 29 00:03:41 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: refuse_log.c,v 1.1 2022/01/22 07:39:22 pho Exp $ */
+/* $NetBSD: refuse_log.c,v 1.2 2022/01/29 00:03:41 tnn Exp $ */
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: refuse_log.c,v 1.1 2022/01/22 07:39:22 pho Exp $");
+__RCSID("$NetBSD: refuse_log.c,v 1.2 2022/01/29 00:03:41 tnn Exp $");
 #endif /* !lint */
 
 #include 
@@ -41,7 +41,7 @@ __RCSID("$NetBSD: refuse_log.c,v 1.1 202
 #endif
 #include 
 
-static void
+static void  __printflike(2, 0)
 default_log_func(enum fuse_log_level level __attribute__((__unused__)),
  const char *fmt, va_list ap) {
 /* This function needs to be thread-safe. Calling vfprintf(3)



CVS commit: src/lib/librefuse

2022-01-28 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat Jan 29 00:03:42 UTC 2022

Modified Files:
src/lib/librefuse: refuse_log.c

Log Message:
librefuse: default_log_func is __printflike


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/librefuse/refuse_log.c

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



CVS commit: src/sys/fs/udf

2022-01-28 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Fri Jan 28 20:00:52 UTC 2022

Modified Files:
src/sys/fs/udf: udf_allocation.c

Log Message:
On freeing a virtual address in the VAT, use the correct value; this might
confuse other implementations who can reject the VAT on this.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/fs/udf/udf_allocation.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/fs/udf/udf_allocation.c
diff -u src/sys/fs/udf/udf_allocation.c:1.44 src/sys/fs/udf/udf_allocation.c:1.45
--- src/sys/fs/udf/udf_allocation.c:1.44	Fri Sep  3 21:55:00 2021
+++ src/sys/fs/udf/udf_allocation.c	Fri Jan 28 20:00:52 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_allocation.c,v 1.44 2021/09/03 21:55:00 andvar Exp $ */
+/* $NetBSD: udf_allocation.c,v 1.45 2022/01/28 20:00:52 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_allocation.c,v 1.44 2021/09/03 21:55:00 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_allocation.c,v 1.45 2022/01/28 20:00:52 reinoud Exp $");
 #endif /* not lint */
 
 
@@ -864,7 +864,7 @@ udf_search_free_vatloc(struct udf_mount 
 	}
 
 	/* mark entry with initialiser just in case */
-	lb_map = udf_rw32(0xfffe);
+	lb_map = udf_rw32(0x);
 	udf_vat_write(ump->vat_node, (uint8_t *) _map, 4,
 		ump->vat_offset + lb_num *4);
 	ump->vat_last_free_lb = lb_num;



CVS commit: src/sys/fs/udf

2022-01-28 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Fri Jan 28 20:00:52 UTC 2022

Modified Files:
src/sys/fs/udf: udf_allocation.c

Log Message:
On freeing a virtual address in the VAT, use the correct value; this might
confuse other implementations who can reject the VAT on this.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/fs/udf/udf_allocation.c

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



CVS commit: src/usr.sbin/sysinst

2022-01-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jan 28 19:38:51 UTC 2022

Modified Files:
src/usr.sbin/sysinst: main.c

Log Message:
sysinst: sync usage with man page


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/sysinst/main.c

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

Modified files:

Index: src/usr.sbin/sysinst/main.c
diff -u src/usr.sbin/sysinst/main.c:1.28 src/usr.sbin/sysinst/main.c:1.29
--- src/usr.sbin/sysinst/main.c:1.28	Fri Jan 28 19:27:43 2022
+++ src/usr.sbin/sysinst/main.c	Fri Jan 28 19:38:51 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.28 2022/01/28 19:27:43 martin Exp $	*/
+/*	$NetBSD: main.c,v 1.29 2022/01/28 19:38:51 wiz Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -492,18 +492,18 @@ static void
 usage(void)
 {
 
-	(void)fprintf(stderr, "usage: sysinst [-D] [-f definition_file] "
-	"[-r release] [-C bg:fg]"
+	(void)fprintf(stderr, "usage: sysinst [-C bg:fg] [-D"
 #ifndef NO_PARTMAN
-	" [-p]"
+	"p"
 #endif
+	"] [-f definition_file] "
+	"[-m message_catalog_dir]"
 	"\n"
 	"where:\n"
+	"\t-C bg:fg\n\t\tuse different color scheme\n"
 	"\t-D\n\t\trun in debug mode\n"
 	"\t-f definition_file\n\t\toverride built-in defaults from file\n"
 	"\t-m msg_catalog_dir\n\t\tuse translation files from msg_catalog_dir\n"
-	"\t-r release\n\t\toverride release name\n"
-	"\t-C bg:fg\n\t\tuse different color scheme\n"
 #ifndef NO_PARTMAN
 	"\t-p\n\t\tonly run the partition editor, no installation\n"
 #endif



CVS commit: src/usr.sbin/sysinst

2022-01-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jan 28 19:38:51 UTC 2022

Modified Files:
src/usr.sbin/sysinst: main.c

Log Message:
sysinst: sync usage with man page


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/sysinst/main.c

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



CVS commit: src/usr.sbin/sysinst

2022-01-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jan 28 19:36:00 UTC 2022

Modified Files:
src/usr.sbin/sysinst: sysinst.8

Log Message:
Sort options and their descriptions.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/sysinst.8

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

Modified files:

Index: src/usr.sbin/sysinst/sysinst.8
diff -u src/usr.sbin/sysinst/sysinst.8:1.4 src/usr.sbin/sysinst/sysinst.8:1.5
--- src/usr.sbin/sysinst/sysinst.8:1.4	Fri Jan 28 19:28:08 2022
+++ src/usr.sbin/sysinst/sysinst.8	Fri Jan 28 19:36:00 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysinst.8,v 1.4 2022/01/28 19:28:08 martin Exp $
+.\"	$NetBSD: sysinst.8,v 1.5 2022/01/28 19:36:00 wiz Exp $
 .\"
 .\" Copyright (c) 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -32,11 +32,10 @@
 .Nd install or upgrade a NetBSD system
 .Sh SYNOPSIS
 .Nm
-.Op Fl D
+.Op Fl Dp
+.Op Fl C Ar bg:fg
 .Op Fl f Ar definition_file
 .Op Fl m Ar message_catalog_dir
-.Op Fl C Ar bg:fg
-.Op Fl p
 .Sh DESCRIPTION
 .Nm
 is a menu-based program that may be used to install or upgrade a
@@ -47,7 +46,12 @@ is usually invoked automatically when th
 from appropriate installation media.
 .Pp
 The following options are available:
-.Bl -tag -width XfXdefinition_fileXX
+.Bl -tag -width 24n
+.It Fl C Ar bg:fg
+Use the ansi colors (see
+.In curses.h )
+bg as background (default: 4 for blue)
+and fg as foreground/text color (default: 7 for white).
 .It Fl D
 Switch on debugging.
 .It Fl f Ar definition_file
@@ -60,13 +64,11 @@ section for its format.
 .It Fl m Ar message_catalog_dir
 Search for available language files in
 .Ar message_catalog_dir .
-If this argument is missing and there are sysinstmsgs.* files in the
-current directory, those are used.
+If this argument is missing and there are
+.Pa sysinstmsgs.*
+files in the current directory, those are used.
 If no such files are found, a compiled in default catalog directory
 is used.
-.It Fl C Ar bg:fg
-Use the ansi colors (see curses.h) bg as background (default: 4 for blue)
-and fg as foreground/text color (default: 7 for white).
 .It Fl p
 Start the extended partition editor instead of the installer.
 This option is not available on some versions compiled for space limited



CVS commit: src/usr.sbin/sysinst

2022-01-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jan 28 19:36:00 UTC 2022

Modified Files:
src/usr.sbin/sysinst: sysinst.8

Log Message:
Sort options and their descriptions.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/sysinst.8

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



CVS commit: src/usr.sbin/sysinst

2022-01-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 28 19:28:09 UTC 2022

Modified Files:
src/usr.sbin/sysinst: sysinst.8

Log Message:
Document the missing command line options.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/sysinst.8

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

Modified files:

Index: src/usr.sbin/sysinst/sysinst.8
diff -u src/usr.sbin/sysinst/sysinst.8:1.3 src/usr.sbin/sysinst/sysinst.8:1.4
--- src/usr.sbin/sysinst/sysinst.8:1.3	Fri Mar  6 20:07:26 2020
+++ src/usr.sbin/sysinst/sysinst.8	Fri Jan 28 19:28:08 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysinst.8,v 1.3 2020/03/06 20:07:26 maya Exp $
+.\"	$NetBSD: sysinst.8,v 1.4 2022/01/28 19:28:08 martin Exp $
 .\"
 .\" Copyright (c) 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 6, 2020
+.Dd January 28, 2022
 .Dt SYSINST 8
 .Os
 .Sh NAME
@@ -34,6 +34,9 @@
 .Nm
 .Op Fl D
 .Op Fl f Ar definition_file
+.Op Fl m Ar message_catalog_dir
+.Op Fl C Ar bg:fg
+.Op Fl p
 .Sh DESCRIPTION
 .Nm
 is a menu-based program that may be used to install or upgrade a
@@ -54,6 +57,20 @@ as a file for definitions other than the
 See the
 .Sx DEFINITION FILE
 section for its format.
+.It Fl m Ar message_catalog_dir
+Search for available language files in
+.Ar message_catalog_dir .
+If this argument is missing and there are sysinstmsgs.* files in the
+current directory, those are used.
+If no such files are found, a compiled in default catalog directory
+is used.
+.It Fl C Ar bg:fg
+Use the ansi colors (see curses.h) bg as background (default: 4 for blue)
+and fg as foreground/text color (default: 7 for white).
+.It Fl p
+Start the extended partition editor instead of the installer.
+This option is not available on some versions compiled for space limited
+install media.
 .El
 .Sh DEFINITION FILE
 A definition file can be used with
@@ -106,6 +123,9 @@ files on CD-ROM installation media
 files in
 .Nx
 releases or snapshots.
+.Pp
+The default message catalog files are installed in
+.Pa /usr/share/sysinst/catalog .
 .Sh HISTORY
 A
 .Nm



CVS commit: src/usr.sbin/sysinst

2022-01-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 28 19:28:09 UTC 2022

Modified Files:
src/usr.sbin/sysinst: sysinst.8

Log Message:
Document the missing command line options.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/sysinst.8

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



CVS commit: src/usr.sbin/sysinst

2022-01-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 28 19:27:43 UTC 2022

Modified Files:
src/usr.sbin/sysinst: main.c

Log Message:
Add an option to set the directory where we look for message catalogs.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/sysinst/main.c

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

Modified files:

Index: src/usr.sbin/sysinst/main.c
diff -u src/usr.sbin/sysinst/main.c:1.27 src/usr.sbin/sysinst/main.c:1.28
--- src/usr.sbin/sysinst/main.c:1.27	Sun Jan 31 22:45:46 2021
+++ src/usr.sbin/sysinst/main.c	Fri Jan 28 19:27:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.27 2021/01/31 22:45:46 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.28 2022/01/28 19:27:43 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -91,7 +91,7 @@ char dist_postfix[SSTRSIZE];
 char dist_tgz_postfix[SSTRSIZE];
 WINDOW *mainwin;
 
-static void select_language(void);
+static void select_language(const char*);
 __dead static void usage(void);
 __dead static void miscsighandler(int);
 static void ttysighandler(int);
@@ -208,6 +208,7 @@ int
 main(int argc, char **argv)
 {
 	int ch;
+	const char *msg_cat_dir = NULL;
 
 	init();
 
@@ -223,7 +224,7 @@ main(int argc, char **argv)
 	}
 
 	/* argv processing */
-	while ((ch = getopt(argc, argv, "Dr:f:C:"
+	while ((ch = getopt(argc, argv, "Dr:f:C:m:"
 #ifndef NO_PARTMAN
 	"p"
 #endif
@@ -243,6 +244,10 @@ main(int argc, char **argv)
 			/* Define colors */
 			sscanf(optarg, "%u:%u", _arg.bg, _arg.fg);
 			break;
+		case 'm':
+			/* set message catalog directory */
+			msg_cat_dir = optarg;
+			break;
 #ifndef NO_PARTMAN
 		case 'p':
 			/* Partition tool */
@@ -296,7 +301,7 @@ main(int argc, char **argv)
 	/* Ensure we have mountpoint for target filesystems */
 	mkdir(targetroot_mnt, S_IRWXU | S_IRGRP|S_IXGRP | S_IROTH|S_IXOTH);
 
-	select_language();
+	select_language(msg_cat_dir);
 	get_kb_encoding();
 	init_lang();
 
@@ -326,103 +331,123 @@ set_language(menudesc *m, void *arg)
 	return 1;
 }
 
+/*
+ * Search for sysinstmsg.* files in the given dir, collect
+ * their names and return the number of files found.
+ * fnames[0] is preallocated and duplicates are ignored.
+ */
+struct found_msgs {
+	char **lang_msg, **fnames;
+	int max_lang, num_lang;
+
+};
 static void
-select_language(void)
+find_language_files(const char *path, struct found_msgs *res)
 {
 	DIR *dir;
 	struct dirent *dirent;
-	char **lang_msg, **fnames;
-	char prefix[PATH_MAX], fname[PATH_MAX];
-	int max_lang = 16, num_lang = 0;
+	char fname[PATH_MAX];
 	const char *cp;
-	menu_ent *opt = 0;
-	int lang_menu = -1;
-	int lang;
 
-#ifdef CATALOG_DIR
-	strcpy(prefix, CATALOG_DIR "/");
-	dir = opendir(CATALOG_DIR);
-	if (!dir) {
-		strcpy(prefix, "./");
-		dir = opendir(".");
-	}
-#else
-	dir = opendir(".");
-	strcpy(prefix, "./");
-#endif
+	res->num_lang = 0;
+	dir = opendir(path);
 	if (!dir)
 		return;
 
-	lang_msg = malloc(max_lang * sizeof *lang_msg);
-	fnames = malloc(max_lang * sizeof *fnames);
-	if (!lang_msg || !fnames)
-		goto done;
-
-	lang_msg[0] = strdup(msg_string(MSG_sysinst_message_language));
-	fnames[0] = 0;
-	num_lang = 1;
-
 	while ((dirent = readdir(dir)) != 0) {
 		if (memcmp(dirent->d_name, "sysinstmsgs.", 12))
 			continue;
-		strcpy(fname, prefix);
+
+		if (res->num_lang == 0)
+			res->num_lang = 1;
+		strcpy(fname, path);
+		strcat(fname, "/");
 		strcat(fname, dirent->d_name);
 		if (msg_file(fname))
 			continue;
 		cp = msg_string(MSG_sysinst_message_language);
-		if (!strcmp(cp, lang_msg[0]))
+		if (!strcmp(cp, res->lang_msg[0]))
 			continue;
-		if (num_lang == max_lang) {
+		if (res->num_lang == res->max_lang) {
 			char **new;
-			max_lang *= 2;
-			new = realloc(lang_msg, max_lang * sizeof *lang_msg);
+			res->max_lang *= 2;
+			new = realloc(res->lang_msg,
+			res->max_lang * sizeof *res->lang_msg);
 			if (!new)
 break;
-			lang_msg = new;
-			new = realloc(fnames, max_lang * sizeof *fnames);
+			res->lang_msg = new;
+			new = realloc(res->fnames,
+			res->max_lang * sizeof *res->fnames);
 			if (!new)
 break;
-			fnames = new;
+			res->fnames = new;
 		}
-		fnames[num_lang] = strdup(fname);
-		lang_msg[num_lang++] = strdup(cp);
+		res->fnames[res->num_lang] = strdup(fname);
+		res->lang_msg[res->num_lang++] = strdup(cp);
 	}
-	msg_file(0);
+
 	closedir(dir);
-	dir = 0;
+}
+
+static void
+select_language(const char *msg_cat_path)
+{
+	struct found_msgs found;
+	menu_ent *opt = 0;
+	const char *cp;
+	int lang_menu = -1;
+	int lang;
+
+	found.max_lang = 16;
+	found.num_lang = 0;
+	found.lang_msg = malloc(found.max_lang * sizeof *found.lang_msg);
+	found.fnames = malloc(found.max_lang * sizeof *found.fnames);
+	if (!found.lang_msg || !found.fnames)
+		goto done;
+	found.lang_msg[0] = strdup(msg_string(MSG_sysinst_message_language));
+	found.fnames[0] = NULL;
+
+	if (msg_cat_path != NULL)
+		

CVS commit: src/usr.sbin/sysinst

2022-01-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 28 19:27:43 UTC 2022

Modified Files:
src/usr.sbin/sysinst: main.c

Log Message:
Add an option to set the directory where we look for message catalogs.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/sysinst/main.c

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



CVS commit: src/sys/dev/scsipi

2022-01-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 28 18:23:28 UTC 2022

Modified Files:
src/sys/dev/scsipi: scsiconf.c

Log Message:
Factor out the lun detection code to simplify control flow.


To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 src/sys/dev/scsipi/scsiconf.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/scsipi/scsiconf.c
diff -u src/sys/dev/scsipi/scsiconf.c:1.295 src/sys/dev/scsipi/scsiconf.c:1.296
--- src/sys/dev/scsipi/scsiconf.c:1.295	Fri Jan 28 09:02:45 2022
+++ src/sys/dev/scsipi/scsiconf.c	Fri Jan 28 13:23:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsiconf.c,v 1.295 2022/01/28 14:02:45 jakllsch Exp $	*/
+/*	$NetBSD: scsiconf.c,v 1.296 2022/01/28 18:23:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.295 2022/01/28 14:02:45 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.296 2022/01/28 18:23:28 christos Exp $");
 
 #include 
 #include 
@@ -474,6 +474,30 @@ end2:
 	return error;
 }
 
+static void
+scsi_discover_luns(struct scsibus_softc *sc, int target, int minlun, int maxlun)
+{
+	uint16_t *luns;
+	size_t nluns;
+
+	if (scsi_report_luns(sc, target, , ) == 0) {
+		for (size_t i = 0; i < nluns; i++)
+			if (luns[i] >= minlun && luns[i] <= maxlun)
+scsi_probe_device(sc, target, luns[i]);
+		kmem_free(luns, sizeof(*luns) * nluns);
+		return;
+	}
+
+	for (int lun = minlun; lun <= maxlun; lun++) {
+		/*
+		 * See if there's a device present, and configure it.
+		 */
+		if (scsi_probe_device(sc, target, lun) == 0)
+			break;
+		/* otherwise something says we should look further */
+	}
+}
+
 /*
  * Probe the requested scsi bus. It must be already set up.
  * target and lun optionally narrow the search if not -1
@@ -482,8 +506,6 @@ int
 scsi_probe_bus(struct scsibus_softc *sc, int target, int lun)
 {
 	struct scsipi_channel *chan = sc->sc_channel;
-	uint16_t *luns;
-	size_t nluns = 0; /* XXXGCC */
 	int maxtarget, mintarget, maxlun, minlun;
 	int error;
 
@@ -516,25 +538,8 @@ scsi_probe_bus(struct scsibus_softc *sc,
 	for (target = mintarget; target <= maxtarget; target++) {
 		if (target == chan->chan_id)
 			continue;
-		if (scsi_report_luns(sc, target, , ) == 0) {
-			for (size_t i = 0; i < nluns; i++)
-if (luns[i] >= minlun && luns[i] <= maxlun)
-	scsi_probe_device(sc, target, luns[i]);
-		} else
-		for (lun = minlun; lun <= maxlun; lun++) {
-			/*
-			 * See if there's a device present, and configure it.
-			 */
-			if (scsi_probe_device(sc, target, lun) == 0)
-break;
-			/* otherwise something says we should look further */
-		}
 
-		if (luns != NULL) {
-			kmem_free(luns, sizeof(*luns) * nluns);
-			luns = NULL;
-			nluns = 0;
-		}
+		scsi_discover_luns(sc, target, minlun, maxlun);
 
 		/*
 		 * Now that we've discovered all of the LUNs on this



CVS commit: src/sys/dev/scsipi

2022-01-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 28 18:23:28 UTC 2022

Modified Files:
src/sys/dev/scsipi: scsiconf.c

Log Message:
Factor out the lun detection code to simplify control flow.


To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 src/sys/dev/scsipi/scsiconf.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/evbarm/conf

2022-01-28 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Jan 28 16:38:56 UTC 2022

Modified Files:
src/sys/arch/evbarm/conf: GENERIC GENERIC64

Log Message:
drop WSDISPLAY_CUSTOM_BORDER, it's currently only used by vga(4) which isn't 
used on evbarm


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/evbarm/conf/GENERIC
cvs rdiff -u -r1.192 -r1.193 src/sys/arch/evbarm/conf/GENERIC64

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



CVS commit: src/sys/arch/evbarm/conf

2022-01-28 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Jan 28 16:38:56 UTC 2022

Modified Files:
src/sys/arch/evbarm/conf: GENERIC GENERIC64

Log Message:
drop WSDISPLAY_CUSTOM_BORDER, it's currently only used by vga(4) which isn't 
used on evbarm


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/evbarm/conf/GENERIC
cvs rdiff -u -r1.192 -r1.193 src/sys/arch/evbarm/conf/GENERIC64

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/evbarm/conf/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.104 src/sys/arch/evbarm/conf/GENERIC:1.105
--- src/sys/arch/evbarm/conf/GENERIC:1.104	Thu Jan 27 14:39:49 2022
+++ src/sys/arch/evbarm/conf/GENERIC	Fri Jan 28 16:38:56 2022
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.104 2022/01/27 14:39:49 jakllsch Exp $
+#	$NetBSD: GENERIC,v 1.105 2022/01/28 16:38:56 jakllsch Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -526,7 +526,6 @@ options 	WS_DEFAULT_FG=WSCOL_WHITE
 options 	WS_DEFAULT_BG=WSCOL_BLACK
 options 	WS_KERNEL_FG=WSCOL_GREEN
 options 	WS_KERNEL_BG=WSCOL_BLACK
-options 	WSDISPLAY_CUSTOM_BORDER
 options 	WSDISPLAY_COMPAT_PCVT
 options 	WSDISPLAY_COMPAT_SYSCONS
 options 	WSDISPLAY_COMPAT_USL

Index: src/sys/arch/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.192 src/sys/arch/evbarm/conf/GENERIC64:1.193
--- src/sys/arch/evbarm/conf/GENERIC64:1.192	Thu Jan 27 14:39:49 2022
+++ src/sys/arch/evbarm/conf/GENERIC64	Fri Jan 28 16:38:56 2022
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.192 2022/01/27 14:39:49 jakllsch Exp $
+#	$NetBSD: GENERIC64,v 1.193 2022/01/28 16:38:56 jakllsch Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -468,7 +468,6 @@ options 	WS_DEFAULT_FG=WSCOL_WHITE
 options 	WS_DEFAULT_BG=WSCOL_BLACK
 options 	WS_KERNEL_FG=WSCOL_GREEN
 options 	WS_KERNEL_BG=WSCOL_BLACK
-options 	WSDISPLAY_CUSTOM_BORDER
 options 	WSDISPLAY_COMPAT_PCVT
 options 	WSDISPLAY_COMPAT_SYSCONS
 options 	WSDISPLAY_COMPAT_USL



CVS commit: src/sys/dev/scsipi

2022-01-28 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Jan 28 14:02:45 UTC 2022

Modified Files:
src/sys/dev/scsipi: scsiconf.c

Log Message:
shut up GCC about possibly-uninit; some KNF


To generate a diff of this commit:
cvs rdiff -u -r1.294 -r1.295 src/sys/dev/scsipi/scsiconf.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/scsipi/scsiconf.c
diff -u src/sys/dev/scsipi/scsiconf.c:1.294 src/sys/dev/scsipi/scsiconf.c:1.295
--- src/sys/dev/scsipi/scsiconf.c:1.294	Thu Jan 27 18:37:02 2022
+++ src/sys/dev/scsipi/scsiconf.c	Fri Jan 28 14:02:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsiconf.c,v 1.294 2022/01/27 18:37:02 jakllsch Exp $	*/
+/*	$NetBSD: scsiconf.c,v 1.295 2022/01/28 14:02:45 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.294 2022/01/27 18:37:02 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.295 2022/01/28 14:02:45 jakllsch Exp $");
 
 #include 
 #include 
@@ -482,6 +482,8 @@ int
 scsi_probe_bus(struct scsibus_softc *sc, int target, int lun)
 {
 	struct scsipi_channel *chan = sc->sc_channel;
+	uint16_t *luns;
+	size_t nluns = 0; /* XXXGCC */
 	int maxtarget, mintarget, maxlun, minlun;
 	int error;
 
@@ -509,9 +511,6 @@ scsi_probe_bus(struct scsibus_softc *sc,
 	 */
 	scsipi_adapter_ioctl(chan, SCBUSIOLLSCAN, NULL, 0, curproc);
 
-	uint16_t *luns;
-	size_t nluns;
-
 	if ((error = scsipi_adapter_addref(chan->chan_adapter)) != 0)
 		goto ret;
 	for (target = mintarget; target <= maxtarget; target++) {



CVS commit: src/sys/dev/scsipi

2022-01-28 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Jan 28 14:02:45 UTC 2022

Modified Files:
src/sys/dev/scsipi: scsiconf.c

Log Message:
shut up GCC about possibly-uninit; some KNF


To generate a diff of this commit:
cvs rdiff -u -r1.294 -r1.295 src/sys/dev/scsipi/scsiconf.c

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