CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 10 02:23:56 UTC 2023

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto: man.inc
src/crypto/external/bsd/openssl/lib/libcrypto/man: Makefile
Added Files:
src/crypto/external/bsd/openssl/lib/libcrypto/man:
openssl-format-options.1 openssl-namedisplay-options.1
openssl-passphrase-options.1 openssl-verification-options.1
Removed Files:
src/crypto/external/bsd/openssl/lib/libcrypto/man:
openssl_openssl-format-options.1
openssl_openssl-namedisplay-options.1
openssl_openssl-passphrase-options.1
openssl_openssl-verification-options.1

Log Message:
avoid dup openssl


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/crypto/external/bsd/openssl/lib/libcrypto/man.inc
cvs rdiff -u -r1.7 -r1.8 \
src/crypto/external/bsd/openssl/lib/libcrypto/man/Makefile
cvs rdiff -u -r0 -r1.1 \
src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl-format-options.1 \

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl-namedisplay-options.1 
\

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl-passphrase-options.1 \

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl-verification-options.1
cvs rdiff -u -r1.1 -r0 \

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl_openssl-format-options.1
 \

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl_openssl-namedisplay-options.1
 \

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl_openssl-passphrase-options.1
 \

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl_openssl-verification-options.1

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



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 10 02:23:56 UTC 2023

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto: man.inc
src/crypto/external/bsd/openssl/lib/libcrypto/man: Makefile
Added Files:
src/crypto/external/bsd/openssl/lib/libcrypto/man:
openssl-format-options.1 openssl-namedisplay-options.1
openssl-passphrase-options.1 openssl-verification-options.1
Removed Files:
src/crypto/external/bsd/openssl/lib/libcrypto/man:
openssl_openssl-format-options.1
openssl_openssl-namedisplay-options.1
openssl_openssl-passphrase-options.1
openssl_openssl-verification-options.1

Log Message:
avoid dup openssl


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/crypto/external/bsd/openssl/lib/libcrypto/man.inc
cvs rdiff -u -r1.7 -r1.8 \
src/crypto/external/bsd/openssl/lib/libcrypto/man/Makefile
cvs rdiff -u -r0 -r1.1 \
src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl-format-options.1 \

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl-namedisplay-options.1 
\

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl-passphrase-options.1 \

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl-verification-options.1
cvs rdiff -u -r1.1 -r0 \

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl_openssl-format-options.1
 \

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl_openssl-namedisplay-options.1
 \

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl_openssl-passphrase-options.1
 \

src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl_openssl-verification-options.1

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/man.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/man.inc:1.15 src/crypto/external/bsd/openssl/lib/libcrypto/man.inc:1.16
--- src/crypto/external/bsd/openssl/lib/libcrypto/man.inc:1.15	Sun May  7 16:06:17 2023
+++ src/crypto/external/bsd/openssl/lib/libcrypto/man.inc	Tue May  9 22:23:56 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: man.inc,v 1.15 2023/05/07 20:06:17 christos Exp $
+#	$NetBSD: man.inc,v 1.16 2023/05/10 02:23:56 christos Exp $
 
 .PATH:	${.CURDIR}/man
 
@@ -721,8 +721,12 @@ openssl-core.h.7 \
 openssl-core_dispatch.h.7 \
 openssl-core_names.h.7 \
 openssl-env.7 \
+openssl-format-options.1 \
 openssl-glossary.7 \
+openssl-namedisplay-options.1 \
+openssl-passphrase-options.1 \
 openssl-threads.7 \
+openssl-verification-options.1 \
 openssl.1 \
 openssl.cnf.5 \
 openssl_CA.pl.1 \
@@ -752,10 +756,6 @@ openssl_genrsa.1 \
 openssl_list.1 \
 openssl_nseq.1 \
 openssl_ocsp.1 \
-openssl_openssl-format-options.1 \
-openssl_openssl-namedisplay-options.1 \
-openssl_openssl-passphrase-options.1 \
-openssl_openssl-verification-options.1 \
 openssl_passwd.1 \
 openssl_pkcs12.1 \
 openssl_pkcs7.1 \

Index: src/crypto/external/bsd/openssl/lib/libcrypto/man/Makefile
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/man/Makefile:1.7 src/crypto/external/bsd/openssl/lib/libcrypto/man/Makefile:1.8
--- src/crypto/external/bsd/openssl/lib/libcrypto/man/Makefile:1.7	Sun May  7 16:06:19 2023
+++ src/crypto/external/bsd/openssl/lib/libcrypto/man/Makefile	Tue May  9 22:23:56 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2023/05/07 20:06:19 christos Exp $
+#	$NetBSD: Makefile,v 1.8 2023/05/10 02:23:56 christos Exp $
 
 # the makefile is not, and should not be visited during normal build process.
 # try to use latest pod2man, which comes with the latest perl.
@@ -20,7 +20,10 @@ make-manpages:
 		1) if [ "$$fn" = "openssl" ]; then \
 			dst=$$fn.$$sec; \
 		   else \
-			dst=openssl_$$fn.$$sec; \
+			case $$fn \
+			openssl*) dst=$$fn.$$sec;; \
+			*) dst=openssl_$$fn.$$sec;; \
+			eaac; \\
 		   fi;; \
 		*) dst=$$fn.$$sec;; \
 		esac; \

Added files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl-format-options.1
diff -u /dev/null src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl-format-options.1:1.1
--- /dev/null	Tue May  9 22:23:56 2023
+++ src/crypto/external/bsd/openssl/lib/libcrypto/man/openssl-format-options.1	Tue May  9 22:23:56 2023
@@ -0,0 +1,269 @@
+.\"	$NetBSD: openssl-format-options.1,v 1.1 2023/05/10 02:23:56 christos Exp $
+.\"
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43)
+.\"
+.\" Standard preamble:
+.\" 
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings.  \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
+.

CVS commit: src/sys/dev/acpi/acpica

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 01:23:28 UTC 2023

Modified Files:
src/sys/dev/acpi/acpica: acpi_func.h

Log Message:
acpi(4): Fix membars in ACPI_ACQUIRE/RELEASE_GLOBAL_LOCK.

XXX pullup-8 (by patch with membar_enter/exit)
XXX pullup-9 (by patch with membar_enter/exit)
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/acpi/acpica/acpi_func.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/acpi/acpica/acpi_func.h
diff -u src/sys/dev/acpi/acpica/acpi_func.h:1.6 src/sys/dev/acpi/acpica/acpi_func.h:1.7
--- src/sys/dev/acpi/acpica/acpi_func.h:1.6	Fri Oct 12 21:36:24 2018
+++ src/sys/dev/acpi/acpica/acpi_func.h	Wed May 10 01:23:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_func.h,v 1.6 2018/10/12 21:36:24 jmcneill Exp $	*/
+/*	$NetBSD: acpi_func.h,v 1.7 2023/05/10 01:23:27 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 Michael Smith
@@ -62,6 +62,7 @@ acpi_acquire_global_lock(uint32_t *lock)
 		((old >> 1) & GL_BIT_PENDING);
 		val = atomic_cas_32(lock, old, new);
 	} while (__predict_false(val != old));
+	membar_acquire();
 
 	return ((new < GL_BIT_MASK) ? GL_ACQUIRED : GL_BUSY);
 }
@@ -71,6 +72,7 @@ acpi_release_global_lock(uint32_t *lock)
 {
 	uint32_t new, old, val;
 
+	membar_release();
 	do {
 		old = *lock;
 		new = old & ~GL_BIT_MASK;



CVS commit: src/sys/dev/acpi/acpica

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 01:23:28 UTC 2023

Modified Files:
src/sys/dev/acpi/acpica: acpi_func.h

Log Message:
acpi(4): Fix membars in ACPI_ACQUIRE/RELEASE_GLOBAL_LOCK.

XXX pullup-8 (by patch with membar_enter/exit)
XXX pullup-9 (by patch with membar_enter/exit)
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/acpi/acpica/acpi_func.h

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



CVS commit: src/sys/arch/i386/stand/efiboot

2023-05-09 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Wed May 10 00:49:17 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot: version

Log Message:
Raise the version for new feature (here reloc command)
Suggested by Masanobu SAITOH


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/version

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/i386/stand/efiboot/version
diff -u src/sys/arch/i386/stand/efiboot/version:1.2 src/sys/arch/i386/stand/efiboot/version:1.3
--- src/sys/arch/i386/stand/efiboot/version:1.2	Sat Aug  3 08:13:36 2019
+++ src/sys/arch/i386/stand/efiboot/version	Wed May 10 00:49:17 2023
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.2 2019/08/03 08:13:36 nonaka Exp $
+$NetBSD: version,v 1.3 2023/05/10 00:49:17 manu Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE EFI BOOTLOADER HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -6,3 +6,4 @@ is taken as the current.
 
 1.0:	Initial version.
 1.1:	Add CD/DVD-ROM, serial, PXE boot and UEFI memory map compaction support.
+1.2:	Add reloc command



CVS commit: src/sys/arch/i386/stand/efiboot

2023-05-09 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Wed May 10 00:49:17 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot: version

Log Message:
Raise the version for new feature (here reloc command)
Suggested by Masanobu SAITOH


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/version

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



CVS commit: src/sys/dev/usb

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:12:44 UTC 2023

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

Log Message:
uts(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/usb/uts.c

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

Modified files:

Index: src/sys/dev/usb/uts.c
diff -u src/sys/dev/usb/uts.c:1.15 src/sys/dev/usb/uts.c:1.16
--- src/sys/dev/usb/uts.c:1.15	Mon Mar 28 12:44:17 2022
+++ src/sys/dev/usb/uts.c	Wed May 10 00:12:44 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: uts.c,v 1.15 2022/03/28 12:44:17 riastradh Exp $	*/
+/*	$NetBSD: uts.c,v 1.16 2023/05/10 00:12:44 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uts.c,v 1.15 2022/03/28 12:44:17 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uts.c,v 1.16 2023/05/10 00:12:44 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -270,16 +270,17 @@ Static int
 uts_detach(device_t self, int flags)
 {
 	struct uts_softc *sc = device_private(self);
-	int rv = 0;
+	int error;
 
+	__USE(sc);
 	DPRINTF(("uts_detach: sc=%p flags=%d\n", sc, flags));
 
-	if (sc->sc_wsmousedev != NULL)
-		rv = config_detach(sc->sc_wsmousedev, flags);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	pmf_device_deregister(self);
-
-	return rv;
+	return 0;
 }
 
 Static void



CVS commit: src/sys/dev/usb

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:12:44 UTC 2023

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

Log Message:
uts(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/usb/uts.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/usb

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:12:36 UTC 2023

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

Log Message:
udsbr(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/usb/udsbr.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/usb

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:12:36 UTC 2023

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

Log Message:
udsbr(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/usb/udsbr.c

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

Modified files:

Index: src/sys/dev/usb/udsbr.c
diff -u src/sys/dev/usb/udsbr.c:1.31 src/sys/dev/usb/udsbr.c:1.32
--- src/sys/dev/usb/udsbr.c:1.31	Sat Mar 14 02:35:33 2020
+++ src/sys/dev/usb/udsbr.c	Wed May 10 00:12:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: udsbr.c,v 1.31 2020/03/14 02:35:33 christos Exp $	*/
+/*	$NetBSD: udsbr.c,v 1.32 2023/05/10 00:12:36 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: udsbr.c,v 1.31 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udsbr.c,v 1.32 2023/05/10 00:12:36 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -170,15 +170,17 @@ static int
 udsbr_detach(device_t self, int flags)
 {
 	struct udsbr_softc *sc = device_private(self);
-	int rv = 0;
+	int error;
+
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
-	if (sc->sc_child != NULL)
-		rv = config_detach(sc->sc_child, flags);
 	if (sc->sc_udev != NULL)
 		usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
 		sc->sc_dev);
 
-	return rv;
+	return 0;
 }
 
 static int



CVS commit: src/sys/dev/usb

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:12:28 UTC 2023

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

Log Message:
irmce(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/irmce.c

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

Modified files:

Index: src/sys/dev/usb/irmce.c
diff -u src/sys/dev/usb/irmce.c:1.8 src/sys/dev/usb/irmce.c:1.9
--- src/sys/dev/usb/irmce.c:1.8	Sat Aug  7 16:19:16 2021
+++ src/sys/dev/usb/irmce.c	Wed May 10 00:12:28 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: irmce.c,v 1.8 2021/08/07 16:19:16 thorpej Exp $ */
+/* $NetBSD: irmce.c,v 1.9 2023/05/10 00:12:28 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill 
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: irmce.c,v 1.8 2021/08/07 16:19:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irmce.c,v 1.9 2023/05/10 00:12:28 riastradh Exp $");
 
 #include 
 #include 
@@ -255,11 +255,9 @@ irmce_detach(device_t self, int flags)
 	struct irmce_softc *sc = device_private(self);
 	int error;
 
-	if (sc->sc_cirdev) {
-		error = config_detach(sc->sc_cirdev, flags);
-		if (error)
-			return error;
-	}
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	if (sc->sc_bulkin_pipe) {
 		usbd_abort_pipe(sc->sc_bulkin_pipe);



CVS commit: src/sys/dev/usb

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:12:28 UTC 2023

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

Log Message:
irmce(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/irmce.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/pcmcia

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:12:20 UTC 2023

Modified Files:
src/sys/dev/pcmcia: xirc.c

Log Message:
xirc(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pcmcia/xirc.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/pcmcia/xirc.c
diff -u src/sys/dev/pcmcia/xirc.c:1.38 src/sys/dev/pcmcia/xirc.c:1.39
--- src/sys/dev/pcmcia/xirc.c:1.38	Sat Aug  7 16:19:15 2021
+++ src/sys/dev/pcmcia/xirc.c	Wed May 10 00:12:20 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xirc.c,v 1.38 2021/08/07 16:19:15 thorpej Exp $	*/
+/*	$NetBSD: xirc.c,v 1.39 2023/05/10 00:12:20 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xirc.c,v 1.38 2021/08/07 16:19:15 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xirc.c,v 1.39 2023/05/10 00:12:20 riastradh Exp $");
 
 #include "opt_inet.h"
 
@@ -396,17 +396,11 @@ int
 xirc_detach(device_t self, int flags)
 {
 	struct xirc_softc *sc = device_private(self);
-	int rv;
-
-	if (sc->sc_ethernet != NULL) {
-		if ((rv = config_detach(sc->sc_ethernet, flags)) != 0)
-			return rv;
-	}
+	int error;
 
-	if (sc->sc_modem != NULL) {
-		if ((rv = config_detach(sc->sc_modem, flags)) != 0)
-			return rv;
-	}
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	/* Unmap our i/o windows. */
 	if (sc->sc_flags & XIRC_ETHERNET_MAPPED)
@@ -420,8 +414,7 @@ xirc_detach(device_t self, int flags)
 	if (sc->sc_flags & XIRC_MODEM_ALLOCED)
 		pcmcia_io_free(sc->sc_pf, &sc->sc_modem_pcioh);
 	sc->sc_flags = 0;
-
-	return (0);
+	return 0;
 }
 
 int



CVS commit: src/sys/dev/pcmcia

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:12:20 UTC 2023

Modified Files:
src/sys/dev/pcmcia: xirc.c

Log Message:
xirc(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pcmcia/xirc.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/pcmcia

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:12:12 UTC 2023

Modified Files:
src/sys/dev/pcmcia: pcmcom.c

Log Message:
pcmcom(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pcmcia/pcmcom.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/pcmcia/pcmcom.c
diff -u src/sys/dev/pcmcia/pcmcom.c:1.44 src/sys/dev/pcmcia/pcmcom.c:1.45
--- src/sys/dev/pcmcia/pcmcom.c:1.44	Sun Sep 25 21:53:54 2022
+++ src/sys/dev/pcmcia/pcmcom.c	Wed May 10 00:12:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcmcom.c,v 1.44 2022/09/25 21:53:54 thorpej Exp $	*/
+/*	$NetBSD: pcmcom.c,v 1.45 2023/05/10 00:12:12 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2004 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcmcom.c,v 1.44 2022/09/25 21:53:54 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcmcom.c,v 1.45 2023/05/10 00:12:12 riastradh Exp $");
 
 #include 
 #include 
@@ -202,23 +202,16 @@ int
 pcmcom_detach(device_t self, int flags)
 {
 	struct pcmcom_softc *sc = device_private(self);
-	int slave, error;
-
-	if (sc->sc_state != PCMCOM_ATTACHED)
-		return (0);
+	int error;
 
-	for (slave = sc->sc_nslaves - 1; slave >= 0; slave--) {
-		if (sc->sc_slaves[slave]) {
-			/* Detach the child. */
-			error = config_detach(sc->sc_slaves[slave], flags);
-			if (error)
-return (error);
-		}
-	}
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
+	if (sc->sc_state != PCMCOM_ATTACHED)
+		return 0;
 	pcmcia_function_unconfigure(sc->sc_pf);
-
-	return (0);
+	return 0;
 }
 
 int



CVS commit: src/sys/dev/pcmcia

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:12:05 UTC 2023

Modified Files:
src/sys/dev/pcmcia: mhzc.c

Log Message:
mhzc(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/pcmcia/mhzc.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/pcmcia/mhzc.c
diff -u src/sys/dev/pcmcia/mhzc.c:1.55 src/sys/dev/pcmcia/mhzc.c:1.56
--- src/sys/dev/pcmcia/mhzc.c:1.55	Fri Jan 20 01:35:03 2023
+++ src/sys/dev/pcmcia/mhzc.c	Wed May 10 00:12:05 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: mhzc.c,v 1.55 2023/01/20 01:35:03 msaitoh Exp $	*/
+/*	$NetBSD: mhzc.c,v 1.56 2023/05/10 00:12:05 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mhzc.c,v 1.55 2023/01/20 01:35:03 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mhzc.c,v 1.56 2023/05/10 00:12:05 riastradh Exp $");
 
 #include "opt_inet.h"
 
@@ -334,17 +334,11 @@ int
 mhzc_detach(device_t self, int flags)
 {
 	struct mhzc_softc *sc = device_private(self);
-	int rv;
-
-	if (sc->sc_ethernet != NULL) {
-		if ((rv = config_detach(sc->sc_ethernet, flags)) != 0)
-			return rv;
-	}
+	int error;
 
-	if (sc->sc_modem != NULL) {
-		if ((rv = config_detach(sc->sc_modem, flags)) != 0)
-			return rv;
-	}
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	/* Unmap our i/o windows. */
 	if (sc->sc_flags & MHZC_MODEM_MAPPED)



CVS commit: src/sys/dev/pcmcia

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:12:12 UTC 2023

Modified Files:
src/sys/dev/pcmcia: pcmcom.c

Log Message:
pcmcom(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pcmcia/pcmcom.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/pcmcia

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:12:05 UTC 2023

Modified Files:
src/sys/dev/pcmcia: mhzc.c

Log Message:
mhzc(4): Use config_detach_children.


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

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:57 UTC 2023

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

Log Message:
ismt(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ismt.c

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

Modified files:

Index: src/sys/dev/pci/ismt.c
diff -u src/sys/dev/pci/ismt.c:1.9 src/sys/dev/pci/ismt.c:1.10
--- src/sys/dev/pci/ismt.c:1.9	Sat Aug  7 16:19:14 2021
+++ src/sys/dev/pci/ismt.c	Wed May 10 00:11:57 2023
@@ -60,7 +60,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ismt/ismt.c 266474 2014-05-20 19:55:06Z jimharris $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: ismt.c,v 1.9 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ismt.c,v 1.10 2023/05/10 00:11:57 riastradh Exp $");
 
 #include 
 #include 
@@ -623,16 +623,14 @@ ismt_bread(struct ismt_softc *sc, i2c_ad
 static int
 ismt_detach(device_t self, int flags)
 {
-	struct ismt_softc	*sc;
-	int rv = 0;
+	struct ismt_softc *sc = device_private(self);
+	int error;
 
 	ISMT_DEBUG(self, "%s\n", __func__);
-	sc = device_private(self);
-	if (sc->smbdev != NULL) {
-		rv = config_detach(sc->smbdev, flags);
-		if (rv != 0)
-			return rv;
-	}
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
+
 	if (sc->sc_ih != NULL) {
 		pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
 		sc->sc_ih = NULL;
@@ -653,7 +651,7 @@ ismt_detach(device_t self, int flags)
 		bus_space_unmap(sc->mmio_tag, sc->mmio_handle, sc->mmio_size);
 
 	iic_tag_fini(&sc->sc_i2c_tag);
-	return rv;
+	return 0;
 }
 
 static void



CVS commit: src/sys/dev/pci

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:57 UTC 2023

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

Log Message:
ismt(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ismt.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/pci

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:49 UTC 2023

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

Log Message:
esa(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/pci/esa.c

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

Modified files:

Index: src/sys/dev/pci/esa.c
diff -u src/sys/dev/pci/esa.c:1.65 src/sys/dev/pci/esa.c:1.66
--- src/sys/dev/pci/esa.c:1.65	Sat Jun  8 08:02:38 2019
+++ src/sys/dev/pci/esa.c	Wed May 10 00:11:49 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: esa.c,v 1.65 2019/06/08 08:02:38 isaki Exp $ */
+/* $NetBSD: esa.c,v 1.66 2023/05/10 00:11:49 riastradh Exp $ */
 
 /*
  * Copyright (c) 2001-2008 Jared D. McNeill 
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.65 2019/06/08 08:02:38 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.66 2023/05/10 00:11:49 riastradh Exp $");
 
 #include 
 #include 
@@ -1100,14 +1100,12 @@ esa_childdet(device_t self, device_t chi
 static int
 esa_detach(device_t self, int flags)
 {
-	struct esa_softc *sc;
-	int i;
+	struct esa_softc *sc = device_private(self);
+	int error;
 
-	sc = device_private(self);
-	for (i = 0; i < ESA_NUM_VOICES; i++) {
-		if (sc->sc_audiodev[i] != NULL)
-			config_detach(sc->sc_audiodev[i], flags);
-	}
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	if (sc->sc_ih != NULL)
 		pci_intr_disestablish(sc->sc_pct, sc->sc_ih);



CVS commit: src/sys/dev/pci

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:49 UTC 2023

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

Log Message:
esa(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/pci/esa.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/pci

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:41 UTC 2023

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

Log Message:
emuxki(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/pci/emuxki.c

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

Modified files:

Index: src/sys/dev/pci/emuxki.c
diff -u src/sys/dev/pci/emuxki.c:1.76 src/sys/dev/pci/emuxki.c:1.77
--- src/sys/dev/pci/emuxki.c:1.76	Wed Sep  7 03:34:43 2022
+++ src/sys/dev/pci/emuxki.c	Wed May 10 00:11:41 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: emuxki.c,v 1.76 2022/09/07 03:34:43 khorben Exp $	*/
+/*	$NetBSD: emuxki.c,v 1.77 2023/05/10 00:11:41 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.76 2022/09/07 03:34:43 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.77 2023/05/10 00:11:41 riastradh Exp $");
 
 #include 
 #include 
@@ -483,11 +483,12 @@ unmap:
 static int
 emuxki_detach(device_t self, int flags)
 {
-	struct emuxki_softc *sc;
+	struct emuxki_softc *sc = device_private(self);
+	int error;
 
-	sc = device_private(self);
-	if (sc->sc_audev != NULL) /* Test in case audio didn't attach */
-		config_detach(sc->sc_audev, 0);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	/* All voices should be stopped now but add some code here if not */
 	emuxki_writeio_4(sc, EMU_HCFG,



CVS commit: src/sys/dev/pci

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:41 UTC 2023

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

Log Message:
emuxki(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/pci/emuxki.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/pci

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:32 UTC 2023

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

Log Message:
cxdtv(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/cxdtv.c

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

Modified files:

Index: src/sys/dev/pci/cxdtv.c
diff -u src/sys/dev/pci/cxdtv.c:1.20 src/sys/dev/pci/cxdtv.c:1.21
--- src/sys/dev/pci/cxdtv.c:1.20	Sat Aug  7 16:19:14 2021
+++ src/sys/dev/pci/cxdtv.c	Wed May 10 00:11:32 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: cxdtv.c,v 1.20 2021/08/07 16:19:14 thorpej Exp $ */
+/* $NetBSD: cxdtv.c,v 1.21 2023/05/10 00:11:32 riastradh Exp $ */
 
 /*
  * Copyright (c) 2008, 2011 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cxdtv.c,v 1.20 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cxdtv.c,v 1.21 2023/05/10 00:11:32 riastradh Exp $");
 
 #include 
 #include 
@@ -89,7 +89,7 @@ static int	cxdtv_risc_buffer(struct cxdt
 static int	cxdtv_risc_field(struct cxdtv_softc *, uint32_t *, uint32_t);
 
 static int cxdtv_mpeg_attach(struct cxdtv_softc *);
-static int cxdtv_mpeg_detach(struct cxdtv_softc *, int flags);
+static voidcxdtv_mpeg_detach(struct cxdtv_softc *, int flags);
 static int cxdtv_mpeg_intr(struct cxdtv_softc *);
 static int cxdtv_mpeg_reset(struct cxdtv_softc *);
 
@@ -268,10 +268,12 @@ cxdtv_detach(device_t self, int flags)
 	struct cxdtv_softc *sc = device_private(self);
 	int error;
 
-	error = cxdtv_mpeg_detach(sc, flags);
+	error = config_detach_children(self, flags);
 	if (error)
 		return error;
 
+	cxdtv_mpeg_detach(sc, flags);
+
 	if (sc->sc_ih)
 		pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
 
@@ -464,16 +466,9 @@ cxdtv_mpeg_attach(struct cxdtv_softc *sc
 	return (sc->sc_dtvdev != NULL);
 }
 
-int
+void
 cxdtv_mpeg_detach(struct cxdtv_softc *sc, int flags)
 {
-	int error = 0;
-
-	if (sc->sc_dtvdev) {
-		error = config_detach(sc->sc_dtvdev, flags);
-		if (error)
-			return error;
-	}
 
 	if (sc->sc_demod) {
 		switch (sc->sc_board->cb_demod) {
@@ -504,8 +499,6 @@ cxdtv_mpeg_detach(struct cxdtv_softc *sc
 		sc->sc_riscbuf = NULL;
 		sc->sc_riscbufsz = 0;
 	}
-
-	return error;
 }
 
 static void



CVS commit: src/sys/dev/pci

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:32 UTC 2023

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

Log Message:
cxdtv(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/cxdtv.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/pci

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:24 UTC 2023

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

Log Message:
auich(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/pci/auich.c

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

Modified files:

Index: src/sys/dev/pci/auich.c
diff -u src/sys/dev/pci/auich.c:1.160 src/sys/dev/pci/auich.c:1.161
--- src/sys/dev/pci/auich.c:1.160	Sat Feb  6 09:45:17 2021
+++ src/sys/dev/pci/auich.c	Wed May 10 00:11:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: auich.c,v 1.160 2021/02/06 09:45:17 isaki Exp $	*/
+/*	$NetBSD: auich.c,v 1.161 2023/05/10 00:11:24 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2005, 2008 The NetBSD Foundation, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.160 2021/02/06 09:45:17 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.161 2023/05/10 00:11:24 riastradh Exp $");
 
 #include 
 #include 
@@ -702,10 +702,12 @@ static int
 auich_detach(device_t self, int flags)
 {
 	struct auich_softc *sc = device_private(self);
+	int error;
 
 	/* audio */
-	if (sc->sc_audiodev != NULL)
-		config_detach(sc->sc_audiodev, flags);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	/* sysctl */
 	sysctl_teardown(&sc->sc_log);



CVS commit: src/sys/dev/pci

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:24 UTC 2023

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

Log Message:
auich(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/pci/auich.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/nand

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:16 UTC 2023

Modified Files:
src/sys/dev/nand: nandemulator.c

Log Message:
nandemulator(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/nand/nandemulator.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/nand/nandemulator.c
diff -u src/sys/dev/nand/nandemulator.c:1.9 src/sys/dev/nand/nandemulator.c:1.10
--- src/sys/dev/nand/nandemulator.c:1.9	Tue Oct  1 18:00:08 2019
+++ src/sys/dev/nand/nandemulator.c	Wed May 10 00:11:16 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: nandemulator.c,v 1.9 2019/10/01 18:00:08 chs Exp $	*/
+/*	$NetBSD: nandemulator.c,v 1.10 2023/05/10 00:11:16 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2011 Department of Software Engineering,
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nandemulator.c,v 1.9 2019/10/01 18:00:08 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nandemulator.c,v 1.10 2023/05/10 00:11:16 riastradh Exp $");
 
 /* XXX this code likely needs work */
 
@@ -281,20 +281,19 @@ static int
 nandemulator_detach(device_t self, int flags)
 {
 	struct nandemulator_softc *sc = device_private(self);
-	int ret = 0;
+	int error;
 
 	aprint_normal_dev(sc->sc_dev, "detaching emulator\n");
 
-	pmf_device_deregister(sc->sc_dev);
-
-	if (sc->sc_nanddev != NULL)
-		ret = config_detach(sc->sc_nanddev, flags);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
+	pmf_device_deregister(sc->sc_dev);
 	kmem_free(sc->sc_backend, sc->sc_backend_size);
 	kmem_free(sc->sc_parameter_page,
 	sizeof(struct onfi_parameter_page) * 4);
-
-	return ret;
+	return 0;
 }
 
 /**



CVS commit: src/sys/dev/nand

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:16 UTC 2023

Modified Files:
src/sys/dev/nand: nandemulator.c

Log Message:
nandemulator(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/nand/nandemulator.c

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



CVS commit: src/sys/dev/ic

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:08 UTC 2023

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

Log Message:
wb(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/w83l518d_sdmmc.c

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

Modified files:

Index: src/sys/dev/ic/w83l518d_sdmmc.c
diff -u src/sys/dev/ic/w83l518d_sdmmc.c:1.6 src/sys/dev/ic/w83l518d_sdmmc.c:1.7
--- src/sys/dev/ic/w83l518d_sdmmc.c:1.6	Sat Aug  7 16:19:12 2021
+++ src/sys/dev/ic/w83l518d_sdmmc.c	Wed May 10 00:11:08 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: w83l518d_sdmmc.c,v 1.6 2021/08/07 16:19:12 thorpej Exp $ */
+/* $NetBSD: w83l518d_sdmmc.c,v 1.7 2023/05/10 00:11:08 riastradh Exp $ */
 
 /*
  * Copyright (c) 2009 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: w83l518d_sdmmc.c,v 1.6 2021/08/07 16:19:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: w83l518d_sdmmc.c,v 1.7 2023/05/10 00:11:08 riastradh Exp $");
 
 #include 
 #include 
@@ -191,13 +191,11 @@ wb_sdmmc_attach(struct wb_softc *wb)
 int
 wb_sdmmc_detach(struct wb_softc *wb, int flags)
 {
-	int rv;
+	int error;
 
-	if (wb->wb_sdmmc_dev) {
-		rv = config_detach(wb->wb_sdmmc_dev, flags);
-		if (rv)
-			return rv;
-	}
+	error = config_detach_children(wb->wb_dev, flags);
+	if (error)
+		return error;
 	wb_sdmmc_disable(wb);
 
 	callout_halt(&wb->wb_sdmmc_callout, NULL);



CVS commit: src/sys/dev/ic

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:11:08 UTC 2023

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

Log Message:
wb(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/w83l518d_sdmmc.c

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



CVS commit: src/sys/dev/ic

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:10:54 UTC 2023

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

Log Message:
spc(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/ic/mb89352.c

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



CVS commit: src/sys/dev/ic

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:10:54 UTC 2023

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

Log Message:
spc(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/ic/mb89352.c

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

Modified files:

Index: src/sys/dev/ic/mb89352.c
diff -u src/sys/dev/ic/mb89352.c:1.62 src/sys/dev/ic/mb89352.c:1.63
--- src/sys/dev/ic/mb89352.c:1.62	Tue Mar 28 20:01:58 2023
+++ src/sys/dev/ic/mb89352.c	Wed May 10 00:10:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: mb89352.c,v 1.62 2023/03/28 20:01:58 andvar Exp $	*/
+/*	$NetBSD: mb89352.c,v 1.63 2023/05/10 00:10:54 riastradh Exp $	*/
 /*	NecBSD: mb89352.c,v 1.4 1998/03/14 07:31:20 kmatsuda Exp	*/
 
 /*-
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mb89352.c,v 1.62 2023/03/28 20:01:58 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mb89352.c,v 1.63 2023/05/10 00:10:54 riastradh Exp $");
 
 #ifdef DDB
 #define	integrate
@@ -321,13 +321,13 @@ spc_childdet(device_t self, device_t chi
 int
 spc_detach(device_t self, int flags)
 {
-	struct spc_softc *sc = device_private(self);
-	int rv = 0;
+	int error;
 
-	if (sc->sc_child != NULL)
-		rv = config_detach(sc->sc_child, flags);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
-	return (rv);
+	return 0;
 }
 
 /*



CVS commit: src/sys/dev/ic

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:10:35 UTC 2023

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

Log Message:
aic(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/ic/aic6360.c

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

Modified files:

Index: src/sys/dev/ic/aic6360.c
diff -u src/sys/dev/ic/aic6360.c:1.106 src/sys/dev/ic/aic6360.c:1.107
--- src/sys/dev/ic/aic6360.c:1.106	Wed Apr  5 21:46:09 2023
+++ src/sys/dev/ic/aic6360.c	Wed May 10 00:10:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic6360.c,v 1.106 2023/04/05 21:46:09 andvar Exp $	*/
+/*	$NetBSD: aic6360.c,v 1.107 2023/05/10 00:10:35 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995, 1996 Charles M. Hannum.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: aic6360.c,v 1.106 2023/04/05 21:46:09 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic6360.c,v 1.107 2023/05/10 00:10:35 riastradh Exp $");
 
 #include "opt_ddb.h"
 
@@ -301,13 +301,13 @@ aicattach(struct aic_softc *sc)
 int
 aic_detach(device_t self, int flags)
 {
-	struct aic_softc *sc = device_private(self);
-	int rv = 0;
+	int error;
 
-	if (sc->sc_child != NULL)
-		rv = config_detach(sc->sc_child, flags);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
-	return (rv);
+	return 0;
 }
 
 /* Initialize AIC6360 chip itself



CVS commit: src/sys/dev/ic

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:10:35 UTC 2023

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

Log Message:
aic(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/ic/aic6360.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/i2c

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:10:02 UTC 2023

Modified Files:
src/sys/dev/i2c: ims.c

Log Message:
ims(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/ims.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/i2c/ims.c
diff -u src/sys/dev/i2c/ims.c:1.4 src/sys/dev/i2c/ims.c:1.5
--- src/sys/dev/i2c/ims.c:1.4	Fri Jan 14 22:28:42 2022
+++ src/sys/dev/i2c/ims.c	Wed May 10 00:10:02 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ims.c,v 1.4 2022/01/14 22:28:42 riastradh Exp $ */
+/* $NetBSD: ims.c,v 1.5 2023/05/10 00:10:02 riastradh Exp $ */
 /* $OpenBSD ims.c,v 1.1 2016/01/12 01:11:15 jcs Exp $ */
 
 /*
@@ -20,7 +20,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ims.c,v 1.4 2022/01/14 22:28:42 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ims.c,v 1.5 2023/05/10 00:10:02 riastradh Exp $");
 
 #include 
 #include 
@@ -146,16 +146,15 @@ ims_attach(device_t parent, device_t sel
 static int
 ims_detach(device_t self, int flags)
 {
-	struct ims_softc *sc = device_private(self);
-	int rv = 0;
+	int error;
 
 	/* No need to do reference counting of ums, wsmouse has all the goo. */
-	if (sc->sc_ms.hidms_wsmousedev != NULL)
-		rv = config_detach(sc->sc_ms.hidms_wsmousedev, flags);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	pmf_device_deregister(self);
-
-	return rv;
+	return 0;
 }
 
 void



CVS commit: src/sys/dev/i2c

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:10:02 UTC 2023

Modified Files:
src/sys/dev/i2c: ims.c

Log Message:
ims(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/ims.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/hpc

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:09:54 UTC 2023

Modified Files:
src/sys/dev/hpc: hpf1275a_tty.c

Log Message:
hpf1275a(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/hpc/hpf1275a_tty.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/hpc/hpf1275a_tty.c
diff -u src/sys/dev/hpc/hpf1275a_tty.c:1.32 src/sys/dev/hpc/hpf1275a_tty.c:1.33
--- src/sys/dev/hpc/hpf1275a_tty.c:1.32	Wed Oct 26 23:45:10 2022
+++ src/sys/dev/hpc/hpf1275a_tty.c	Wed May 10 00:09:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpf1275a_tty.c,v 1.32 2022/10/26 23:45:10 riastradh Exp $ */
+/*	$NetBSD: hpf1275a_tty.c,v 1.33 2023/05/10 00:09:54 riastradh Exp $ */
 
 /*
  * Copyright (c) 2004 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hpf1275a_tty.c,v 1.32 2022/10/26 23:45:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpf1275a_tty.c,v 1.33 2023/05/10 00:09:54 riastradh Exp $");
 
 #include "opt_wsdisplay_compat.h"
 
@@ -284,12 +284,11 @@ hpf1275a_detach(device_t self, int flags
 	struct hpf1275a_softc *sc = device_private(self);
 	int error;
 
-	if (sc->sc_wskbd == NULL)
-		return (0);
-
-	error = config_detach(sc->sc_wskbd, 0);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
-	return (error);
+	return 0;
 }
 
 



CVS commit: src/sys/dev/hpc

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:09:54 UTC 2023

Modified Files:
src/sys/dev/hpc: hpf1275a_tty.c

Log Message:
hpf1275a(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/hpc/hpf1275a_tty.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/hil

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:09:47 UTC 2023

Modified Files:
src/sys/dev/hil: hilms.c

Log Message:
hilms(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/hil/hilms.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/hil/hilms.c
diff -u src/sys/dev/hil/hilms.c:1.5 src/sys/dev/hil/hilms.c:1.6
--- src/sys/dev/hil/hilms.c:1.5	Sun Sep 19 04:55:58 2021
+++ src/sys/dev/hil/hilms.c	Wed May 10 00:09:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hilms.c,v 1.5 2021/09/19 04:55:58 tsutsui Exp $	*/
+/*	$NetBSD: hilms.c,v 1.6 2023/05/10 00:09:47 riastradh Exp $	*/
 /*	$OpenBSD: hilms.c,v 1.5 2007/04/10 22:37:17 miod Exp $	*/
 /*
  * Copyright (c) 2003, Miodrag Vallat.
@@ -168,9 +168,11 @@ int
 hilmsdetach(device_t self, int flags)
 {
 	struct hilms_softc *sc = device_private(self);
+	int error;
 
-	if (sc->sc_wsmousedev != NULL)
-		return config_detach(sc->sc_wsmousedev, flags);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	return 0;
 }



CVS commit: src/sys/dev/hil

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:09:47 UTC 2023

Modified Files:
src/sys/dev/hil: hilms.c

Log Message:
hilms(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/hil/hilms.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/gpio

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:09:39 UTC 2023

Modified Files:
src/sys/dev/gpio: gpiosim.c

Log Message:
gpiosim(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/gpio/gpiosim.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/gpio

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:09:39 UTC 2023

Modified Files:
src/sys/dev/gpio: gpiosim.c

Log Message:
gpiosim(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/gpio/gpiosim.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/gpio/gpiosim.c
diff -u src/sys/dev/gpio/gpiosim.c:1.23 src/sys/dev/gpio/gpiosim.c:1.24
--- src/sys/dev/gpio/gpiosim.c:1.23	Sat Aug  7 16:19:10 2021
+++ src/sys/dev/gpio/gpiosim.c	Wed May 10 00:09:39 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: gpiosim.c,v 1.23 2021/08/07 16:19:10 thorpej Exp $ */
+/* $NetBSD: gpiosim.c,v 1.24 2023/05/10 00:09:39 riastradh Exp $ */
 /*  $OpenBSD: gpiosim.c,v 1.1 2008/11/23 18:46:49 mbalmer Exp $	*/
 
 /*
@@ -149,10 +149,12 @@ static int
 gpiosim_detach(device_t self, int flags)
 {
 	struct gpiosim_softc *sc = device_private(self);
+	int error;
 
 	/* Detach the gpio driver that attached here */
-	if (sc->sc_gdev != NULL)
-		config_detach(sc->sc_gdev, 0);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	pmf_device_deregister(self);
 	if (sc->sc_log != NULL) {



CVS commit: src/sys/dev/gpio

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:09:31 UTC 2023

Modified Files:
src/sys/dev/gpio: gpioow.c

Log Message:
gpioow(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/gpio/gpioow.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/gpio/gpioow.c
diff -u src/sys/dev/gpio/gpioow.c:1.19 src/sys/dev/gpio/gpioow.c:1.20
--- src/sys/dev/gpio/gpioow.c:1.19	Sat Aug  7 16:19:10 2021
+++ src/sys/dev/gpio/gpioow.c	Wed May 10 00:09:31 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: gpioow.c,v 1.19 2021/08/07 16:19:10 thorpej Exp $ */
+/* $NetBSD: gpioow.c,v 1.20 2023/05/10 00:09:31 riastradh Exp $ */
 /*	$OpenBSD: gpioow.c,v 1.1 2006/03/04 16:27:03 grange Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gpioow.c,v 1.19 2021/08/07 16:19:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpioow.c,v 1.20 2023/05/10 00:09:31 riastradh Exp $");
 
 /*
  * 1-Wire bus bit-banging through GPIO pin.
@@ -162,16 +162,15 @@ static int
 gpioow_detach(device_t self, int flags)
 {
 	struct gpioow_softc *sc = device_private(self);
-	int rv = 0;
-
-	if (sc->sc_ow_dev != NULL)
-		rv = config_detach(sc->sc_ow_dev, flags);
+	int error;
 
-	if (!rv) {
-		gpio_pin_unmap(sc->sc_gpio, &sc->sc_map);
-		pmf_device_deregister(self);
-	}
-	return rv;
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
+
+	gpio_pin_unmap(sc->sc_gpio, &sc->sc_map);
+	pmf_device_deregister(self);
+	return 0;
 }
 
 static int



CVS commit: src/sys/dev/gpio

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:09:31 UTC 2023

Modified Files:
src/sys/dev/gpio: gpioow.c

Log Message:
gpioow(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/gpio/gpioow.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/sandpoint/sandpoint

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:08:14 UTC 2023

Modified Files:
src/sys/arch/sandpoint/sandpoint: flash_cfi.c

Log Message:
sandpoint: Use config_detach_children to reduce error branch bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sandpoint/sandpoint/flash_cfi.c

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

Modified files:

Index: src/sys/arch/sandpoint/sandpoint/flash_cfi.c
diff -u src/sys/arch/sandpoint/sandpoint/flash_cfi.c:1.4 src/sys/arch/sandpoint/sandpoint/flash_cfi.c:1.5
--- src/sys/arch/sandpoint/sandpoint/flash_cfi.c:1.4	Mon Sep  7 23:00:08 2015
+++ src/sys/arch/sandpoint/sandpoint/flash_cfi.c	Wed May 10 00:08:14 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: flash_cfi.c,v 1.4 2015/09/07 23:00:08 phx Exp $ */
+/* $NetBSD: flash_cfi.c,v 1.5 2023/05/10 00:08:14 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2011 Frank Wille.
@@ -32,7 +32,7 @@
  * NOR CFI driver support for sandpoint
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: flash_cfi.c,v 1.4 2015/09/07 23:00:08 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: flash_cfi.c,v 1.5 2023/05/10 00:08:14 riastradh Exp $");
 
 #include 
 #include 
@@ -158,16 +158,15 @@ sandpointcfi_attach(device_t parent, dev
 static int
 sandpointcfi_detach(device_t self, int flags)
 {
-	struct sandpointcfi_softc *sc;
-	int rv;
+	struct sandpointcfi_softc *sc device_private(self);
+	int error;
 
-	pmf_device_deregister(self);
-	sc = device_private(self);
-	rv = 0;
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
-	if (sc->sc_nordev != NULL)
-		rv = config_detach(sc->sc_nordev, flags);
+	pmf_device_deregister(self);
 
 	bus_space_unmap(sc->sc_cfi.cfi_bst, sc->sc_cfi.cfi_bsh, sc->sc_size);
-	return rv;
+	return 0;
 }



CVS commit: src/sys/dev/gpio

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:08:31 UTC 2023

Modified Files:
src/sys/dev/gpio: gpioiic.c

Log Message:
gpioiic(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/gpio/gpioiic.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/acpi/wmi

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:08:23 UTC 2023

Modified Files:
src/sys/dev/acpi/wmi: wmi_acpi.c

Log Message:
acpiwmi(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/acpi/wmi/wmi_acpi.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/gpio

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:08:31 UTC 2023

Modified Files:
src/sys/dev/gpio: gpioiic.c

Log Message:
gpioiic(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/gpio/gpioiic.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/gpio/gpioiic.c
diff -u src/sys/dev/gpio/gpioiic.c:1.11 src/sys/dev/gpio/gpioiic.c:1.12
--- src/sys/dev/gpio/gpioiic.c:1.11	Sat Aug  7 16:19:10 2021
+++ src/sys/dev/gpio/gpioiic.c	Wed May 10 00:08:30 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: gpioiic.c,v 1.11 2021/08/07 16:19:10 thorpej Exp $ */
+/* $NetBSD: gpioiic.c,v 1.12 2023/05/10 00:08:30 riastradh Exp $ */
 /*	$OpenBSD: gpioiic.c,v 1.8 2008/11/24 12:12:12 mbalmer Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gpioiic.c,v 1.11 2021/08/07 16:19:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpioiic.c,v 1.12 2023/05/10 00:08:30 riastradh Exp $");
 
 /*
  * I2C bus bit-banging through GPIO pins.
@@ -207,17 +207,16 @@ int
 gpioiic_detach(device_t self, int flags)
 {
 	struct gpioiic_softc *sc = device_private(self);
-	int rv = 0;
+	int error;
 
-	if (sc->sc_i2c_dev != NULL)
-		rv = config_detach(sc->sc_i2c_dev, flags);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
-	if (!rv) {
-		iic_tag_fini(&sc->sc_i2c_tag);
-		gpio_pin_unmap(sc->sc_gpio, &sc->sc_map);
-		pmf_device_deregister(self);
-	}
-	return rv;
+	iic_tag_fini(&sc->sc_i2c_tag);
+	gpio_pin_unmap(sc->sc_gpio, &sc->sc_map);
+	pmf_device_deregister(self);
+	return 0;
 }
 
 int



CVS commit: src/sys/dev/acpi/wmi

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:08:23 UTC 2023

Modified Files:
src/sys/dev/acpi/wmi: wmi_acpi.c

Log Message:
acpiwmi(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/acpi/wmi/wmi_acpi.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/acpi/wmi/wmi_acpi.c
diff -u src/sys/dev/acpi/wmi/wmi_acpi.c:1.20 src/sys/dev/acpi/wmi/wmi_acpi.c:1.21
--- src/sys/dev/acpi/wmi/wmi_acpi.c:1.20	Sun Dec 12 22:20:52 2021
+++ src/sys/dev/acpi/wmi/wmi_acpi.c	Wed May 10 00:08:22 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: wmi_acpi.c,v 1.20 2021/12/12 22:20:52 andvar Exp $	*/
+/*	$NetBSD: wmi_acpi.c,v 1.21 2023/05/10 00:08:22 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Jukka Ruohonen 
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.20 2021/12/12 22:20:52 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.21 2023/05/10 00:08:22 riastradh Exp $");
 
 #include 
 #include 
@@ -126,18 +126,19 @@ static int
 acpi_wmi_detach(device_t self, int flags)
 {
 	struct acpi_wmi_softc *sc = device_private(self);
+	int error;
+
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	acpi_wmi_event_del(sc);
 
 	if (sc->sc_ecdev != NULL) {
-
 		(void)AcpiRemoveAddressSpaceHandler(sc->sc_node->ad_handle,
 		ACPI_ADR_SPACE_EC, acpi_wmi_ec_handler);
 	}
 
-	if (sc->sc_child != NULL)
-		(void)config_detach(sc->sc_child, flags);
-
 	acpi_wmi_del(sc);
 	pmf_device_deregister(self);
 



CVS commit: src/sys/arch/sandpoint/sandpoint

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:08:14 UTC 2023

Modified Files:
src/sys/arch/sandpoint/sandpoint: flash_cfi.c

Log Message:
sandpoint: Use config_detach_children to reduce error branch bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sandpoint/sandpoint/flash_cfi.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/powerpc/booke/dev

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:08:07 UTC 2023

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3cfi.c pq3nandfcm.c

Log Message:
powerpc: Use config_detach_children to reduce error branch bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/dev/pq3cfi.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/booke/dev/pq3nandfcm.c

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

Modified files:

Index: src/sys/arch/powerpc/booke/dev/pq3cfi.c
diff -u src/sys/arch/powerpc/booke/dev/pq3cfi.c:1.7 src/sys/arch/powerpc/booke/dev/pq3cfi.c:1.8
--- src/sys/arch/powerpc/booke/dev/pq3cfi.c:1.7	Mon Jul  6 10:22:44 2020
+++ src/sys/arch/powerpc/booke/dev/pq3cfi.c	Wed May 10 00:08:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3cfi.c,v 1.7 2020/07/06 10:22:44 rin Exp $	*/
+/*	$NetBSD: pq3cfi.c,v 1.8 2023/05/10 00:08:07 riastradh Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3cfi.c,v 1.7 2020/07/06 10:22:44 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3cfi.c,v 1.8 2023/05/10 00:08:07 riastradh Exp $");
 
 #include "locators.h"
 
@@ -164,14 +164,15 @@ static int
 pq3cfi_detach(device_t self, int flags)
 {
 	struct pq3cfi_softc *sc = device_private(self);
-	int rv = 0;
+	int error;
 
-	pmf_device_deregister(self);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
-	if (sc->sc_nordev != NULL)
-		rv = config_detach(sc->sc_nordev, flags);
+	pmf_device_deregister(self);
 
 	bus_space_unmap(sc->sc_cfi.cfi_bst, sc->sc_cfi.cfi_bsh, sc->sc_size);
 
-	return rv;
+	return 0;
 }

Index: src/sys/arch/powerpc/booke/dev/pq3nandfcm.c
diff -u src/sys/arch/powerpc/booke/dev/pq3nandfcm.c:1.4 src/sys/arch/powerpc/booke/dev/pq3nandfcm.c:1.5
--- src/sys/arch/powerpc/booke/dev/pq3nandfcm.c:1.4	Mon Jul  6 10:22:44 2020
+++ src/sys/arch/powerpc/booke/dev/pq3nandfcm.c	Wed May 10 00:08:07 2023
@@ -30,7 +30,7 @@
 #define LBC_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3nandfcm.c,v 1.4 2020/07/06 10:22:44 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3nandfcm.c,v 1.5 2023/05/10 00:08:07 riastradh Exp $");
 
 #include 
 #include 
@@ -111,16 +111,17 @@ int
 pq3nandfcm_detach(device_t self, int flags)
 {
 	struct pq3nandfcm_softc * const sc = device_private(self);
-	int rv = 0;
+	int error;
 
-	pmf_device_deregister(self);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
-	if (sc->sc_nanddev != NULL)
-		rv = config_detach(sc->sc_nanddev, flags);
+	pmf_device_deregister(self);
 
 	bus_space_unmap(sc->sc_window_bst, sc->sc_window_bsh,
 	sc->sc_window_size);
-	return rv;
+	return 0;
 }
 void
 pq3nandfcm_command(device_t self, uint8_t command)



CVS commit: src/sys/arch/powerpc/booke/dev

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:08:07 UTC 2023

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3cfi.c pq3nandfcm.c

Log Message:
powerpc: Use config_detach_children to reduce error branch bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/dev/pq3cfi.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/booke/dev/pq3nandfcm.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/mips

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:07:58 UTC 2023

Modified Files:
src/sys/arch/mips/ralink: ralink_cfi.c
src/sys/arch/mips/rmi: rmixl_nand.c

Log Message:
mips: Use config_detach_children to reduce error branch bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mips/ralink/ralink_cfi.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/rmi/rmixl_nand.c

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

Modified files:

Index: src/sys/arch/mips/ralink/ralink_cfi.c
diff -u src/sys/arch/mips/ralink/ralink_cfi.c:1.1 src/sys/arch/mips/ralink/ralink_cfi.c:1.2
--- src/sys/arch/mips/ralink/ralink_cfi.c:1.1	Tue Aug  2 03:38:48 2011
+++ src/sys/arch/mips/ralink/ralink_cfi.c	Wed May 10 00:07:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ralink_cfi.c,v 1.1 2011/08/02 03:38:48 cliff Exp $	*/
+/*	$NetBSD: ralink_cfi.c,v 1.2 2023/05/10 00:07:58 riastradh Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,7 +36,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ralink_cfi.c,v 1.1 2011/08/02 03:38:48 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_cfi.c,v 1.2 2023/05/10 00:07:58 riastradh Exp $");
 
 #include 
 #include 
@@ -178,14 +178,15 @@ static int
 ra_cfi_detach(device_t self, int flags)
 {
 	struct ra_cfi_softc *sc = device_private(self);
-	int rv = 0;
+	int error;
 
-	pmf_device_deregister(self);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
-	if (sc->sc_nordev != NULL)
-		rv = config_detach(sc->sc_nordev, flags);
+	pmf_device_deregister(self);
 
 	bus_space_unmap(sc->sc_cfi.cfi_bst, sc->sc_cfi.cfi_bsh, sc->sc_size);
 
-	return rv;
+	return 0;
 }

Index: src/sys/arch/mips/rmi/rmixl_nand.c
diff -u src/sys/arch/mips/rmi/rmixl_nand.c:1.7 src/sys/arch/mips/rmi/rmixl_nand.c:1.8
--- src/sys/arch/mips/rmi/rmixl_nand.c:1.7	Fri Jul  1 19:01:31 2011
+++ src/sys/arch/mips/rmi/rmixl_nand.c	Wed May 10 00:07:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_nand.c,v 1.7 2011/07/01 19:01:31 dyoung Exp $	*/
+/*	$NetBSD: rmixl_nand.c,v 1.8 2023/05/10 00:07:58 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rmixl_nand.c,v 1.7 2011/07/01 19:01:31 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_nand.c,v 1.8 2023/05/10 00:07:58 riastradh Exp $");
 
 #include "opt_flash.h"
 
@@ -235,16 +235,17 @@ static int
 rmixl_nand_detach(device_t self, int flags)
 {
 	struct rmixl_nand_softc *sc = device_private(self);
-	int rv = 0;
+	int error;
 
-	pmf_device_deregister(self);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
-	if (sc->sc_nanddev != NULL)
-		rv = config_detach(sc->sc_nanddev, flags);
+	pmf_device_deregister(self);
 
 	bus_space_unmap(sc->sc_iobus_bst, sc->sc_iobus_bsh, sc->sc_iobus_size);
 
-	return rv;
+	return 0;
 }
 
 static void



CVS commit: src/sys/arch/x86/pci/imcsmb

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:07:49 UTC 2023

Modified Files:
src/sys/arch/x86/pci/imcsmb: imc.c imcsmb.c

Log Message:
x86/imc(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/pci/imcsmb/imc.c \
src/sys/arch/x86/pci/imcsmb/imcsmb.c

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

Modified files:

Index: src/sys/arch/x86/pci/imcsmb/imc.c
diff -u src/sys/arch/x86/pci/imcsmb/imc.c:1.5 src/sys/arch/x86/pci/imcsmb/imc.c:1.6
--- src/sys/arch/x86/pci/imcsmb/imc.c:1.5	Wed Sep 28 10:09:48 2022
+++ src/sys/arch/x86/pci/imcsmb/imc.c	Wed May 10 00:07:49 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: imc.c,v 1.5 2022/09/28 10:09:48 msaitoh Exp $ */
+/* $NetBSD: imc.c,v 1.6 2023/05/10 00:07:49 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imc.c,v 1.5 2022/09/28 10:09:48 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imc.c,v 1.6 2023/05/10 00:07:49 riastradh Exp $");
 
 #include 
 #include 
@@ -259,16 +259,11 @@ imc_rescan(device_t self, const char *if
 static int
 imc_detach(device_t self, int flags)
 {
-	struct imc_softc *sc = device_private(self);
-	int i, error;
+	int error;
 
-	for (i = 0; i < 2; i++) {
-		if (sc->sc_smbchild[i] != NULL) {
-			error = config_detach(sc->sc_smbchild[i], flags); 
-			if (error)
-return error;
-		}
-	}
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	pmf_device_deregister(self);
 	return 0;
Index: src/sys/arch/x86/pci/imcsmb/imcsmb.c
diff -u src/sys/arch/x86/pci/imcsmb/imcsmb.c:1.5 src/sys/arch/x86/pci/imcsmb/imcsmb.c:1.6
--- src/sys/arch/x86/pci/imcsmb/imcsmb.c:1.5	Sat Aug  7 16:19:08 2021
+++ src/sys/arch/x86/pci/imcsmb/imcsmb.c	Wed May 10 00:07:49 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: imcsmb.c,v 1.5 2021/08/07 16:19:08 thorpej Exp $ */
+/* $NetBSD: imcsmb.c,v 1.6 2023/05/10 00:07:49 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imcsmb.c,v 1.5 2021/08/07 16:19:08 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imcsmb.c,v 1.6 2023/05/10 00:07:49 riastradh Exp $");
 
 #include 
 #include 
@@ -182,14 +182,12 @@ imcsmb_chdet(device_t self, device_t chi
 static int
 imcsmb_detach(device_t self, int flags)
 {
-	int error;
 	struct imcsmb_softc *sc = device_private(self);
+	int error;
 
-	if (sc->sc_smbus != NULL) {
-		error = config_detach(sc->sc_smbus, flags);
-		if (error)
-			return error;
-	}
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	pmf_device_deregister(self);
 	iic_tag_fini(&sc->sc_i2c_tag);



CVS commit: src/sys/arch/mips

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:07:58 UTC 2023

Modified Files:
src/sys/arch/mips/ralink: ralink_cfi.c
src/sys/arch/mips/rmi: rmixl_nand.c

Log Message:
mips: Use config_detach_children to reduce error branch bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mips/ralink/ralink_cfi.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/rmi/rmixl_nand.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/x86/pci/imcsmb

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:07:49 UTC 2023

Modified Files:
src/sys/arch/x86/pci/imcsmb: imc.c imcsmb.c

Log Message:
x86/imc(4): Use config_detach_children.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/pci/imcsmb/imc.c \
src/sys/arch/x86/pci/imcsmb/imcsmb.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/x86/pci

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue May  9 23:11:09 UTC 2023

Modified Files:
src/sys/arch/x86/pci: ichlpcib.c

Log Message:
ichlpcib(4): Use config_detach_children.

Delete a lot of unnecessary code with broken error branches involving
config_detach which have probably seldom if ever been exercised.

No substantive functional change intended.  Low risk because
ichlpcib(4) is not a removable device, so you have to go out of your
way to exercise detach.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/x86/pci/ichlpcib.c

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

Modified files:

Index: src/sys/arch/x86/pci/ichlpcib.c
diff -u src/sys/arch/x86/pci/ichlpcib.c:1.60 src/sys/arch/x86/pci/ichlpcib.c:1.61
--- src/sys/arch/x86/pci/ichlpcib.c:1.60	Tue May  9 23:10:11 2023
+++ src/sys/arch/x86/pci/ichlpcib.c	Tue May  9 23:11:09 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichlpcib.c,v 1.60 2023/05/09 23:10:11 riastradh Exp $	*/
+/*	$NetBSD: ichlpcib.c,v 1.61 2023/05/09 23:11:09 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.60 2023/05/09 23:10:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.61 2023/05/09 23:11:09 riastradh Exp $");
 
 #include 
 #include 
@@ -138,21 +138,19 @@ static bool lpcib_resume(device_t, const
 static bool lpcib_shutdown(device_t, int);
 
 static void pmtimer_configure(device_t);
-static int pmtimer_unconfigure(device_t, int);
+static void pmtimer_unconfigure(device_t, int);
 
 static void tcotimer_configure(device_t);
-static int tcotimer_unconfigure(device_t, int);
 
 static void speedstep_configure(device_t);
 static void speedstep_unconfigure(device_t);
 static int speedstep_sysctl_helper(SYSCTLFN_ARGS);
 
 static void lpcib_hpet_configure(device_t);
-static int lpcib_hpet_unconfigure(device_t, int);
 
 #if NGPIO > 0
 static void lpcib_gpio_configure(device_t);
-static int lpcib_gpio_unconfigure(device_t, int);
+static void lpcib_gpio_unconfigure(device_t);
 static int lpcib_gpio_pin_read(void *, int);
 static void lpcib_gpio_pin_write(void *, int, int);
 static void lpcib_gpio_pin_ctl(void *, int, int);
@@ -160,7 +158,6 @@ static void lpcib_gpio_pin_ctl(void *, i
 
 #if NFWHRNG > 0
 static void lpcib_fwh_configure(device_t);
-static int lpcib_fwh_unconfigure(device_t, int);
 #endif
 
 struct lpcib_softc *speedstep_cookie;	/* XXX */
@@ -500,38 +497,32 @@ static int
 lpcibdetach(device_t self, int flags)
 {
 	struct lpcib_softc *sc = device_private(self);
-	int rc;
+	int error;
 
-	pmf_device_deregister(self);
-
-#if NFWHRNG > 0
-	if ((rc = lpcib_fwh_unconfigure(self, flags)) != 0)
-		return rc;
-#endif
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
-	if ((rc = lpcib_hpet_unconfigure(self, flags)) != 0)
-		return rc;
+	pmf_device_deregister(self);
 
 #if NGPIO > 0
-	if ((rc = lpcib_gpio_unconfigure(self, flags)) != 0)
-		return rc;
+	lpcib_gpio_unconfigure(self);
 #endif
 
 	/* Set up SpeedStep. */
 	speedstep_unconfigure(self);
 
-	if ((rc = tcotimer_unconfigure(self, flags)) != 0)
-		return rc;
-
-	if ((rc = pmtimer_unconfigure(self, flags)) != 0)
-		return rc;
+	pmtimer_unconfigure(self, flags);
 
 	if (sc->sc_has_rcba)
 		bus_space_unmap(sc->sc_rcbat, sc->sc_rcbah, LPCIB_RCBA_SIZE);
 
 	bus_space_unmap(sc->sc_pmt, sc->sc_pmh, sc->sc_iosize);
 
-	return pcibdetach(self, flags);
+	error = pcibdetach(self, flags);
+	KASSERTMSG(error == 0, "error=%d", error);
+
+	return 0;
 }
 
 static bool
@@ -622,20 +613,19 @@ pmtimer_configure(device_t self)
 	PMC_PM1_TMR, 0);
 }
 
-static int
+static void
 pmtimer_unconfigure(device_t self, int flags)
 {
 	struct lpcib_softc *sc = device_private(self);
-	int rc;
+	int error __diagused;
 
-	if (sc->sc_pmtimer != NULL &&
-	(rc = acpipmtimer_detach(sc->sc_pmtimer, flags)) != 0)
-		return rc;
+	if (sc->sc_pmtimer != NULL) {
+		error = acpipmtimer_detach(sc->sc_pmtimer, flags);
+		KASSERTMSG(error == 0, "error=%d", error);
+	}
 
 	pci_conf_write(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
 	LPCIB_PCI_ACPI_CNTL, sc->sc_acpi_cntl);
-
-	return 0;
 }
 
 /*
@@ -663,19 +653,6 @@ tcotimer_configure(device_t self)
 	CFARGS(.iattr = "tcoichbus"));
 }
 
-static int
-tcotimer_unconfigure(device_t self, int flags)
-{
-	struct lpcib_softc *sc = device_private(self);
-	int rc;
-
-	if (sc->sc_tco != NULL &&
-	(rc = config_detach(sc->sc_tco, flags)) != 0)
-		return rc;
-
-	return 0;
-}
-
 
 /*
  * Intel ICH SpeedStep support.
@@ -891,19 +868,6 @@ lpcib_hpet_configure(device_t self)
 	CFARGS(.iattr = "hpetichbus"));
 }
 
-static int
-lpcib_hpet_unconfigure(device_t self, int flags)
-{
-	struct lpcib_softc *sc = device_private(self);
-	int rc;
-
-	if (sc->sc_hpetbus != NULL &&
-	(rc = config_detach(sc->sc_hpetbus, flags)) != 0)
-		return rc;
-
-	return 0;
-}
-
 #if NGPIO > 0

CVS commit: src/sys/arch/x86/pci

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue May  9 23:11:09 UTC 2023

Modified Files:
src/sys/arch/x86/pci: ichlpcib.c

Log Message:
ichlpcib(4): Use config_detach_children.

Delete a lot of unnecessary code with broken error branches involving
config_detach which have probably seldom if ever been exercised.

No substantive functional change intended.  Low risk because
ichlpcib(4) is not a removable device, so you have to go out of your
way to exercise detach.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/x86/pci/ichlpcib.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/x86/pci

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue May  9 23:10:11 UTC 2023

Modified Files:
src/sys/arch/x86/pci: ichlpcib.c

Log Message:
ichlpcib(4): KNF.  No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/x86/pci/ichlpcib.c

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

Modified files:

Index: src/sys/arch/x86/pci/ichlpcib.c
diff -u src/sys/arch/x86/pci/ichlpcib.c:1.59 src/sys/arch/x86/pci/ichlpcib.c:1.60
--- src/sys/arch/x86/pci/ichlpcib.c:1.59	Wed Apr 12 06:39:15 2023
+++ src/sys/arch/x86/pci/ichlpcib.c	Tue May  9 23:10:11 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichlpcib.c,v 1.59 2023/04/12 06:39:15 riastradh Exp $	*/
+/*	$NetBSD: ichlpcib.c,v 1.60 2023/05/09 23:10:11 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.59 2023/04/12 06:39:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.60 2023/05/09 23:10:11 riastradh Exp $");
 
 #include 
 #include 
@@ -347,9 +347,9 @@ lpcibattach(device_t parent, device_t se
 	sc->sc_pmt = pa->pa_iot;
 	pmbase = pci_conf_read(pa->pa_pc, pa->pa_tag, LPCIB_PCI_PMBASE);
 	if (bus_space_map(sc->sc_pmt, PCI_MAPREG_IO_ADDR(pmbase),
-	LPCIB_PCI_PM_SIZE, 0, &sc->sc_pmh) != 0) {
+		LPCIB_PCI_PM_SIZE, 0, &sc->sc_pmh) != 0) {
 		aprint_error_dev(self,
-		"can't map power management i/o space\n");
+		"can't map power management i/o space\n");
 		return;
 	}
 
@@ -370,7 +370,7 @@ lpcibattach(device_t parent, device_t se
 		sc->sc_rcbat = sc->sc_pa.pa_memt;
 
 		rcba = pci_conf_read(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
-		 LPCIB_RCBA);
+		LPCIB_RCBA);
 		if ((rcba & LPCIB_RCBA_EN) == 0) {
 			aprint_error_dev(self, "RCBA is not enabled\n");
 			return;
@@ -378,7 +378,7 @@ lpcibattach(device_t parent, device_t se
 		rcba &= ~LPCIB_RCBA_EN;
 
 		if (bus_space_map(sc->sc_rcbat, rcba, LPCIB_RCBA_SIZE, 0,
-  &sc->sc_rcbah)) {
+			&sc->sc_rcbah)) {
 			aprint_error_dev(self, "RCBA could not be mapped\n");
 			return;
 		}
@@ -407,7 +407,7 @@ lpcibattach(device_t parent, device_t se
 
 	/* Install power handler */
 	if (!pmf_device_register1(self, lpcib_suspend, lpcib_resume,
-	lpcib_shutdown))
+		lpcib_shutdown))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
@@ -477,7 +477,7 @@ lpcibrescan(device_t self, const char *i
 {
 	struct lpcib_softc *sc = device_private(self);
 
-	if(ifattr_match(ifattr, "tcoichbus") && sc->sc_tco == NULL)
+	if (ifattr_match(ifattr, "tcoichbus") && sc->sc_tco == NULL)
 		tcotimer_configure(self);
 
 #if NFWHRNG > 0
@@ -604,7 +604,7 @@ pmtimer_configure(device_t self)
 	struct lpcib_softc *sc = device_private(self);
 	pcireg_t control;
 
-	/* 
+	/*
 	 * Check if power management I/O space is enabled and enable the ACPI_EN
 	 * bit if it's disabled.
 	 */
@@ -716,16 +716,16 @@ speedstep_configure(device_t self)
 	if (PCI_PRODUCT(sc->sc_pa.pa_id) == PCI_PRODUCT_INTEL_82801DBM_LPC ||
 	PCI_PRODUCT(sc->sc_pa.pa_id) == PCI_PRODUCT_INTEL_82801CAM_LPC ||
 	(PCI_PRODUCT(sc->sc_pa.pa_id) == PCI_PRODUCT_INTEL_82801BAM_LPC &&
-	 pci_find_device(&sc->sc_pa, speedstep_bad_hb_check) == 0)) {
+		pci_find_device(&sc->sc_pa, speedstep_bad_hb_check) == 0)) {
 		pcireg_t pmcon;
 
 		/* Enable SpeedStep if it isn't already enabled. */
 		pmcon = pci_conf_read(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
-  LPCIB_PCI_GEN_PMCON_1);
+		LPCIB_PCI_GEN_PMCON_1);
 		if ((pmcon & LPCIB_PCI_GEN_PMCON_1_SS_EN) == 0)
 			pci_conf_write(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
-   LPCIB_PCI_GEN_PMCON_1,
-   pmcon | LPCIB_PCI_GEN_PMCON_1_SS_EN);
+			LPCIB_PCI_GEN_PMCON_1,
+			pmcon | LPCIB_PCI_GEN_PMCON_1_SS_EN);
 
 		/* Put in machdep.speedstep_state (0 for low, 1 for high). */
 		if ((rv = sysctl_createv(&sc->sc_log, 0, NULL, &node,
@@ -928,7 +928,7 @@ lpcib_gpio_configure(device_t self)
 	}
 
 	gpio_cntl = pci_conf_read(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
-  cntl_reg);
+	cntl_reg);
 
 	/* Is GPIO enabled? */
 	if ((gpio_cntl & LPCIB_PCI_GPIO_CNTL_EN) == 0)
@@ -1023,14 +1023,14 @@ lpcib_gpio_pin_read(void *arg, int pin)
 	struct lpcib_softc *sc = arg;
 	uint32_t data;
 	int reg, shift;
-	
+
 	reg = (pin < 32) ? LPCIB_GPIO_GP_LVL : LPCIB_GPIO_GP_LVL2;
 	shift = pin % 32;
 
 	mutex_enter(&sc->sc_gpio_mtx);
 	data = bus_space_read_4(sc->sc_gpio_iot, sc->sc_gpio_ioh, reg);
 	mutex_exit(&sc->sc_gpio_mtx);
-	
+
 	return (__SHIFTOUT(data, __BIT(shift)) ? GPIO_PIN_HIGH : GPIO_PIN_LOW);
 }
 
@@ -1048,7 +1048,7 @@ lpcib_gpio_pin_write(void *arg, int pin,
 
 	data = bus_space_read_4(sc->sc_gpio_iot, sc->sc_gpio_ioh, reg);
 
-	if(value)
+	if (value)
 		data |= __BIT(shift);
 	else
 		data &= ~__BIT(shift);
@@ -1067,11 +1067,11 @@ lpcib_gpio_pin_ctl(void *arg, int pin, i
 
 	shift = pin % 32;
 	reg = (pin < 32) ? LPCIB_GPIO_GP_IO_SEL : LPCIB

CVS commit: src/sys/arch/x86/pci

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue May  9 23:10:11 UTC 2023

Modified Files:
src/sys/arch/x86/pci: ichlpcib.c

Log Message:
ichlpcib(4): KNF.  No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/x86/pci/ichlpcib.c

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



CVS commit: src/share/mk

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue May  9 22:52:22 UTC 2023

Modified Files:
src/share/mk: bsd.lib.mk

Log Message:
bsd.lib.mk: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.391 -r1.392 src/share/mk/bsd.lib.mk

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

Modified files:

Index: src/share/mk/bsd.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.391 src/share/mk/bsd.lib.mk:1.392
--- src/share/mk/bsd.lib.mk:1.391	Mon May  8 14:31:43 2023
+++ src/share/mk/bsd.lib.mk	Tue May  9 22:52:22 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.391 2023/05/08 14:31:43 christos Exp $
+#	$NetBSD: bsd.lib.mk,v 1.392 2023/05/09 22:52:22 riastradh Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include 
@@ -73,9 +73,9 @@ LDADD+=		-L${LIBDO.${_lib}} -l${_lib}
 DPADD+= ${LIBDO.${_lib}}/lib${_lib}_pic.a
 .elif exists(${LIBDO.${_lib}}/lib${_lib}.so)
 DPADD+= ${LIBDO.${_lib}}/lib${_lib}.so
-.else   
+.else
 DPADD+= ${LIBDO.${_lib}}/lib${_lib}.a
-.endif  
+.endif
 .endif
 .endfor
 .endif	# }
@@ -225,7 +225,7 @@ LIBSTRIPOBJCOBJS=	yes
 .if !defined(FFLAGS) || empty(FFLAGS:M*-g*)
 LIBSTRIPFOBJS=	yes
 .endif
-.if !defined(CSHLIBFLAGS) || empty(CSHLIBFLAGS:M*-g*) 
+.if !defined(CSHLIBFLAGS) || empty(CSHLIBFLAGS:M*-g*)
 LIBSTRIPSHLIBOBJS=	yes
 .endif
 
@@ -822,7 +822,7 @@ ${_DEST.OBJ}/${_LIB.so.full}: ${_LIB.so.
 	${.ALLSRC} ${.TARGET}
 .if ${_LIBSODIR} != ${LIBDIR}
 	${INSTALL_SYMLINK} -l r ${_DEST.OBJ}/${_LIB.so.full} \
-	${_DEST.LIB}/${_LIB.so.full} 
+	${_DEST.LIB}/${_LIB.so.full}
 .endif
 .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
 "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
@@ -851,7 +851,7 @@ ${_DEST.DEBUG}/${_LIB.so.debug}: ${_LIB.
 	${.ALLSRC} ${.TARGET}
 .if ${_LIBSODIR} != ${LIBDIR}
 	${INSTALL_SYMLINK} -l r ${_DEST.DEBUG}/${_LIB.so.debug} \
-	${_DEST.ODEBUG}/${_LIB.so.debug} 
+	${_DEST.ODEBUG}/${_LIB.so.debug}
 .endif
 .endif
 



CVS commit: src/share/mk

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue May  9 22:52:22 UTC 2023

Modified Files:
src/share/mk: bsd.lib.mk

Log Message:
bsd.lib.mk: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.391 -r1.392 src/share/mk/bsd.lib.mk

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



CVS commit: src/crypto/external/bsd/openssh

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 22:25:26 UTC 2023

Modified Files:
src/crypto/external/bsd/openssh/bin/ssh-agent: Makefile
src/crypto/external/bsd/openssh/bin/ssh-keygen: Makefile
src/crypto/external/bsd/openssh/bin/ssh-keyscan: Makefile
src/crypto/external/bsd/openssh/bin/ssh-pkcs11-helper: Makefile
src/crypto/external/bsd/openssh/bin/sshd: Makefile
src/crypto/external/bsd/openssh/libexec/ssh-sk-helper: Makefile

Log Message:
Handle OpenSSH-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/openssh/bin/ssh-agent/Makefile
cvs rdiff -u -r1.8 -r1.9 \
src/crypto/external/bsd/openssh/bin/ssh-keygen/Makefile
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/openssh/bin/ssh-keyscan/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssh/bin/ssh-pkcs11-helper/Makefile
cvs rdiff -u -r1.25 -r1.26 src/crypto/external/bsd/openssh/bin/sshd/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssh/libexec/ssh-sk-helper/Makefile

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

Modified files:

Index: src/crypto/external/bsd/openssh/bin/ssh-agent/Makefile
diff -u src/crypto/external/bsd/openssh/bin/ssh-agent/Makefile:1.5 src/crypto/external/bsd/openssh/bin/ssh-agent/Makefile:1.6
--- src/crypto/external/bsd/openssh/bin/ssh-agent/Makefile:1.5	Sun Mar  1 15:59:53 2020
+++ src/crypto/external/bsd/openssh/bin/ssh-agent/Makefile	Tue May  9 18:25:26 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2020/03/01 20:59:53 christos Exp $
+#	$NetBSD: Makefile,v 1.6 2023/05/09 22:25:26 christos Exp $
 
 BINDIR=/usr/bin
 
@@ -6,5 +6,6 @@ PROG=	ssh-agent
 SRCS=	ssh-agent.c ssh-pkcs11-client.c
 
 COPTS.ssh-agent.c+=	${GCC_NO_FORMAT_TRUNCATION}
+COPTS.ssh-pkcs11-client.c+= -Wno-error=deprecated-declarations
 
 .include 

Index: src/crypto/external/bsd/openssh/bin/ssh-keygen/Makefile
diff -u src/crypto/external/bsd/openssh/bin/ssh-keygen/Makefile:1.8 src/crypto/external/bsd/openssh/bin/ssh-keygen/Makefile:1.9
--- src/crypto/external/bsd/openssh/bin/ssh-keygen/Makefile:1.8	Sun Mar  1 15:59:53 2020
+++ src/crypto/external/bsd/openssh/bin/ssh-keygen/Makefile	Tue May  9 18:25:26 2023
@@ -1,12 +1,14 @@
-#	$NetBSD: Makefile,v 1.8 2020/03/01 20:59:53 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2023/05/09 22:25:26 christos Exp $
 
 BINDIR=	/usr/bin
 
 PROG=	ssh-keygen
 SRCS=	ssh-keygen.c moduli.c sshsig.c
 
-COPTS.ssh-keygen.c=	-Wno-pointer-sign
+COPTS.ssh-keygen.c+=	-Wno-pointer-sign
 
 COPTS.ssh-keygen.c+=	${GCC_NO_FORMAT_TRUNCATION}
+COPTS.ssh-keygen.c+= -Wno-error=deprecated-declarations
+COPTS.moduli.c+= -Wno-error=deprecated-declarations
 
 .include 

Index: src/crypto/external/bsd/openssh/bin/ssh-keyscan/Makefile
diff -u src/crypto/external/bsd/openssh/bin/ssh-keyscan/Makefile:1.5 src/crypto/external/bsd/openssh/bin/ssh-keyscan/Makefile:1.6
--- src/crypto/external/bsd/openssh/bin/ssh-keyscan/Makefile:1.5	Sun Mar  1 15:59:53 2020
+++ src/crypto/external/bsd/openssh/bin/ssh-keyscan/Makefile	Tue May  9 18:25:26 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2020/03/01 20:59:53 christos Exp $
+#	$NetBSD: Makefile,v 1.6 2023/05/09 22:25:26 christos Exp $
 
 BINDIR=	/usr/bin
 
@@ -6,4 +6,6 @@ PROG=	ssh-keyscan
 SRCS=	ssh-keyscan.c ssh_api.c kexgexs.c
 MAN=	ssh-keyscan.1
 
+COPTS.kexgexs.c+= -Wno-error=deprecated-declarations
+
 .include 

Index: src/crypto/external/bsd/openssh/bin/ssh-pkcs11-helper/Makefile
diff -u src/crypto/external/bsd/openssh/bin/ssh-pkcs11-helper/Makefile:1.3 src/crypto/external/bsd/openssh/bin/ssh-pkcs11-helper/Makefile:1.4
--- src/crypto/external/bsd/openssh/bin/ssh-pkcs11-helper/Makefile:1.3	Sun Mar  1 15:59:53 2020
+++ src/crypto/external/bsd/openssh/bin/ssh-pkcs11-helper/Makefile	Tue May  9 18:25:26 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2020/03/01 20:59:53 christos Exp $
+#	$NetBSD: Makefile,v 1.4 2023/05/09 22:25:26 christos Exp $
 
 BINOWN= root
 BINMODE=555
@@ -7,4 +7,6 @@ BINDIR= /usr/libexec
 PROG=	ssh-pkcs11-helper
 MAN=	ssh-pkcs11-helper.8
 
+COPTS.ssh-pkcs11-helper.c+= -Wno-error=deprecated-declarations
+
 .include 

Index: src/crypto/external/bsd/openssh/bin/sshd/Makefile
diff -u src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.25 src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.26
--- src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.25	Wed Oct  5 18:39:36 2022
+++ src/crypto/external/bsd/openssh/bin/sshd/Makefile	Tue May  9 18:25:26 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.25 2022/10/05 22:39:36 christos Exp $
+#	$NetBSD: Makefile,v 1.26 2023/05/09 22:25:26 christos Exp $
 
 .include 
 
@@ -73,5 +73,7 @@ DPADD+=	${LIBBLOCKLIST}
 
 COPTS.sshlogin.c+=	${GCC_NO_STRINGOP_TRUNCATION}
 COPTS.ldapauth.c+=	${GCC_NO_STRINGOP_TRUNCATION} ${GCC_NO_STRINGOP_OVERFLOW}
+COPTS.monitor.c+= -Wno-error=deprecated-declarations
+COPTS.kexgexs.c+= -Wno-error=deprecated-declarati

CVS commit: src/crypto/external/bsd/openssh

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 22:25:26 UTC 2023

Modified Files:
src/crypto/external/bsd/openssh/bin/ssh-agent: Makefile
src/crypto/external/bsd/openssh/bin/ssh-keygen: Makefile
src/crypto/external/bsd/openssh/bin/ssh-keyscan: Makefile
src/crypto/external/bsd/openssh/bin/ssh-pkcs11-helper: Makefile
src/crypto/external/bsd/openssh/bin/sshd: Makefile
src/crypto/external/bsd/openssh/libexec/ssh-sk-helper: Makefile

Log Message:
Handle OpenSSH-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/openssh/bin/ssh-agent/Makefile
cvs rdiff -u -r1.8 -r1.9 \
src/crypto/external/bsd/openssh/bin/ssh-keygen/Makefile
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/openssh/bin/ssh-keyscan/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssh/bin/ssh-pkcs11-helper/Makefile
cvs rdiff -u -r1.25 -r1.26 src/crypto/external/bsd/openssh/bin/sshd/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssh/libexec/ssh-sk-helper/Makefile

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



CVS commit: src/crypto/external/bsd/heimdal/bin/hxtool

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 22:12:33 UTC 2023

Modified Files:
src/crypto/external/bsd/heimdal/bin/hxtool: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/heimdal/bin/hxtool/Makefile

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



CVS commit: src/crypto/external/bsd/heimdal/bin/hxtool

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 22:12:33 UTC 2023

Modified Files:
src/crypto/external/bsd/heimdal/bin/hxtool: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/heimdal/bin/hxtool/Makefile

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

Modified files:

Index: src/crypto/external/bsd/heimdal/bin/hxtool/Makefile
diff -u src/crypto/external/bsd/heimdal/bin/hxtool/Makefile:1.2 src/crypto/external/bsd/heimdal/bin/hxtool/Makefile:1.3
--- src/crypto/external/bsd/heimdal/bin/hxtool/Makefile:1.2	Wed May 25 15:21:16 2011
+++ src/crypto/external/bsd/heimdal/bin/hxtool/Makefile	Tue May  9 18:12:33 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2011/05/25 19:21:16 he Exp $
+# $NetBSD: Makefile,v 1.3 2023/05/09 22:12:33 christos Exp $
 
 .include 
 .include <${.CURDIR}/../../Makefile.inc>
@@ -20,5 +20,7 @@ DPADD+= ${LIBGSSAPI}
 DPADD+= ${LIBSL}
 DPADD+= ${LIBEDIT} ${LIBTERMINFO}
 
+COPTS.hxtool.c+= -Wno-error=deprecated-declarations
+
 .include <${HEIMBASE}/Makefile.rules.inc>
 .include 



CVS commit: src/share/man/man4

2023-05-09 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue May  9 22:00:00 UTC 2023

Modified Files:
src/share/man/man4: video.4

Log Message:
video(4): fix a typo

>From Li-Wen Hsu in PR misc/57364; thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man4/video.4

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/video.4
diff -u src/share/man/man4/video.4:1.10 src/share/man/man4/video.4:1.11
--- src/share/man/man4/video.4:1.10	Tue Mar 18 18:20:39 2014
+++ src/share/man/man4/video.4	Tue May  9 22:00:00 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: video.4,v 1.10 2014/03/18 18:20:39 riastradh Exp $
+.\"	$NetBSD: video.4,v 1.11 2023/05/09 22:00:00 khorben Exp $
 .\"
 .\" Copyright (c) 2008 Patrick Mahoney
 .\" All rights reserved.
@@ -92,7 +92,7 @@ filled by the driver:
 describes the driver used by this device,
 .Va card
 describes the video capture card or camera, and
-.Va buf_info
+.Va bus_info
 represents the bus to which the hardware device is attached.
 .Pp
 The



CVS commit: src/share/man/man4

2023-05-09 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue May  9 22:00:00 UTC 2023

Modified Files:
src/share/man/man4: video.4

Log Message:
video(4): fix a typo

>From Li-Wen Hsu in PR misc/57364; thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man4/video.4

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



CVS commit: src/external/cddl/osnet/dev/fbt/aarch64

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue May  9 21:29:07 UTC 2023

Modified Files:
src/external/cddl/osnet/dev/fbt/aarch64: fbt_isa.c

Log Message:
dtrace_fbt: Read and write instruction words in little-endian.

Step toward making this work on aarch64eb.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c

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



CVS commit: src/external/cddl/osnet/dev/fbt/aarch64

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue May  9 21:29:07 UTC 2023

Modified Files:
src/external/cddl/osnet/dev/fbt/aarch64: fbt_isa.c

Log Message:
dtrace_fbt: Read and write instruction words in little-endian.

Step toward making this work on aarch64eb.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c

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

Modified files:

Index: src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c
diff -u src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c:1.7 src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c:1.8
--- src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c:1.7	Wed Mar 24 04:46:41 2021
+++ src/external/cddl/osnet/dev/fbt/aarch64/fbt_isa.c	Tue May  9 21:29:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: fbt_isa.c,v 1.7 2021/03/24 04:46:41 simonb Exp $	*/
+/*	$NetBSD: fbt_isa.c,v 1.8 2023/05/09 21:29:07 riastradh Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -103,7 +103,7 @@ fbt_patch_tracepoint(fbt_probe_t *fbt, f
 		return;
 	if (!mm_md_direct_mapped_phys(pa, &va))
 		return;
-	*(fbt_patchval_t *)va = val;
+	*(fbt_patchval_t *)va = htole32(val);
 	cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, sizeof(val));
 }
 
@@ -157,7 +157,7 @@ fbt_provide_module_cb(const char *name, 
 
 	/* Look for stp (pre-indexed) operation */
 	for (; instr < limit; instr++) {
-		if ((*instr & LDP_STP_MASK) == STP_64)
+		if ((le32toh(*instr) & LDP_STP_MASK) == STP_64)
 			break;
 	}
 
@@ -181,7 +181,7 @@ fbt_provide_module_cb(const char *name, 
 #ifdef __NetBSD__
 	fbt->fbtp_ctl = mod;
 #endif
-	fbt->fbtp_savedval = *instr;
+	fbt->fbtp_savedval = le32toh(*instr);
 	fbt->fbtp_patchval = FBT_PATCHVAL;
 	fbt->fbtp_symindx = symindx;
 
@@ -195,10 +195,10 @@ fbt_provide_module_cb(const char *name, 
 	retfbt = NULL;
 again:
 	for (; instr < limit; instr++) {
-		if (*instr == RET_INSTR)
+		if (le32toh(*instr) == RET_INSTR)
 			break;
-		else if ((*instr & B_MASK) == B_INSTR) {
-			offs = (*instr & B_DATA_MASK);
+		else if ((le32toh(*instr) & B_MASK) == B_INSTR) {
+			offs = (le32toh(*instr) & B_DATA_MASK);
 			offs *= 4;
 			target = (instr + offs);
 #ifdef __FreeBSD__
@@ -241,7 +241,7 @@ again:
 #ifdef __NetBSD__
 	fbt->fbtp_ctl = mod;
 #endif
-	fbt->fbtp_savedval = *instr;
+	fbt->fbtp_savedval = le32toh(*instr);
 	fbt->fbtp_patchval = FBT_PATCHVAL;
 	fbt->fbtp_symindx = symindx;
 



CVS commit: src/usr.bin/make

2023-05-09 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue May  9 21:24:56 UTC 2023

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

Log Message:
make: improve error message for failed stat in ':mtime'


To generate a diff of this commit:
cvs rdiff -u -r1.1052 -r1.1053 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/var.c
diff -u src/usr.bin/make/var.c:1.1052 src/usr.bin/make/var.c:1.1053
--- src/usr.bin/make/var.c:1.1052	Tue May  9 20:53:23 2023
+++ src/usr.bin/make/var.c	Tue May  9 21:24:56 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1052 2023/05/09 20:53:23 sjg Exp $	*/
+/*	$NetBSD: var.c,v 1.1053 2023/05/09 21:24:56 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.1052 2023/05/09 20:53:23 sjg Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1053 2023/05/09 21:24:56 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -2862,8 +2862,12 @@ ApplyModifier_Mtime(const char **pp, Mod
 	if (!ModChain_ShouldEval(ch))
 		return AMR_OK;
 	if (stat(Expr_Str(expr), &st) < 0) {
-		if (error)
-			return AMR_BAD;
+		if (error) {
+			Parse_Error(PARSE_FATAL,
+			"Cannot determine mtime for '%s': %s",
+			Expr_Str(expr), strerror(errno));
+			return AMR_CLEANUP;
+		}
 		if (i < 0)
 			time(&st.st_mtime);
 		else



CVS commit: src/usr.bin/make

2023-05-09 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue May  9 21:24:56 UTC 2023

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

Log Message:
make: improve error message for failed stat in ':mtime'


To generate a diff of this commit:
cvs rdiff -u -r1.1052 -r1.1053 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/external/bsd/pam-u2f/bin/pamu2fcfg

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 21:08:34 UTC 2023

Modified Files:
src/external/bsd/pam-u2f/bin/pamu2fcfg: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile

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

Modified files:

Index: src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile
diff -u src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile:1.4 src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile:1.5
--- src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile:1.4	Wed Nov  4 08:46:46 2020
+++ src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile	Tue May  9 17:08:34 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2020/11/04 13:46:46 khorben Exp $
+# $NetBSD: Makefile,v 1.5 2023/05/09 21:08:34 christos Exp $
 
 .include 
 
@@ -27,4 +27,6 @@ pamu2fcfg.1:
 	xsltproc --nonet --xinclude -o pamu2fcfg.1 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl' pamu2fcfg.1.xml
 	rm -f pamu2fcfg.1.xml
 
+COPTS.util.c+= -Wno-error=deprecated-declarations
+
 .include 



CVS commit: src/external/bsd/pam-u2f/bin/pamu2fcfg

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 21:08:34 UTC 2023

Modified Files:
src/external/bsd/pam-u2f/bin/pamu2fcfg: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile

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



CVS commit: src/external/bsd/wpa/bin

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 21:05:25 UTC 2023

Modified Files:
src/external/bsd/wpa/bin/hostapd: Makefile
src/external/bsd/wpa/bin/wpa_passphrase: Makefile
src/external/bsd/wpa/bin/wpa_supplicant: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/wpa/bin/hostapd/Makefile
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/wpa/bin/wpa_passphrase/Makefile
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/wpa/bin/wpa_supplicant/Makefile

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

Modified files:

Index: src/external/bsd/wpa/bin/hostapd/Makefile
diff -u src/external/bsd/wpa/bin/hostapd/Makefile:1.15 src/external/bsd/wpa/bin/hostapd/Makefile:1.16
--- src/external/bsd/wpa/bin/hostapd/Makefile:1.15	Sun Feb 28 22:42:57 2021
+++ src/external/bsd/wpa/bin/hostapd/Makefile	Tue May  9 17:05:24 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2021/03/01 03:42:57 christos Exp $
+# $NetBSD: Makefile,v 1.16 2023/05/09 21:05:24 christos Exp $
 
 .include "${.CURDIR}/../Makefile.inc"
 
@@ -247,5 +247,9 @@ SRCS+= sha1-pbkdf2.c sha1.c md5.c
 .endif
 
 CWARNFLAGS.gcc+=	${GCC_NO_ADDR_OF_PACKED_MEMBER}
+COPTS.dpp.c+= -Wno-error=deprecated-declarations
+COPTS.crypto_openssl.c+= -Wno-error=deprecated-declarations
+COPTS.fips_prf_openssl.c+= -Wno-error=deprecated-declarations
+COPTS.tls_openssl.c+= -Wno-error=deprecated-declarations
 
 .include 

Index: src/external/bsd/wpa/bin/wpa_passphrase/Makefile
diff -u src/external/bsd/wpa/bin/wpa_passphrase/Makefile:1.5 src/external/bsd/wpa/bin/wpa_passphrase/Makefile:1.6
--- src/external/bsd/wpa/bin/wpa_passphrase/Makefile:1.5	Sat Jan  5 00:40:00 2019
+++ src/external/bsd/wpa/bin/wpa_passphrase/Makefile	Tue May  9 17:05:24 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2019/01/05 05:40:00 christos Exp $
+# $NetBSD: Makefile,v 1.6 2023/05/09 21:05:24 christos Exp $
 
 .include "${.CURDIR}/../Makefile.inc"
 
@@ -25,5 +25,6 @@ SRCS+= sha1-pbkdf2.c sha1.c md5.c
 
 
 MAN=	wpa_passphrase.8
+COPTS.crypto_openssl.c+= -Wno-error=deprecated-declarations
 
 .include 

Index: src/external/bsd/wpa/bin/wpa_supplicant/Makefile
diff -u src/external/bsd/wpa/bin/wpa_supplicant/Makefile:1.10 src/external/bsd/wpa/bin/wpa_supplicant/Makefile:1.11
--- src/external/bsd/wpa/bin/wpa_supplicant/Makefile:1.10	Fri Jan  4 16:22:20 2019
+++ src/external/bsd/wpa/bin/wpa_supplicant/Makefile	Tue May  9 17:05:24 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2019/01/04 21:22:20 christos Exp $
+# $NetBSD: Makefile,v 1.11 2023/05/09 21:05:24 christos Exp $
 
 .include "${.CURDIR}/../Makefile.inc"
 
@@ -148,4 +148,7 @@ SRCS+= sha1-pbkdf2.c sha1.c md5.c
 
 .endif
 
+COPTS.crypto_openssl.c+= -Wno-error=deprecated-declarations
+COPTS.tls_openssl.c+= -Wno-error=deprecated-declarations
+
 .include 



CVS commit: src/external/bsd/wpa/bin

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 21:05:25 UTC 2023

Modified Files:
src/external/bsd/wpa/bin/hostapd: Makefile
src/external/bsd/wpa/bin/wpa_passphrase: Makefile
src/external/bsd/wpa/bin/wpa_supplicant: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/wpa/bin/hostapd/Makefile
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/wpa/bin/wpa_passphrase/Makefile
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/wpa/bin/wpa_supplicant/Makefile

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



CVS commit: src/external/bsd/tcpdump/bin

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:55:39 UTC 2023

Modified Files:
src/external/bsd/tcpdump/bin: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/tcpdump/bin/Makefile

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

Modified files:

Index: src/external/bsd/tcpdump/bin/Makefile
diff -u src/external/bsd/tcpdump/bin/Makefile:1.21 src/external/bsd/tcpdump/bin/Makefile:1.22
--- src/external/bsd/tcpdump/bin/Makefile:1.21	Sun Apr 11 22:54:07 2021
+++ src/external/bsd/tcpdump/bin/Makefile	Tue May  9 16:55:39 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21 2021/04/12 02:54:07 mrg Exp $	
+#	$NetBSD: Makefile,v 1.22 2023/05/09 20:55:39 christos Exp $	
 
 WARNS?=	1	# XXX: need to cleanup later
 
@@ -208,5 +208,7 @@ tcpdump.8: tcpdump.1.in
 CWARNFLAGS.clang+=	-Wno-error=address-of-packed-member
 CWARNFLAGS.gcc+=	${GCC_NO_ADDR_OF_PACKED_MEMBER}
 COPTS.print-bgp.c+=	${GCC_NO_FORMAT_TRUNCATION}
+COPTS.signature.c+=	-Wno-error=deprecated-declarations
+COPTS.print-tcp.c+=	-Wno-error=deprecated-declarations
 
 .include 



CVS commit: src/external/bsd/tcpdump/bin

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:55:39 UTC 2023

Modified Files:
src/external/bsd/tcpdump/bin: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/tcpdump/bin/Makefile

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

2023-05-09 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Tue May  9 20:53:23 UTC 2023

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

Log Message:
make: :mtime=error throw error on stat(2) failure

Sometimes we want fatal error if stat fails on the
presumed pathname.


To generate a diff of this commit:
cvs rdiff -u -r1.364 -r1.365 src/usr.bin/make/make.1
cvs rdiff -u -r1.1051 -r1.1052 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.1
diff -u src/usr.bin/make/make.1:1.364 src/usr.bin/make/make.1:1.365
--- src/usr.bin/make/make.1:1.364	Tue May  9 20:14:27 2023
+++ src/usr.bin/make/make.1	Tue May  9 20:53:23 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.364 2023/05/09 20:14:27 sjg Exp $
+.\"	$NetBSD: make.1,v 1.365 2023/05/09 20:53:23 sjg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -1522,6 +1522,13 @@ If
 fails; use
 .Ar timestamp
 or current time.
+If
+.Ar timestamp
+is set to
+.Ql error ,
+then
+.Xr stat 2
+failure will cause an error.
 .It Cm \&:tA
 Attempts to convert the value to an absolute path using
 .Xr realpath 3 .

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1051 src/usr.bin/make/var.c:1.1052
--- src/usr.bin/make/var.c:1.1051	Tue May  9 20:14:27 2023
+++ src/usr.bin/make/var.c	Tue May  9 20:53:23 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1051 2023/05/09 20:14:27 sjg Exp $	*/
+/*	$NetBSD: var.c,v 1.1052 2023/05/09 20:53:23 sjg 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.1051 2023/05/09 20:14:27 sjg Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1052 2023/05/09 20:53:23 sjg Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -2841,6 +2841,7 @@ ApplyModifier_Mtime(const char **pp, Mod
 	Expr *expr = ch->expr;
 	const char *args, *mod = *pp;
 	struct stat st;
+	bool error = false;
 	int i = -1;
 
 	if (!ModMatchEq(mod, "mtime", ch))
@@ -2849,13 +2850,20 @@ ApplyModifier_Mtime(const char **pp, Mod
 	args = *pp;
 	if (args[0] == '=') {
 		args++;
-		if (!TryParseIntBase0(&args, &i))
-			return AMR_BAD;
+		if (!TryParseIntBase0(&args, &i)) {
+			if (strncmp(args, "error", 5) == 0) {
+error = true;
+args += 5;
+			} else
+return AMR_BAD;
+		}
 		*pp = args;
 	}
 	if (!ModChain_ShouldEval(ch))
 		return AMR_OK;
 	if (stat(Expr_Str(expr), &st) < 0) {
+		if (error)
+			return AMR_BAD;
 		if (i < 0)
 			time(&st.st_mtime);
 		else



CVS commit: src/usr.bin/make

2023-05-09 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Tue May  9 20:53:23 UTC 2023

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

Log Message:
make: :mtime=error throw error on stat(2) failure

Sometimes we want fatal error if stat fails on the
presumed pathname.


To generate a diff of this commit:
cvs rdiff -u -r1.364 -r1.365 src/usr.bin/make/make.1
cvs rdiff -u -r1.1051 -r1.1052 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/external/bsd/ntp

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:51:15 UTC 2023

Modified Files:
src/external/bsd/ntp/bin/ntp-keygen: Makefile
src/external/bsd/ntp/bin/ntpd: Makefile
src/external/bsd/ntp/bin/sntp: Makefile
src/external/bsd/ntp/dist/ntpd: ntp_crypto.c
src/external/bsd/ntp/dist/util: ntp-keygen.c

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/ntp/bin/ntp-keygen/Makefile
cvs rdiff -u -r1.28 -r1.29 src/external/bsd/ntp/bin/ntpd/Makefile
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/bin/sntp/Makefile
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/ntp/dist/ntpd/ntp_crypto.c
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/ntp/dist/util/ntp-keygen.c

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



CVS commit: src/external/bsd/ntp

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:51:15 UTC 2023

Modified Files:
src/external/bsd/ntp/bin/ntp-keygen: Makefile
src/external/bsd/ntp/bin/ntpd: Makefile
src/external/bsd/ntp/bin/sntp: Makefile
src/external/bsd/ntp/dist/ntpd: ntp_crypto.c
src/external/bsd/ntp/dist/util: ntp-keygen.c

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/ntp/bin/ntp-keygen/Makefile
cvs rdiff -u -r1.28 -r1.29 src/external/bsd/ntp/bin/ntpd/Makefile
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/bin/sntp/Makefile
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/ntp/dist/ntpd/ntp_crypto.c
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/ntp/dist/util/ntp-keygen.c

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

Modified files:

Index: src/external/bsd/ntp/bin/ntp-keygen/Makefile
diff -u src/external/bsd/ntp/bin/ntp-keygen/Makefile:1.7 src/external/bsd/ntp/bin/ntp-keygen/Makefile:1.8
--- src/external/bsd/ntp/bin/ntp-keygen/Makefile:1.7	Sun Oct 11 03:07:31 2020
+++ src/external/bsd/ntp/bin/ntp-keygen/Makefile	Tue May  9 16:51:14 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2020/10/11 07:07:31 rin Exp $
+#	$NetBSD: Makefile,v 1.8 2023/05/09 20:51:14 christos Exp $
 
 .include 
 
@@ -21,6 +21,7 @@ CPPFLAGS+=-I${IDIST}/include -I${IDIST}/
 .PATH: ${DIST}
 
 COPTS.ntp-keygen.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error=restrict :}
+COPTS.ntp-keygen.c+=	-Wno-error=deprecated-declarations
 
 CLEANFILES+=${MAN}
 

Index: src/external/bsd/ntp/bin/ntpd/Makefile
diff -u src/external/bsd/ntp/bin/ntpd/Makefile:1.28 src/external/bsd/ntp/bin/ntpd/Makefile:1.29
--- src/external/bsd/ntp/bin/ntpd/Makefile:1.28	Sun Oct 11 03:07:31 2020
+++ src/external/bsd/ntp/bin/ntpd/Makefile	Tue May  9 16:51:14 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.28 2020/10/11 07:07:31 rin Exp $
+#	$NetBSD: Makefile,v 1.29 2023/05/09 20:51:14 christos Exp $
 
 .include 
 
@@ -96,6 +96,7 @@ COPTS.refclock_parse.c+=	${GCC_NO_FORMAT
 COPTS.refclock_leitch.c+=	${GCC_NO_FORMAT_TRUNCATION}
 COPTS.refclock_neoclock4x.c+=	${GCC_NO_FORMAT_TRUNCATION}
 COPTS.ntp_io.c+=	${GCC_NO_ADDR_OF_PACKED_MEMBER}
+COPTS.ntp_crypto.c+=		-Wno-error=deprecated-declarations
 
 CLEANFILES+=${MAN}
 

Index: src/external/bsd/ntp/bin/sntp/Makefile
diff -u src/external/bsd/ntp/bin/sntp/Makefile:1.9 src/external/bsd/ntp/bin/sntp/Makefile:1.10
--- src/external/bsd/ntp/bin/sntp/Makefile:1.9	Sun Oct 11 03:07:32 2020
+++ src/external/bsd/ntp/bin/sntp/Makefile	Tue May  9 16:51:14 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2020/10/11 07:07:32 rin Exp $
+# $NetBSD: Makefile,v 1.10 2023/05/09 20:51:14 christos Exp $
 
 USE_FORT?= yes	# network client/server
 
@@ -34,6 +34,7 @@ LDADD+= -L${LIBISC} -liscntp -levent -lm
 DPADD+=	${LIBM} ${LIBEVENT}
 
 COPTS.utilities.c+=	${GCC_NO_FORMAT_TRUNCATION}
+COPTS.crypto.c+=	-Wno-error=deprecated-declarations
 
 CLEANFILES+=${MAN}
 

Index: src/external/bsd/ntp/dist/ntpd/ntp_crypto.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_crypto.c:1.16 src/external/bsd/ntp/dist/ntpd/ntp_crypto.c:1.17
--- src/external/bsd/ntp/dist/ntpd/ntp_crypto.c:1.16	Mon May 25 16:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/ntp_crypto.c	Tue May  9 16:51:14 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_crypto.c,v 1.16 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: ntp_crypto.c,v 1.17 2023/05/09 20:51:14 christos Exp $	*/
 
 /*
  * ntp_crypto.c - NTP version 4 public key routines
@@ -836,7 +836,7 @@ crypto_recv(
 			 * errors.
 			 */
 			if (vallen == (u_int)EVP_PKEY_size(host_pkey)) {
-RSA *rsa = EVP_PKEY_get0_RSA(host_pkey);
+RSA *rsa = __UNCONST(EVP_PKEY_get0_RSA(host_pkey));
 u_int32 *cookiebuf = malloc(RSA_size(rsa));
 if (!cookiebuf) {
 	rval = XEVNT_CKY;
@@ -1613,7 +1613,7 @@ crypto_encrypt(
 	puch = vp->ptr;
 	temp32 = htonl(*cookie);
 	if (RSA_public_encrypt(4, (u_char *)&temp32, puch,
-	EVP_PKEY_get0_RSA(pkey), RSA_PKCS1_OAEP_PADDING) <= 0) {
+	__UNCONST(EVP_PKEY_get0_RSA(pkey)), RSA_PKCS1_OAEP_PADDING) <= 0) {
 		msyslog(LOG_ERR, "crypto_encrypt: %s",
 		ERR_error_string(ERR_get_error(), NULL));
 		free(vp->ptr);
@@ -2186,7 +2186,7 @@ crypto_alice(
 		return (XEVNT_ID);
 	}
 
-	if ((dsa = EVP_PKEY_get0_DSA(peer->ident_pkey->pkey)) == NULL) {
+	if ((dsa = __UNCONST(EVP_PKEY_get0_DSA(peer->ident_pkey->pkey))) == NULL) {
 		msyslog(LOG_NOTICE, "crypto_alice: defective key");
 		return (XEVNT_PUB);
 	}
@@ -2264,7 +2264,7 @@ crypto_bob(
 		msyslog(LOG_NOTICE, "crypto_bob: scheme unavailable");
 		return (XEVNT_ID);
 	}
-	dsa = EVP_PKEY_get0_DSA(iffkey_info->pkey);
+	dsa = __UNCONST(EVP_PKEY_get0_DSA(iffkey_info->pkey));
 	DSA_get0_pqg(dsa, &p, &q, &g);
 	DSA_get0_key(dsa, NULL, &priv_key);
 
@@ -2383,7 +2383,7 @@ crypto_iff(
 		ntohl(ep->fstamp));
 		return (XEVNT_FSP);
 	}
-	if ((dsa = EVP_PKEY_get0_DSA(peer->ident_pkey->pkey)) == NULL) 

CVS commit: src/usr.bin/midirecord

2023-05-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue May  9 20:42:19 UTC 2023

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

Log Message:
log how much data is valid in debug mode.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/midirecord/midirecord.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/midirecord

2023-05-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue May  9 20:42:19 UTC 2023

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

Log Message:
log how much data is valid in debug mode.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/midirecord/midirecord.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/midirecord/midirecord.c
diff -u src/usr.bin/midirecord/midirecord.c:1.12 src/usr.bin/midirecord/midirecord.c:1.13
--- src/usr.bin/midirecord/midirecord.c:1.12	Sat Jun  3 21:31:14 2017
+++ src/usr.bin/midirecord/midirecord.c	Tue May  9 20:42:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: midirecord.c,v 1.12 2017/06/03 21:31:14 mrg Exp $	*/
+/*	$NetBSD: midirecord.c,v 1.13 2023/05/09 20:42:19 mrg Exp $	*/
 
 /*
  * Copyright (c) 2014, 2015, 2017 Matthew R. Green
@@ -33,7 +33,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: midirecord.c,v 1.12 2017/06/03 21:31:14 mrg Exp $");
+__RCSID("$NetBSD: midirecord.c,v 1.13 2023/05/09 20:42:19 mrg Exp $");
 #endif
 
 #include 
@@ -576,11 +576,12 @@ midi_event_to_output(seq_event_t e, u_ch
 {
 	size_t size = 0;
 
-	LOG("event: %02x:%02x:%02x:%02x %02x:%02x:%02x:%02x", e.tag,
+	LOG("event: %02x:%02x:%02x:%02x %02x:%02x:%02x:%02x (%zu valid)",
+	 e.tag,
 	 e.unknown.byte[0], e.unknown.byte[1],
 	 e.unknown.byte[2], e.unknown.byte[3],
 	 e.unknown.byte[4], e.unknown.byte[5],
-	 e.unknown.byte[6]);
+	 e.unknown.byte[6], bufsize);
 
 	switch (e.tag) {
 	case SEQ_LOCAL:



CVS commit: src/external/bsd/ntp/lib/libntp

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:39:24 UTC 2023

Modified Files:
src/external/bsd/ntp/lib/libntp: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/external/bsd/ntp/lib/libntp/Makefile

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

Modified files:

Index: src/external/bsd/ntp/lib/libntp/Makefile
diff -u src/external/bsd/ntp/lib/libntp/Makefile:1.25 src/external/bsd/ntp/lib/libntp/Makefile:1.26
--- src/external/bsd/ntp/lib/libntp/Makefile:1.25	Tue Apr 13 00:58:59 2021
+++ src/external/bsd/ntp/lib/libntp/Makefile	Tue May  9 16:39:24 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.25 2021/04/13 04:58:59 mrg Exp $
+#	$NetBSD: Makefile,v 1.26 2023/05/09 20:39:24 christos Exp $
 
 LIBISPRIVATE=yes
 
@@ -105,4 +105,6 @@ COPTS.timetoa.c+=	${GCC_NO_FORMAT_TRUNCA
 COPTS.socktoa.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-restrict :}
 COPTS.socktohost.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-restrict :}
 
+COPTS.a_md5encrypt.c+= -Wno-error=deprecated-declarations
+
 .include 



CVS commit: src/external/bsd/ntp/lib/libntp

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:39:24 UTC 2023

Modified Files:
src/external/bsd/ntp/lib/libntp: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/external/bsd/ntp/lib/libntp/Makefile

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



CVS commit: src

2023-05-09 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Tue May  9 20:14:28 UTC 2023

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make: make.1 var.c
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: varmod-mtime.exp varmod-mtime.mk

Log Message:
make: add :mtime to provide mtime of file

The value of the variable is passed to stat(2)
and st_mtime is new value.
An optional arg can be used if stat(2) fails, otherwise
the current time is used.

See varmod-mtime.mk for usage examples.


To generate a diff of this commit:
cvs rdiff -u -r1.1258 -r1.1259 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.363 -r1.364 src/usr.bin/make/make.1
cvs rdiff -u -r1.1050 -r1.1051 src/usr.bin/make/var.c
cvs rdiff -u -r1.333 -r1.334 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/varmod-mtime.exp \
src/usr.bin/make/unit-tests/varmod-mtime.mk

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



CVS commit: src/usr.sbin/plainrsa-gen

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:14:38 UTC 2023

Modified Files:
src/usr.sbin/plainrsa-gen: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/plainrsa-gen/Makefile

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



CVS commit: src/usr.sbin/racoon

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:11:55 UTC 2023

Modified Files:
src/usr.sbin/racoon: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/racoon/Makefile

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



CVS commit: src/usr.sbin/syslogd

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:10:07 UTC 2023

Modified Files:
src/usr.sbin/syslogd: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/syslogd/Makefile

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/syslogd/Makefile
diff -u src/usr.sbin/syslogd/Makefile:1.31 src/usr.sbin/syslogd/Makefile:1.32
--- src/usr.sbin/syslogd/Makefile:1.31	Sun Mar  7 10:09:12 2021
+++ src/usr.sbin/syslogd/Makefile	Tue May  9 16:10:07 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.31 2021/03/07 15:09:12 christos Exp $
+#	$NetBSD: Makefile,v 1.32 2023/05/09 20:10:07 christos Exp $
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
 .include 
 
@@ -32,5 +32,7 @@ LDADD+=	-lssl -lcrypto
 
 # Overflow that appears impossible
 COPTS.syslogd.c+=${GCC_NO_FORMAT_TRUNCATION} ${GCC_NO_STRINGOP_TRUNCATION}
+COPTS.tls.c+= -Wno-error=deprecated-declarations
+COPTS.sign.c+= -Wno-error=deprecated-declarations
 
 .include 



CVS commit: src/usr.sbin/syslogd

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:10:07 UTC 2023

Modified Files:
src/usr.sbin/syslogd: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/syslogd/Makefile

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



CVS commit: src/usr.sbin/plainrsa-gen

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:14:38 UTC 2023

Modified Files:
src/usr.sbin/plainrsa-gen: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/plainrsa-gen/Makefile

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/plainrsa-gen/Makefile
diff -u src/usr.sbin/plainrsa-gen/Makefile:1.1 src/usr.sbin/plainrsa-gen/Makefile:1.2
--- src/usr.sbin/plainrsa-gen/Makefile:1.1	Sun Jan 23 09:35:44 2022
+++ src/usr.sbin/plainrsa-gen/Makefile	Tue May  9 16:14:37 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2022/01/23 14:35:44 christos Exp $
+# $NetBSD: Makefile,v 1.2 2023/05/09 20:14:37 christos Exp $
 
 WARNS?=	0	# XXX third-party program, many issues
 NOCLANGERROR=	# defined
@@ -25,6 +25,11 @@ CPPFLAGS+=	-DOPENSSL_API_COMPAT=0x101000
 LDADD+= -lcrypto -lipsec
 DPADD+= ${LIBCRYPTO} ${LIBIPSEC}
 
+COPTS.plainrsa-gen.c+= -Wno-error=deprecated-declarations
+COPTS.crypto_openssl.c+= -Wno-error=deprecated-declarations
+COPTS.rsalist.c+= -Wno-error=deprecated-declarations
+COPTS.prsa_par.c+= -Wno-error=deprecated-declarations
+
 LPREFIX=prsa
 YPREFIX=prsa
 YFLAGS=-d



CVS commit: src

2023-05-09 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Tue May  9 20:14:28 UTC 2023

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make: make.1 var.c
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: varmod-mtime.exp varmod-mtime.mk

Log Message:
make: add :mtime to provide mtime of file

The value of the variable is passed to stat(2)
and st_mtime is new value.
An optional arg can be used if stat(2) fails, otherwise
the current time is used.

See varmod-mtime.mk for usage examples.


To generate a diff of this commit:
cvs rdiff -u -r1.1258 -r1.1259 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.363 -r1.364 src/usr.bin/make/make.1
cvs rdiff -u -r1.1050 -r1.1051 src/usr.bin/make/var.c
cvs rdiff -u -r1.333 -r1.334 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/varmod-mtime.exp \
src/usr.bin/make/unit-tests/varmod-mtime.mk

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1258 src/distrib/sets/lists/tests/mi:1.1259
--- src/distrib/sets/lists/tests/mi:1.1258	Sun Apr 23 08:47:27 2023
+++ src/distrib/sets/lists/tests/mi	Tue May  9 20:14:28 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1258 2023/04/23 08:47:27 rillig Exp $
+# $NetBSD: mi,v 1.1259 2023/05/09 20:14:28 sjg Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6099,6 +6099,8 @@
 ./usr/tests/usr.bin/make/unit-tests/varmod-match-escape.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/varmod-match.exptests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/varmod-match.mktests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/varmod-mtime.exptests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/varmod-mtime.mktests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/varmod-no-match.exptests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/varmod-no-match.mktests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/varmod-order-numeric.exp			tests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.363 src/usr.bin/make/make.1:1.364
--- src/usr.bin/make/make.1:1.363	Sun May  7 16:43:50 2023
+++ src/usr.bin/make/make.1	Tue May  9 20:14:27 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.363 2023/05/07 16:43:50 sjg Exp $
+.\"	$NetBSD: make.1,v 1.364 2023/05/09 20:14:27 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 May 6, 2023
+.Dd May 9, 2023
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -1510,6 +1510,18 @@ producing the formatted timestamp.
 If a
 .Ar timestamp
 value is not provided or is 0, the current time is used.
+.It Cm \&:mtime Ns Oo Cm = Ns Ar timestamp Oc
+call
+.Xr stat 2
+with the value as pathname;
+use
+.Ql st_mtime
+as the new value.
+If
+.Xr stat 2
+fails; use
+.Ar timestamp
+or current time.
 .It Cm \&:tA
 Attempts to convert the value to an absolute path using
 .Xr realpath 3 .

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1050 src/usr.bin/make/var.c:1.1051
--- src/usr.bin/make/var.c:1.1050	Tue May  9 16:26:59 2023
+++ src/usr.bin/make/var.c	Tue May  9 20:14:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1050 2023/05/09 16:26:59 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.1051 2023/05/09 20:14:27 sjg 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.1050 2023/05/09 16:26:59 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1051 2023/05/09 20:14:27 sjg Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -2833,6 +2833,39 @@ ApplyModifier_Match(const char **pp, Mod
 	return AMR_OK;
 }
 
+/* :mtime */
+static ApplyModifierResult
+ApplyModifier_Mtime(const char **pp, ModChain *ch)
+{
+	char buf[BUFSIZ];
+	Expr *expr = ch->expr;
+	const char *args, *mod = *pp;
+	struct stat st;
+	int i = -1;
+
+	if (!ModMatchEq(mod, "mtime", ch))
+		return AMR_UNKNOWN;
+	*pp += 5;
+	args = *pp;
+	if (args[0] == '=') {
+		args++;
+		if (!TryParseIntBase0(&args, &i))
+			return AMR_BAD;
+		*pp = args;
+	}
+	if (!ModChain_ShouldEval(ch))
+		return AMR_OK;
+	if (stat(Expr_Str(expr), &st) < 0) {
+		if (i < 0)
+			time(&st.st_mtime);
+		else
+			st.st_mtime = (time_t)i;
+	}
+	snprintf(buf, sizeof(buf), "%u", (unsigned)st.st_mtime);
+	Expr_SetValueOwn(expr, bmake_strdup(buf));
+	return AMR_OK;
+}
+
 static void
 ParsePatternFlags(const char **pp, PatternFlags *pflags, bool *oneBigWord)
 {
@@ -3815,6 +3848,8 @@ ApplyModifier(const char **pp, Mod

CVS commit: src/usr.sbin/racoon

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:11:55 UTC 2023

Modified Files:
src/usr.sbin/racoon: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/racoon/Makefile

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/racoon/Makefile
diff -u src/usr.sbin/racoon/Makefile:1.41 src/usr.sbin/racoon/Makefile:1.42
--- src/usr.sbin/racoon/Makefile:1.41	Mon May  8 22:30:21 2023
+++ src/usr.sbin/racoon/Makefile	Tue May  9 16:11:54 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.41 2023/05/09 02:30:21 christos Exp $
+# $NetBSD: Makefile,v 1.42 2023/05/09 20:11:54 christos Exp $
 
 WARNS?=	0	# XXX third-party program, many issues
 NOCLANGERROR=	# defined
@@ -84,9 +84,10 @@ prsa_par.c: ${DIST}/src/racoon/prsa_par.
 CWARNFLAGS.gcc+=${GCC_NO_ADDR_OF_PACKED_MEMBER}
 
 COPTS+=		-fcommon
-COPTS.crypto_openssl.c+=-Wno-error=deprecated-declarations
-COPTS.rsalist.c+=-Wno-error=deprecated-declarations
-COPTS.prsa_par.c+=-Wno-error=deprecated-declarations
+COPTS.crypto_openssl.c+= -Wno-error=deprecated-declarations
+COPTS.rsalist.c+= -Wno-error=deprecated-declarations
+COPTS.prsa_par.c+= -Wno-error=deprecated-declarations
+COPTS.plainrsa-gen.c+= -Wno-error=deprecated-declarations
 
 
 .include 



CVS commit: src/games/factor

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:03:11 UTC 2023

Modified Files:
src/games/factor: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/games/factor/Makefile

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

Modified files:

Index: src/games/factor/Makefile
diff -u src/games/factor/Makefile:1.14 src/games/factor/Makefile:1.15
--- src/games/factor/Makefile:1.14	Mon Apr 12 00:19:32 2021
+++ src/games/factor/Makefile	Tue May  9 16:03:11 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2021/04/12 04:19:32 mrg Exp $
+#	$NetBSD: Makefile,v 1.15 2023/05/09 20:03:11 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 5/31/93
 
 .include 
@@ -13,6 +13,8 @@ CPPFLAGS+=-DHAVE_OPENSSL
 LDADD+=	-lcrypto -lcrypt
 DPADD+=	${LIBCRYPTO} ${LIBCRYPT}
 
+COPTS.factor.c+= -Wno-error=deprecated-declarations
+
 MAN=	factor.6
 .PATH:	${PRIMES}
 



CVS commit: src/games/factor

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:03:11 UTC 2023

Modified Files:
src/games/factor: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/games/factor/Makefile

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



CVS commit: src/usr.bin/moduli/qsafe

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:02:59 UTC 2023

Modified Files:
src/usr.bin/moduli/qsafe: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/moduli/qsafe/Makefile

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



CVS commit: src/usr.bin/moduli/qsafe

2023-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  9 20:02:59 UTC 2023

Modified Files:
src/usr.bin/moduli/qsafe: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/moduli/qsafe/Makefile

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/moduli/qsafe/Makefile
diff -u src/usr.bin/moduli/qsafe/Makefile:1.1 src/usr.bin/moduli/qsafe/Makefile:1.2
--- src/usr.bin/moduli/qsafe/Makefile:1.1	Tue Jan 24 13:59:23 2006
+++ src/usr.bin/moduli/qsafe/Makefile	Tue May  9 16:02:59 2023
@@ -1,10 +1,13 @@
-# $NetBSD: Makefile,v 1.1 2006/01/24 18:59:23 elad Exp $
+# $NetBSD: Makefile,v 1.2 2023/05/09 20:02:59 christos Exp $
 
 NOMAN=yes
 PROG=   qsafe
 SRCS= qsafe.c qfile.c
+
 QSIEVE=${.CURDIR}/../qsieve
 .PATH: ${QSIEVE}
 CPPFLAGS+=-I${QSIEVE}
 
+COPTS.qsafe.c+= -Wno-error=deprecated-declarations
+
 .include 



  1   2   >