CVS commit: src/sys/dev/fdt

2024-02-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Feb  9 06:28:50 UTC 2024

Modified Files:
src/sys/dev/fdt: dwcmmc_fdt.c

Log Message:
spaces to tabs


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/fdt/dwcmmc_fdt.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/fdt/dwcmmc_fdt.c
diff -u src/sys/dev/fdt/dwcmmc_fdt.c:1.20 src/sys/dev/fdt/dwcmmc_fdt.c:1.21
--- src/sys/dev/fdt/dwcmmc_fdt.c:1.20	Fri Dec 29 08:02:47 2023
+++ src/sys/dev/fdt/dwcmmc_fdt.c	Fri Feb  9 06:28:50 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: dwcmmc_fdt.c,v 1.20 2023/12/29 08:02:47 skrll Exp $ */
+/* $NetBSD: dwcmmc_fdt.c,v 1.21 2024/02/09 06:28:50 skrll Exp $ */
 
 /*-
  * Copyright (c) 2015-2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.20 2023/12/29 08:02:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.21 2024/02/09 06:28:50 skrll Exp $");
 
 #include 
 #include 
@@ -236,7 +236,7 @@ static int
 dwcmmc_fdt_bus_clock(struct dwc_mmc_softc *sc, int rate)
 {
 	struct dwcmmc_fdt_softc *esc = device_private(sc->sc_dev);
-const u_int ciu_div = sc->sc_ciu_div > 0 ? sc->sc_ciu_div : 1;
+	const u_int ciu_div = sc->sc_ciu_div > 0 ? sc->sc_ciu_div : 1;
 	int error;
 
 	error = clk_set_rate(esc->sc_clk_ciu, 1000 * rate * ciu_div);



CVS commit: src/sys/dev/fdt

2024-02-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Feb  9 06:28:50 UTC 2024

Modified Files:
src/sys/dev/fdt: dwcmmc_fdt.c

Log Message:
spaces to tabs


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

2024-02-08 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Feb  9 06:01:03 UTC 2024

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

Log Message:
Fix DMA sync sizes.
Don't panic for inconsistent queue counter, just print an error to console.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/pci/if_iwm.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/if_iwm.c
diff -u src/sys/dev/pci/if_iwm.c:1.88 src/sys/dev/pci/if_iwm.c:1.89
--- src/sys/dev/pci/if_iwm.c:1.88	Thu Sep 21 09:31:50 2023
+++ src/sys/dev/pci/if_iwm.c	Fri Feb  9 06:01:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwm.c,v 1.88 2023/09/21 09:31:50 msaitoh Exp $	*/
+/*	$NetBSD: if_iwm.c,v 1.89 2024/02/09 06:01:03 mlelstv Exp $	*/
 /*	OpenBSD: if_iwm.c,v 1.148 2016/11/19 21:07:08 stsp Exp	*/
 #define IEEE80211_NO_HT
 /*
@@ -106,7 +106,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.88 2023/09/21 09:31:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.89 2024/02/09 06:01:03 mlelstv Exp $");
 
 #include 
 #include 
@@ -1262,8 +1262,9 @@ iwm_free_rx_ring(struct iwm_softc *sc, s
 		struct iwm_rx_data *data = >data[i];
 
 		if (data->m != NULL) {
+			bus_size_t sz = data->m->m_pkthdr.len;
 			bus_dmamap_sync(sc->sc_dmat, data->map, 0,
-			data->map->dm_mapsize, BUS_DMASYNC_POSTREAD);
+			sz, BUS_DMASYNC_POSTREAD);
 			bus_dmamap_unload(sc->sc_dmat, data->map);
 			m_freem(data->m);
 			data->m = NULL;
@@ -1405,8 +1406,9 @@ iwm_reset_tx_ring(struct iwm_softc *sc, 
 		struct iwm_tx_data *data = >data[i];
 
 		if (data->m != NULL) {
+			bus_size_t sz = data->m->m_pkthdr.len;
 			bus_dmamap_sync(sc->sc_dmat, data->map, 0,
-			data->map->dm_mapsize, BUS_DMASYNC_POSTWRITE);
+			sz, BUS_DMASYNC_POSTWRITE);
 			bus_dmamap_unload(sc->sc_dmat, data->map);
 			m_freem(data->m);
 			data->m = NULL;
@@ -1436,8 +1438,9 @@ iwm_free_tx_ring(struct iwm_softc *sc, s
 		struct iwm_tx_data *data = >data[i];
 
 		if (data->m != NULL) {
+			bus_size_t sz = data->m->m_pkthdr.len;
 			bus_dmamap_sync(sc->sc_dmat, data->map, 0,
-			data->map->dm_mapsize, BUS_DMASYNC_POSTWRITE);
+			sz, BUS_DMASYNC_POSTWRITE);
 			bus_dmamap_unload(sc->sc_dmat, data->map);
 			m_freem(data->m);
 			data->m = NULL;
@@ -1517,7 +1520,7 @@ iwm_ict_reset(struct iwm_softc *sc)
 	iwm_disable_interrupts(sc);
 
 	memset(sc->ict_dma.vaddr, 0, IWM_ICT_SIZE);
-	bus_dmamap_sync(sc->sc_dmat, sc->ict_dma.map, 0, IWM_ICT_SIZE,
+	bus_dmamap_sync(sc->sc_dmat, sc->ict_dma.map, 0, sc->ict_dma.size,
 	BUS_DMASYNC_PREWRITE);
 	sc->ict_cur = 0;
 
@@ -3766,7 +3769,7 @@ iwm_rx_addbuf(struct iwm_softc *sc, int 
 	if (size <= MCLBYTES) {
 		MCLGET(m, M_DONTWAIT);
 	} else {
-		MEXTMALLOC(m, IWM_RBUF_SIZE, M_DONTWAIT);
+		MEXTMALLOC(m, size, M_DONTWAIT);
 	}
 	if ((m->m_flags & M_EXT) == 0) {
 		m_freem(m);
@@ -3778,7 +3781,7 @@ iwm_rx_addbuf(struct iwm_softc *sc, int 
 		fatal = 1;
 	}
 
-	m->m_len = m->m_pkthdr.len = m->m_ext.ext_size;
+	m->m_len = m->m_pkthdr.len = size;
 	err = bus_dmamap_load_mbuf(sc->sc_dmat, data->map, m,
 	BUS_DMA_READ|BUS_DMA_NOWAIT);
 	if (err) {
@@ -4452,12 +4455,17 @@ iwm_cmd_done(struct iwm_softc *sc, int q
 	wakeup(>desc[idx]);
 
 	if (((idx + ring->queued) % IWM_TX_RING_COUNT) != ring->cur) {
-		aprint_error_dev(sc->sc_dev,
+		device_printf(sc->sc_dev,
 		"Some HCMDs skipped?: idx=%d queued=%d cur=%d\n",
 		idx, ring->queued, ring->cur);
 	}
 
-	KASSERT(ring->queued > 0);
+	if (ring->queued == 0) {
+		splx(s);
+		device_printf(sc->sc_dev, "cmd_done with empty ring\n");
+		return;
+	}
+
 	if (--ring->queued == 0)
 		iwm_clear_cmd_in_flight(sc);
 
@@ -4785,7 +4793,7 @@ iwm_tx(struct iwm_softc *sc, struct mbuf
 		| ((seg->ds_len) << 4);
 	}
 
-	bus_dmamap_sync(sc->sc_dmat, data->map, 0, data->map->dm_mapsize,
+	bus_dmamap_sync(sc->sc_dmat, data->map, 0, m->m_pkthdr.len,
 	BUS_DMASYNC_PREWRITE);
 	bus_dmamap_sync(sc->sc_dmat, ring->cmd_dma.map,
 	(uint8_t *)cmd - (uint8_t *)ring->cmd, sizeof(*cmd),



CVS commit: src/sys/dev/pci

2024-02-08 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Feb  9 06:01:03 UTC 2024

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

Log Message:
Fix DMA sync sizes.
Don't panic for inconsistent queue counter, just print an error to console.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/pci/if_iwm.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/blocklist/etc

2024-02-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Feb  9 01:00:12 UTC 2024

Modified Files:
src/external/bsd/blocklist/etc: blocklistd.conf

Log Message:
add an IPv6 example to blocklistd.conf example file


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/blocklist/etc/blocklistd.conf

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/blocklist/etc/blocklistd.conf
diff -u src/external/bsd/blocklist/etc/blocklistd.conf:1.2 src/external/bsd/blocklist/etc/blocklistd.conf:1.3
--- src/external/bsd/blocklist/etc/blocklistd.conf:1.2	Mon Jun 15 21:27:57 2020
+++ src/external/bsd/blocklist/etc/blocklistd.conf	Fri Feb  9 01:00:12 2024
@@ -10,5 +10,6 @@ domain		*	*	named		*	3	12h
 # adr/mask:port	type	proto	owner		name	nfail	disable
 [remote]
 #129.168.0.0/16	*	*	*		=	*	*
+#[2001:db8::]/32:ssh	*	*	*		=	*	*
 #6161		=	=	=		=/24	=	=
 #*		stream	tcp	*		=	=	=



CVS commit: src/external/bsd/blocklist/etc

2024-02-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Feb  9 01:00:12 UTC 2024

Modified Files:
src/external/bsd/blocklist/etc: blocklistd.conf

Log Message:
add an IPv6 example to blocklistd.conf example file


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/blocklist/etc/blocklistd.conf

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



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

2024-02-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Feb  9 00:59:08 UTC 2024

Modified Files:
src/external/bsd/blocklist/bin: blocklistd.conf.5

Log Message:
add an IPv6 example to blocklistd.conf(5)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/blocklist/bin/blocklistd.conf.5

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/blocklist/bin/blocklistd.conf.5
diff -u src/external/bsd/blocklist/bin/blocklistd.conf.5:1.2 src/external/bsd/blocklist/bin/blocklistd.conf.5:1.3
--- src/external/bsd/blocklist/bin/blocklistd.conf.5:1.2	Mon Jun 15 02:29:44 2020
+++ src/external/bsd/blocklist/bin/blocklistd.conf.5	Fri Feb  9 00:59:08 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: blocklistd.conf.5,v 1.2 2020/06/15 02:29:44 christos Exp $
+.\" $NetBSD: blocklistd.conf.5,v 1.3 2024/02/09 00:59:08 wiz Exp $
 .\"
 .\" Copyright (c) 2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 18, 2020
+.Dd February 9, 2024
 .Dt BLOCKLISTD.CONF 5
 .Os
 .Sh NAME
@@ -209,6 +209,8 @@ bnx0:ssh	*	*	*	*	3	6h
 [remote]
 # Never block 1.2.3.4
 1.2.3.4:ssh	*	*	*	*	*	*
+# Never block the example IPv6 subnet either
+[2001:db8::]/32:ssh	*	*	*	*	*	*
 # For addresses coming from 8.8.0.0/16 block class C networks instead
 # individual hosts, but keep the rest of the blocking parameters the same.
 8.8.0.0/16:ssh	*	*	*	/24	=	=



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

2024-02-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Feb  9 00:59:08 UTC 2024

Modified Files:
src/external/bsd/blocklist/bin: blocklistd.conf.5

Log Message:
add an IPv6 example to blocklistd.conf(5)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/blocklist/bin/blocklistd.conf.5

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



CVS commit: src/external/bsd/blocklist

2024-02-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Feb  9 00:53:30 UTC 2024

Modified Files:
src/external/bsd/blocklist: README

Log Message:
Spelling fixes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/blocklist/README

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/blocklist/README
diff -u src/external/bsd/blocklist/README:1.2 src/external/bsd/blocklist/README:1.3
--- src/external/bsd/blocklist/README:1.2	Mon Jun 15 21:27:57 2020
+++ src/external/bsd/blocklist/README	Fri Feb  9 00:53:30 2024
@@ -1,4 +1,4 @@
-# $NetBSD: README,v 1.2 2020/06/15 21:27:57 christos Exp $
+# $NetBSD: README,v 1.3 2024/02/09 00:53:30 wiz Exp $
 
 This package contains library that can be used by network daemons to
 communicate with a packet filter via a daemon to enforce opening and
@@ -15,7 +15,7 @@ blocklistd=YES in /etc/rc.conf, start it
 
 There is also a startup file in etc/rc.d/blocklistd
 
-Patches to various daemons to add blocklisting capabilitiers are in the
+Patches to various daemons to add blocklisting capabilities are in the
 "diff" directory:
 - OpenSSH: diff/ssh.diff [tcp socket example]
 - Bind: diff/named.diff [both tcp and udp]
@@ -24,7 +24,7 @@ Patches to various daemons to add blockl
 These patches have been applied to NetBSD-current.
 
 The network daemon (for example sshd) communicates to blocklistd, via
-a unix socket like syslog. The library calls are simple and everything
+a Unix socket like syslog. The library calls are simple and everything
 is handled by the library. In the simplest form the only thing the
 daemon needs to do is to call:
 
@@ -60,11 +60,11 @@ ssh		stream	tcp6		*	*	6	60m
 http		stream	tcp		*	*	6	60m
 
 Here note that owner is * because the connection is done from the
-child ssh socket which runs with user privs. We treat ipv4 connections
+child ssh socket which runs with user privs. We treat IPv4 connections
 differently by maintaining two different rules one for the external
 interface and one from the internal We also register for both tcp
 and tcp6 since those are different listening sockets and addresses;
-we don't bother with ipv6 and separate rules. We use nfail = 6,
+we don't bother with IPv6 and separate rules. We use nfail = 6,
 because ssh allows 3 password attempts per connection, and this
 will let us have 2 connections before blocking. Finally we block
 for an hour; we could block forever too by specifying * in the
@@ -100,7 +100,7 @@ group "internal" on $int_if {
 
 You can use 'blocklistctl dump -a' to list all the current entries
 in the database; the ones that have nfail / where urrent
->= otal, should have an id assosiated with them; this means that
+>= otal, should have an id associated with them; this means that
 there is a packet filter rule added for that entry. For npf, you
 can examine the packet filter dynamic rule entries using 'npfctl
 rule  list'.  The number of current entries can exceed



CVS commit: src/external/bsd/blocklist

2024-02-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Feb  9 00:53:30 UTC 2024

Modified Files:
src/external/bsd/blocklist: README

Log Message:
Spelling fixes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/blocklist/README

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



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

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  9 00:39:16 UTC 2024

Modified Files:
src/external/bsd/blocklist/bin: conf.c

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/blocklist/bin/conf.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/blocklist/bin/conf.c
diff -u src/external/bsd/blocklist/bin/conf.c:1.4 src/external/bsd/blocklist/bin/conf.c:1.5
--- src/external/bsd/blocklist/bin/conf.c:1.4	Thu Feb  8 19:37:06 2024
+++ src/external/bsd/blocklist/bin/conf.c	Thu Feb  8 19:39:16 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: conf.c,v 1.4 2024/02/09 00:37:06 christos Exp $	*/
+/*	$NetBSD: conf.c,v 1.5 2024/02/09 00:39:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: conf.c,v 1.4 2024/02/09 00:37:06 christos Exp $");
+__RCSID("$NetBSD: conf.c,v 1.5 2024/02/09 00:39:16 christos Exp $");
 
 #include 
 #ifdef HAVE_LIBUTIL_H
@@ -308,7 +308,7 @@ conf_gethostport(const char *f, size_t l
 		return -1;
 
 	if (port && c->c_port != FSTAR && c->c_port != FEQUAL)
-		*port = htons((in_port_t)c->c_port)
+		*port = htons((in_port_t)c->c_port);
 	return 0;
 out:
 	(*lfun)(LOG_ERR, "%s: %s, %zu: Bad address [%s]", __func__, f, l, p);



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

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  9 00:39:16 UTC 2024

Modified Files:
src/external/bsd/blocklist/bin: conf.c

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/blocklist/bin/conf.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/blocklist/bin

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  9 00:37:06 UTC 2024

Modified Files:
src/external/bsd/blocklist/bin: conf.c

Log Message:
PR/57905: Mark Davies: blocklistd fails to parse ipv6 addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/blocklist/bin/conf.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/blocklist/bin/conf.c
diff -u src/external/bsd/blocklist/bin/conf.c:1.3 src/external/bsd/blocklist/bin/conf.c:1.4
--- src/external/bsd/blocklist/bin/conf.c:1.3	Fri Nov 18 11:01:00 2022
+++ src/external/bsd/blocklist/bin/conf.c	Thu Feb  8 19:37:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: conf.c,v 1.3 2022/11/18 16:01:00 christos Exp $	*/
+/*	$NetBSD: conf.c,v 1.4 2024/02/09 00:37:06 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: conf.c,v 1.3 2022/11/18 16:01:00 christos Exp $");
+__RCSID("$NetBSD: conf.c,v 1.4 2024/02/09 00:37:06 christos Exp $");
 
 #include 
 #ifdef HAVE_LIBUTIL_H
@@ -261,7 +261,7 @@ conf_gethostport(const char *f, size_t l
 		if (debug)
 			(*lfun)(LOG_DEBUG, "%s: host6 %s", __func__, p);
 		if (strcmp(p, "*") != 0) {
-			if (inet_pton(AF_INET6, p, >sin6_addr) == -1)
+			if (inet_pton(AF_INET6, p, >sin6_addr) != 1)
 goto out;
 			sin6->sin6_family = AF_INET6;
 #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
@@ -308,10 +308,10 @@ conf_gethostport(const char *f, size_t l
 		return -1;
 
 	if (port && c->c_port != FSTAR && c->c_port != FEQUAL)
-		*port = htons((in_port_t)c->c_port);
+		*port = htons((in_port_t)c->c_port)
 	return 0;
 out:
-	(*lfun)(LOG_ERR, "%s: %s, %zu: Bad address [%s]", __func__, f, l, pstr);
+	(*lfun)(LOG_ERR, "%s: %s, %zu: Bad address [%s]", __func__, f, l, p);
 	return -1;
 out1:
 	(*lfun)(LOG_ERR, "%s: %s, %zu: Can't specify mask %d with "
@@ -1172,7 +1172,7 @@ conf_parse(const char *f)
 		return;
 	}
 
-	lineno = 1;
+	lineno = 0;
 
 	confset_init();
 	confset_init();



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

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  9 00:37:06 UTC 2024

Modified Files:
src/external/bsd/blocklist/bin: conf.c

Log Message:
PR/57905: Mark Davies: blocklistd fails to parse ipv6 addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/blocklist/bin/conf.c

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



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

2024-02-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  8 20:59:20 UTC 2024

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

Log Message:
lint: clean up variable names, parameter order, comments

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.392 -r1.393 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.216 -r1.217 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.604 -r1.605 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.392 src/usr.bin/xlint/lint1/decl.c:1.393
--- src/usr.bin/xlint/lint1/decl.c:1.392	Thu Feb  8 20:45:20 2024
+++ src/usr.bin/xlint/lint1/decl.c	Thu Feb  8 20:59:19 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.392 2024/02/08 20:45:20 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.393 2024/02/08 20:59:19 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: decl.c,v 1.392 2024/02/08 20:45:20 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.393 2024/02/08 20:59:19 rillig Exp $");
 #endif
 
 #include 
@@ -1341,8 +1341,8 @@ add_function(sym_t *decl, struct paramet
 	debug_dcs_all();
 	debug_sym("decl: ", decl, "\n");
 #ifdef DEBUG
-	for (const sym_t *arg = params.first; arg != NULL; arg = arg->s_next)
-		debug_sym("arg: ", arg, "\n");
+	for (const sym_t *p = params.first; p != NULL; p = p->s_next)
+		debug_sym("param: ", p, "\n");
 #endif
 
 	if (params.prototype) {

Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.216 src/usr.bin/xlint/lint1/lex.c:1.217
--- src/usr.bin/xlint/lint1/lex.c:1.216	Thu Feb  8 20:45:20 2024
+++ src/usr.bin/xlint/lint1/lex.c	Thu Feb  8 20:59:19 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.216 2024/02/08 20:45:20 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.217 2024/02/08 20:59:19 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: lex.c,v 1.216 2024/02/08 20:45:20 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.217 2024/02/08 20:59:19 rillig Exp $");
 #endif
 
 #include 
@@ -705,7 +705,7 @@ lex_operator(int t, op_t o)
 }
 
 static buffer *
-read_quoted(bool *complete, bool wide, char delim)
+read_quoted(bool *complete, char delim, bool wide)
 {
 	buffer *buf = xcalloc(1, sizeof(*buf));
 	buf_init(buf);
@@ -947,7 +947,7 @@ static buffer *
 lex_quoted(char delim, bool wide)
 {
 	bool complete;
-	buffer *buf = read_quoted(, wide, delim);
+	buffer *buf = read_quoted(, delim, wide);
 	check_quoted(buf, complete, delim);
 	return buf;
 }

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.604 src/usr.bin/xlint/lint1/tree.c:1.605
--- src/usr.bin/xlint/lint1/tree.c:1.604	Thu Feb  8 20:45:20 2024
+++ src/usr.bin/xlint/lint1/tree.c	Thu Feb  8 20:59:19 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.604 2024/02/08 20:45:20 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.605 2024/02/08 20:59:19 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.604 2024/02/08 20:45:20 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.605 2024/02/08 20:59:19 rillig Exp $");
 #endif
 
 #include 
@@ -321,9 +321,8 @@ ic_expr(const tnode_t *tn)
 type_t *
 block_derive_type(type_t *tp, tspec_t t)
 {
-	type_t *tp2;
 
-	tp2 = block_zero_alloc(sizeof(*tp2), "type");
+	type_t *tp2 = block_zero_alloc(sizeof(*tp2), "type");
 	tp2->t_tspec = t;
 	tp2->t_subt = tp;
 	return tp2;
@@ -336,9 +335,8 @@ block_derive_type(type_t *tp, tspec_t t)
 type_t *
 expr_derive_type(type_t *tp, tspec_t t)
 {
-	type_t *tp2;
 
-	tp2 = expr_zero_alloc(sizeof(*tp2), "type");
+	type_t *tp2 = expr_zero_alloc(sizeof(*tp2), "type");
 	tp2->t_tspec = t;
 	tp2->t_subt = tp;
 	return tp2;
@@ -3806,55 +3804,48 @@ convert_constant_check_range(tspec_t ot,
 		warn_constant_check_range_loss(op, arg, tp, ot);
 }
 
-/*-
- * Converts a typed constant to a constant of another type.
- *
- * op		operator which requires conversion
- * arg		if op is FARG, # of parameter
- * tp		type to which to convert the constant
- * nv		new constant
- * v		old constant
- */
+/* Converts a typed constant to a constant of another type. */
 void
-convert_constant(op_t op, int arg, const type_t *tp, val_t *nv, val_t *v)
+convert_constant(op_t op, int arg, const type_t *ntp, val_t *nv, val_t *ov)
 {
 	/*
-	 * TODO: make 'v' const; the name of this function does not suggest
-	 *  that it modifies 'v'.
+	 * TODO: make 'ov' const; the name of this function does not suggest
+	 *  that it modifies 'ov'.
 	 */
-	tspec_t ot = v->v_tspec;
-	tspec_t nt = nv->v_tspec = tp->t_tspec;
+	tspec_t ot = ov->v_tspec;
+	tspec_t nt = nv->v_tspec = ntp->t_tspec;
 	bool range_check = false;
 
 	if (nt == BOOL) 

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

2024-02-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  8 20:59:20 UTC 2024

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

Log Message:
lint: clean up variable names, parameter order, comments

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.392 -r1.393 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.216 -r1.217 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.604 -r1.605 src/usr.bin/xlint/lint1/tree.c

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



CVS commit: src

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 20:51:25 UTC 2024

Modified Files:
src/common/lib/libc/arch/arm/string: strcpy_arm.S
src/sbin/blkdiscard: blkdiscard.c
src/share/doc/papers/pulldown: 0.t
src/sys/arch/powerpc/include: psl.h
src/sys/dev/marvell: mvxpbm.c
src/sys/dev/pci: cs4280.c cs4280reg.h
src/sys/fs/nfs/client: nfs_clrpcops.c
src/usr.sbin/inetd: parse_v2.c
src/usr.sbin/sysinst: disklabel.c gpt.c mbr.c

Log Message:
fix misplaced or missing "e" in words with "ment" ending (argument, implement,
increment, decrement, alignment), in comments, documentation, log messages.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/arm/string/strcpy_arm.S
cvs rdiff -u -r1.3 -r1.4 src/sbin/blkdiscard/blkdiscard.c
cvs rdiff -u -r1.1 -r1.2 src/share/doc/papers/pulldown/0.t
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/powerpc/include/psl.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/marvell/mvxpbm.c
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/pci/cs4280.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/cs4280reg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/fs/nfs/client/nfs_clrpcops.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/inetd/parse_v2.c
cvs rdiff -u -r1.51 -r1.52 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/sysinst/mbr.c

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/strcpy_arm.S
diff -u src/common/lib/libc/arch/arm/string/strcpy_arm.S:1.6 src/common/lib/libc/arch/arm/string/strcpy_arm.S:1.7
--- src/common/lib/libc/arch/arm/string/strcpy_arm.S:1.6	Sat Jan 14 03:35:21 2017
+++ src/common/lib/libc/arch/arm/string/strcpy_arm.S	Thu Feb  8 20:51:24 2024
@@ -29,7 +29,7 @@
 
 #include 
 
-RCSID("$NetBSD: strcpy_arm.S,v 1.6 2017/01/14 03:35:21 christos Exp $")
+RCSID("$NetBSD: strcpy_arm.S,v 1.7 2024/02/08 20:51:24 andvar Exp $")
 
 #ifdef STRLCPY
 #ifdef _LIBC
@@ -248,9 +248,9 @@ ENTRY(FUNCNAME)
 	 */
 	mov	r3, #24			/* assume NUL is in byte 3 */
 	tst	r5, #BYTE1		/* did we find a NUL in byte 1? */
-	subeq	r3, r3, #8		/*   yes, decremnt byte position */
+	subeq	r3, r3, #8		/*   yes, decrement byte position */
 	tstne	r5, #BYTE2		/*   no, did we find a NUL in byte 2? */
-	subeq	r3, r3, #8		/*   yes, decremnt byte position */
+	subeq	r3, r3, #8		/*   yes, decrement byte position */
 	tstne	r5, #BYTE3		/*   no, did we find a NUL in byte 3? */
 	bne	.Lincongruent_mainloop_load /*   no, no NUL encountered! */
 #endif

Index: src/sbin/blkdiscard/blkdiscard.c
diff -u src/sbin/blkdiscard/blkdiscard.c:1.3 src/sbin/blkdiscard/blkdiscard.c:1.4
--- src/sbin/blkdiscard/blkdiscard.c:1.3	Thu Jan 25 02:42:17 2024
+++ src/sbin/blkdiscard/blkdiscard.c	Thu Feb  8 20:51:24 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: blkdiscard.c,v 1.3 2024/01/25 02:42:17 mrg Exp $	*/
+/*	$NetBSD: blkdiscard.c,v 1.4 2024/02/08 20:51:24 andvar Exp $	*/
 
 /*
  * Copyright (c) 2019, 2020, 2022, 2024 Matthew R. Green
@@ -155,7 +155,7 @@ main(int argc, char *argv[])
 	argv += optind;
 
 	if (secure)
-		usage("blkdiscard: secure erase not yet implemnted\n");
+		usage("blkdiscard: secure erase not yet implemented\n");
 	if (zeroout) {
 		zeros = calloc(1, max_per_call);
 		if (!zeros)

Index: src/share/doc/papers/pulldown/0.t
diff -u src/share/doc/papers/pulldown/0.t:1.1 src/share/doc/papers/pulldown/0.t:1.2
--- src/share/doc/papers/pulldown/0.t:1.1	Wed Jul  4 05:29:25 2001
+++ src/share/doc/papers/pulldown/0.t	Thu Feb  8 20:51:24 2024
@@ -1,4 +1,4 @@
-.\"	$Id: 0.t,v 1.1 2001/07/04 05:29:25 itojun Exp $
+.\"	$Id: 0.t,v 1.2 2024/02/08 20:51:24 andvar Exp $
 .\"
 .EQ
 delim $$
@@ -7,7 +7,7 @@ delim $$
 .TL
 Mbuf issues in 4.4BSD IPv6/IPsec support
 .br
-\(em experiences from KAME IPv6/IPsec implemntation \(em
+\(em experiences from KAME IPv6/IPsec implementation \(em
 .AU
 Jun-ichiro itojun Hagino
 .AI

Index: src/sys/arch/powerpc/include/psl.h
diff -u src/sys/arch/powerpc/include/psl.h:1.22 src/sys/arch/powerpc/include/psl.h:1.23
--- src/sys/arch/powerpc/include/psl.h:1.22	Sat Mar  6 08:08:19 2021
+++ src/sys/arch/powerpc/include/psl.h	Thu Feb  8 20:51:24 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.22 2021/03/06 08:08:19 rin Exp $	*/
+/*	$NetBSD: psl.h,v 1.23 2024/02/08 20:51:24 andvar Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -74,7 +74,7 @@
 
 #define	PSL_601_MASK	~(PSL_VEC|PSL_POW|PSL_ILE|PSL_BE|PSL_RI|PSL_LE)
 
-/* The IBM 970 series does not implemnt LE mode */
+/* The IBM 970 series does not implement LE mode */
 #define PSL_970_MASK	~(PSL_ILE|PSL_LE)
 
 /*

Index: src/sys/dev/marvell/mvxpbm.c
diff -u src/sys/dev/marvell/mvxpbm.c:1.3 src/sys/dev/marvell/mvxpbm.c:1.4
--- src/sys/dev/marvell/mvxpbm.c:1.3	Sun Dec  5 03:04:41 2021
+++ src/sys/dev/marvell/mvxpbm.c	Thu Feb  8 20:51:24 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvxpbm.c,v 1.3 2021/12/05 

CVS commit: src

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 20:51:25 UTC 2024

Modified Files:
src/common/lib/libc/arch/arm/string: strcpy_arm.S
src/sbin/blkdiscard: blkdiscard.c
src/share/doc/papers/pulldown: 0.t
src/sys/arch/powerpc/include: psl.h
src/sys/dev/marvell: mvxpbm.c
src/sys/dev/pci: cs4280.c cs4280reg.h
src/sys/fs/nfs/client: nfs_clrpcops.c
src/usr.sbin/inetd: parse_v2.c
src/usr.sbin/sysinst: disklabel.c gpt.c mbr.c

Log Message:
fix misplaced or missing "e" in words with "ment" ending (argument, implement,
increment, decrement, alignment), in comments, documentation, log messages.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/arm/string/strcpy_arm.S
cvs rdiff -u -r1.3 -r1.4 src/sbin/blkdiscard/blkdiscard.c
cvs rdiff -u -r1.1 -r1.2 src/share/doc/papers/pulldown/0.t
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/powerpc/include/psl.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/marvell/mvxpbm.c
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/pci/cs4280.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/cs4280reg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/fs/nfs/client/nfs_clrpcops.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/inetd/parse_v2.c
cvs rdiff -u -r1.51 -r1.52 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/sysinst/mbr.c

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



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

2024-02-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  8 20:45:20 UTC 2024

Modified Files:
src/usr.bin/xlint/lint1: cgram.y decl.c emit1.c func.c init.c lex.c
tree.c

Log Message:
lint: clean up redundant braces

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.488 -r1.489 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.391 -r1.392 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.180 -r1.181 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.258 -r1.259 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.215 -r1.216 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.603 -r1.604 src/usr.bin/xlint/lint1/tree.c

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



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

2024-02-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  8 20:45:20 UTC 2024

Modified Files:
src/usr.bin/xlint/lint1: cgram.y decl.c emit1.c func.c init.c lex.c
tree.c

Log Message:
lint: clean up redundant braces

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.488 -r1.489 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.391 -r1.392 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.180 -r1.181 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.258 -r1.259 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.215 -r1.216 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.603 -r1.604 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.488 src/usr.bin/xlint/lint1/cgram.y:1.489
--- src/usr.bin/xlint/lint1/cgram.y:1.488	Thu Feb  8 19:32:12 2024
+++ src/usr.bin/xlint/lint1/cgram.y	Thu Feb  8 20:45:20 2024
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.488 2024/02/08 19:32:12 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.489 2024/02/08 20:45:20 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: cgram.y,v 1.488 2024/02/08 19:32:12 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.489 2024/02/08 20:45:20 rillig Exp $");
 #endif
 
 #include 
@@ -431,13 +431,12 @@ is_either(const char *s, const char *a, 
 program:
 	/* empty */ {
 		/* TODO: Make this an error in C99 mode as well. */
-		if (!allow_trad && !allow_c99) {
+		if (!allow_trad && !allow_c99)
 			/* empty translation unit */
 			error(272);
-		} else if (allow_c90) {
+		else if (allow_c90)
 			/* empty translation unit */
 			warning(272);
-		}
 	}
 |	translation_unit
 ;
@@ -464,10 +463,9 @@ identifier:
 string:
 	T_STRING
 |	string T_STRING {
-		if (!allow_c90) {
+		if (!allow_c90)
 			/* concatenated strings are illegal in traditional C */
 			warning(219);
-		}
 		$$ = cat_strings($1, $2);
 	}
 ;
@@ -670,10 +668,9 @@ unary_expression:
 		$$ = build_unary(INDIR, $2, $3);
 	}
 |	T_ADDITIVE sys cast_expression {
-		if (!allow_c90 && $1 == PLUS) {
+		if (!allow_c90 && $1 == PLUS)
 			/* unary '+' is illegal in traditional C */
 			warning(100);
-		}
 		$$ = build_unary($1 == PLUS ? UPLUS : UMINUS, $2, $3);
 	}
 |	T_COMPLEMENT sys cast_expression {
@@ -815,31 +812,28 @@ declaration_or_error:
 /* K ???, C90 ???, C99 6.7, C11 ???, C23 6.7 */
 declaration:
 	begin_type_declmods end_type T_SEMI {
-		if (dcs->d_scl == TYPEDEF) {
+		if (dcs->d_scl == TYPEDEF)
 			/* typedef declares no type name */
 			warning(72);
-		} else {
+		else
 			/* empty declaration */
 			warning(2);
-		}
 	}
 |	begin_type_declmods end_type notype_init_declarators T_SEMI {
-		if (dcs->d_scl == TYPEDEF) {
+		if (dcs->d_scl == TYPEDEF)
 			/* syntax error '%s' */
 			error(249, "missing base type for typedef");
-		} else {
+		else
 			/* old-style declaration; add 'int' */
 			error(1);
-		}
 	}
 |	begin_type_declaration_specifiers end_type T_SEMI {
-		if (dcs->d_scl == TYPEDEF) {
+		if (dcs->d_scl == TYPEDEF)
 			/* typedef declares no type name */
 			warning(72);
-		} else if (!dcs->d_nonempty_decl) {
+		else if (!dcs->d_nonempty_decl)
 			/* empty declaration */
 			warning(2);
-		}
 	}
 |	begin_type_declaration_specifiers end_type
 	type_init_declarators T_SEMI
@@ -1196,13 +1190,12 @@ enum_declaration:		/* helper for C99 6.7
 enums_with_opt_comma:		/* helper for C99 6.7.2.2 */
 	enumerator_list
 |	enumerator_list T_COMMA {
-		if (!allow_c99 && !allow_trad) {
+		if (!allow_c99 && !allow_trad)
 			/* trailing ',' in enum declaration requires C99 ... */
 			error(54);
-		} else {
+		else
 			/* trailing ',' in enum declaration requires C99 ... */
 			c99ism(54);
-		}
 		$$ = $1;
 	}
 ;
@@ -1575,13 +1568,12 @@ vararg_parameter_type_list:	/* specific 
 	}
 |	T_ELLIPSIS {
 		/* TODO: C99 6.7.5 makes this an error as well. */
-		if (!allow_trad && !allow_c99) {
+		if (!allow_trad && !allow_c99)
 			/* C90 to C17 require formal parameter before '...' */
 			error(84);
-		} else if (allow_c90) {
+		else if (allow_c90)
 			/* C90 to C17 require formal parameter before '...' */
 			warning(84);
-		}
 		$$ = (struct parameter_list){ .vararg = true };
 	}
 ;
@@ -2042,13 +2034,12 @@ external_declaration:		/* C99 6.9 */
 		 * TODO: Only allow this in GCC mode, not in plain C99.
 		 * This is one of the top 10 warnings in the NetBSD build.
 		 */
-		if (!allow_trad && !allow_c99) {
+		if (!allow_trad && !allow_c99)
 			/* empty declaration */
 			error(0);
-		} else if (allow_c90) {
+		else if (allow_c90)
 			/* empty declaration */
 			warning(0);
-		}
 	}
 ;
 
@@ -2064,13 +2055,12 @@ external_declaration:		/* C99 6.9 */
 top_level_declaration:		/* C99 6.9 calls this 'declaration' */
 	begin_type 

CVS commit: src/sys

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 20:30:40 UTC 2024

Modified Files:
src/sys/arch/ews4800mips/include: sbd_tr2.h sbd_tr2a.h
src/sys/dev/pci: auixp.c

Log Message:
s/inlucde/include/, s/implemetation/implementation/ in comments and error msg.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ews4800mips/include/sbd_tr2.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ews4800mips/include/sbd_tr2a.h
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/pci/auixp.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/ews4800mips/include/sbd_tr2.h
diff -u src/sys/arch/ews4800mips/include/sbd_tr2.h:1.3 src/sys/arch/ews4800mips/include/sbd_tr2.h:1.4
--- src/sys/arch/ews4800mips/include/sbd_tr2.h:1.3	Wed Aug 21 04:51:41 2019
+++ src/sys/arch/ews4800mips/include/sbd_tr2.h	Thu Feb  8 20:30:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbd_tr2.h,v 1.3 2019/08/21 04:51:41 msaitoh Exp $	*/
+/*	$NetBSD: sbd_tr2.h,v 1.4 2024/02/08 20:30:39 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #ifndef _SBD_TR2_PRIVATE
-#error "Don't inlucde this file except for TR2 implemetation"
+#error "Don't include this file except for TR2 implementation"
 #endif /* !_SBD_TR2_PRIVATE */
 
 #ifndef _EWS4800MIPS_SBD_TR2_H_

Index: src/sys/arch/ews4800mips/include/sbd_tr2a.h
diff -u src/sys/arch/ews4800mips/include/sbd_tr2a.h:1.2 src/sys/arch/ews4800mips/include/sbd_tr2a.h:1.3
--- src/sys/arch/ews4800mips/include/sbd_tr2a.h:1.2	Mon Apr 28 20:23:18 2008
+++ src/sys/arch/ews4800mips/include/sbd_tr2a.h	Thu Feb  8 20:30:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbd_tr2a.h,v 1.2 2008/04/28 20:23:18 martin Exp $	*/
+/*	$NetBSD: sbd_tr2a.h,v 1.3 2024/02/08 20:30:39 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #ifndef _SBD_TR2A_PRIVATE
-#error "Don't inlucde this file except for TR2A implemetation"
+#error "Don't include this file except for TR2A implementation"
 #endif /* !_SBD_TR2A_PRIVATE */
 
 #ifndef _EWS4800MIPS_SBD_TR2A_H_

Index: src/sys/dev/pci/auixp.c
diff -u src/sys/dev/pci/auixp.c:1.54 src/sys/dev/pci/auixp.c:1.55
--- src/sys/dev/pci/auixp.c:1.54	Sat Aug 27 05:35:17 2022
+++ src/sys/dev/pci/auixp.c	Thu Feb  8 20:30:39 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: auixp.c,v 1.54 2022/08/27 05:35:17 skrll Exp $ */
+/* $NetBSD: auixp.c,v 1.55 2024/02/08 20:30:39 andvar Exp $ */
 
 /*
  * Copyright (c) 2004, 2005 Reinoud Zandijk 
@@ -38,12 +38,12 @@
  *   codec support problem.
  * - 32 bit recording works but can't try out playing: see above.
  * - no suspend/resume support yet.
- * - multiple codecs are `supported' but not tested; the implemetation needs
+ * - multiple codecs are `supported' but not tested; the implementation needs
  *   some cleaning up.
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auixp.c,v 1.54 2022/08/27 05:35:17 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auixp.c,v 1.55 2024/02/08 20:30:39 andvar Exp $");
 
 #include 
 #include 



CVS commit: src/sys

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 20:30:40 UTC 2024

Modified Files:
src/sys/arch/ews4800mips/include: sbd_tr2.h sbd_tr2a.h
src/sys/dev/pci: auixp.c

Log Message:
s/inlucde/include/, s/implemetation/implementation/ in comments and error msg.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ews4800mips/include/sbd_tr2.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ews4800mips/include/sbd_tr2a.h
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/pci/auixp.c

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



CVS commit: src

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 20:11:56 UTC 2024

Modified Files:
src/share/man/man7: sticky.7
src/sys/arch/algor/pci: pcib.c
src/sys/arch/evbmips/malta/pci: pcib.c
src/sys/arch/m68k/include: intr.h mmu_51.h
src/sys/dev/ic: aic79xxvar.h aic7xxxvar.h
src/sys/dev/mii: mii.c
src/usr.bin/elf2ecoff: elf2ecoff.c

Log Message:
s/sharable/shareable in comments and documentation.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man7/sticky.7
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/algor/pci/pcib.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbmips/malta/pci/pcib.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/m68k/include/intr.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/m68k/include/mmu_51.h
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/ic/aic79xxvar.h
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/ic/aic7xxxvar.h
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/mii/mii.c
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/elf2ecoff/elf2ecoff.c

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



CVS commit: src

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 20:11:56 UTC 2024

Modified Files:
src/share/man/man7: sticky.7
src/sys/arch/algor/pci: pcib.c
src/sys/arch/evbmips/malta/pci: pcib.c
src/sys/arch/m68k/include: intr.h mmu_51.h
src/sys/dev/ic: aic79xxvar.h aic7xxxvar.h
src/sys/dev/mii: mii.c
src/usr.bin/elf2ecoff: elf2ecoff.c

Log Message:
s/sharable/shareable in comments and documentation.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man7/sticky.7
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/algor/pci/pcib.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbmips/malta/pci/pcib.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/m68k/include/intr.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/m68k/include/mmu_51.h
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/ic/aic79xxvar.h
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/ic/aic7xxxvar.h
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/mii/mii.c
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/elf2ecoff/elf2ecoff.c

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

Modified files:

Index: src/share/man/man7/sticky.7
diff -u src/share/man/man7/sticky.7:1.6 src/share/man/man7/sticky.7:1.7
--- src/share/man/man7/sticky.7:1.6	Tue May 10 17:00:44 2011
+++ src/share/man/man7/sticky.7	Thu Feb  8 20:11:55 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sticky.7,v 1.6 2011/05/10 17:00:44 jruoho Exp $
+.\"	$NetBSD: sticky.7,v 1.7 2024/02/08 20:11:55 andvar Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -73,10 +73,10 @@ for details about modifying file modes.
 .Sh HISTORY
 The sticky bit first appeared in V7, and this manual page appeared
 in section 8.
-Its initial use was to mark sharable executables
+Its initial use was to mark shareable executables
 that were frequently used so that they would stay in swap after
 the process exited.
-Sharable executables were compiled in a special way so their text
+Shareable executables were compiled in a special way so their text
 and read-only data could be shared amongst processes.
 .Xr vi 1
 and

Index: src/sys/arch/algor/pci/pcib.c
diff -u src/sys/arch/algor/pci/pcib.c:1.28 src/sys/arch/algor/pci/pcib.c:1.29
--- src/sys/arch/algor/pci/pcib.c:1.28	Sat Aug  7 16:18:40 2021
+++ src/sys/arch/algor/pci/pcib.c	Thu Feb  8 20:11:55 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcib.c,v 1.28 2021/08/07 16:18:40 thorpej Exp $	*/
+/*	$NetBSD: pcib.c,v 1.29 2024/02/08 20:11:55 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.28 2021/08/07 16:18:40 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.29 2024/02/08 20:11:55 andvar Exp $");
 
 #include "opt_algor_p5064.h" 
 #include "opt_algor_p6032.h"
@@ -540,7 +540,7 @@ pcib_isa_intr_alloc(void *v, int mask, i
 			if (type != sc->sc_intrtab[i].intr_type)
 continue;
 			/*
-			 * If the IRQ is sharable, count the number of
+			 * If the IRQ is shareable, count the number of
 			 * other handlers, and if it's smaller than the
 			 * last IRQ like this, remember it.
 			 */
@@ -555,7 +555,7 @@ pcib_isa_intr_alloc(void *v, int mask, i
 			break;
 
 		case IST_PULSE:
-			/* This just isn't sharable. */
+			/* This just isn't shareable. */
 			continue;
 		}
 	}

Index: src/sys/arch/evbmips/malta/pci/pcib.c
diff -u src/sys/arch/evbmips/malta/pci/pcib.c:1.24 src/sys/arch/evbmips/malta/pci/pcib.c:1.25
--- src/sys/arch/evbmips/malta/pci/pcib.c:1.24	Sat Jan 22 15:10:31 2022
+++ src/sys/arch/evbmips/malta/pci/pcib.c	Thu Feb  8 20:11:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcib.c,v 1.24 2022/01/22 15:10:31 skrll Exp $	*/
+/*	$NetBSD: pcib.c,v 1.25 2024/02/08 20:11:56 andvar Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.24 2022/01/22 15:10:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.25 2024/02/08 20:11:56 andvar Exp $");
 
 #include 
 #include 
@@ -585,7 +585,7 @@ pcib_isa_intr_alloc(void *v, int mask, i
 			if (type != my_sc->sc_intrtab[i].intr_type)
 continue;
 			/*
-			 * If the IRQ is sharable, count the number of
+			 * If the IRQ is shareable, count the number of
 			 * other handlers, and if it's smaller than the
 			 * last IRQ like this, remember it.
 			 */
@@ -600,7 +600,7 @@ pcib_isa_intr_alloc(void *v, int mask, i
 			break;
 
 		case IST_PULSE:
-		/* This just isn't sharable. */
+		/* This just isn't shareable. */
 		continue;
 		}
 	}

Index: src/sys/arch/m68k/include/intr.h
diff -u src/sys/arch/m68k/include/intr.h:1.8 src/sys/arch/m68k/include/intr.h:1.9
--- src/sys/arch/m68k/include/intr.h:1.8	Fri Jan 19 20:55:42 2024
+++ src/sys/arch/m68k/include/intr.h	Thu Feb  8 20:11:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.8 2024/01/19 20:55:42 thorpej Exp $	*/
+/*	$NetBSD: intr.h,v 1.9 

CVS commit: src/sys

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 19:44:09 UTC 2024

Modified Files:
src/sys/arch/bebox/stand/boot: siop.c
src/sys/arch/prep/stand/boot: siop.c
src/sys/dev/ic: esiop.c siop.c siop_common.c
src/sys/dev/iscsi: iscsi_text.c
src/sys/dev/mii: amhphy.c

Log Message:
s/should't/shouldn't/ and s/mistmatch/mismatch/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/bebox/stand/boot/siop.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/prep/stand/boot/siop.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/ic/esiop.c
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/ic/siop.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/ic/siop_common.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/iscsi/iscsi_text.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/mii/amhphy.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/bebox/stand/boot/siop.c
diff -u src/sys/arch/bebox/stand/boot/siop.c:1.14 src/sys/arch/bebox/stand/boot/siop.c:1.15
--- src/sys/arch/bebox/stand/boot/siop.c:1.14	Mon Jun 19 08:40:29 2023
+++ src/sys/arch/bebox/stand/boot/siop.c	Thu Feb  8 19:44:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: siop.c,v 1.14 2023/06/19 08:40:29 msaitoh Exp $	*/
+/*	$NetBSD: siop.c,v 1.15 2024/02/08 19:44:08 andvar Exp $	*/
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -465,7 +465,7 @@ reset:
 		}
 		return 1;
 	}
-	/* We just should't get there */
+	/* We just shouldn't get there */
 	panic("siop_intr: I shouldn't be there !");
 
 	return 1;

Index: src/sys/arch/prep/stand/boot/siop.c
diff -u src/sys/arch/prep/stand/boot/siop.c:1.7 src/sys/arch/prep/stand/boot/siop.c:1.8
--- src/sys/arch/prep/stand/boot/siop.c:1.7	Mon Jun 19 08:40:30 2023
+++ src/sys/arch/prep/stand/boot/siop.c	Thu Feb  8 19:44:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: siop.c,v 1.7 2023/06/19 08:40:30 msaitoh Exp $	*/
+/*	$NetBSD: siop.c,v 1.8 2024/02/08 19:44:08 andvar Exp $	*/
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -444,7 +444,7 @@ reset:
 		}
 		return 1;
 	}
-	/* We just should't get there */
+	/* We just shouldn't get there */
 	panic("siop_intr: I shouldn't be there !");
 
 	return 1;

Index: src/sys/dev/ic/esiop.c
diff -u src/sys/dev/ic/esiop.c:1.62 src/sys/dev/ic/esiop.c:1.63
--- src/sys/dev/ic/esiop.c:1.62	Wed Nov  2 12:03:44 2022
+++ src/sys/dev/ic/esiop.c	Thu Feb  8 19:44:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: esiop.c,v 1.62 2022/11/02 12:03:44 andvar Exp $	*/
+/*	$NetBSD: esiop.c,v 1.63 2024/02/08 19:44:08 andvar Exp $	*/
 
 /*
  * Copyright (c) 2002 Manuel Bouyer.
@@ -28,7 +28,7 @@
 /* SYM53c7/8xx PCI-SCSI I/O Processors driver */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: esiop.c,v 1.62 2022/11/02 12:03:44 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esiop.c,v 1.63 2024/02/08 19:44:08 andvar Exp $");
 
 #include 
 #include 
@@ -1101,7 +1101,7 @@ scintr:
 		return 1;
 	}
 	/*
-	 * We just should't get there, but on some KVM virtual hosts,
+	 * We just shouldn't get there, but on some KVM virtual hosts,
 	 * we do - see PR 48277.
 	 */
 	printf("esiop_intr: I shouldn't be there !\n");

Index: src/sys/dev/ic/siop.c
diff -u src/sys/dev/ic/siop.c:1.104 src/sys/dev/ic/siop.c:1.105
--- src/sys/dev/ic/siop.c:1.104	Wed Nov  2 12:03:44 2022
+++ src/sys/dev/ic/siop.c	Thu Feb  8 19:44:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: siop.c,v 1.104 2022/11/02 12:03:44 andvar Exp $	*/
+/*	$NetBSD: siop.c,v 1.105 2024/02/08 19:44:08 andvar Exp $	*/
 
 /*
  * Copyright (c) 2000 Manuel Bouyer.
@@ -28,7 +28,7 @@
 /* SYM53c7/8xx PCI-SCSI I/O Processors driver */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siop.c,v 1.104 2022/11/02 12:03:44 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siop.c,v 1.105 2024/02/08 19:44:08 andvar Exp $");
 
 #include 
 #include 
@@ -969,7 +969,7 @@ scintr:
 		return 1;
 	}
 	/*
-	 * We just should't get there, but on some KVM virtual hosts,
+	 * We just shouldn't get there, but on some KVM virtual hosts,
 	 * we do - see PR 48277.
 	 */
 	printf("siop_intr: I shouldn't be there !\n");

Index: src/sys/dev/ic/siop_common.c
diff -u src/sys/dev/ic/siop_common.c:1.59 src/sys/dev/ic/siop_common.c:1.60
--- src/sys/dev/ic/siop_common.c:1.59	Sun Sep 25 18:43:32 2022
+++ src/sys/dev/ic/siop_common.c	Thu Feb  8 19:44:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: siop_common.c,v 1.59 2022/09/25 18:43:32 thorpej Exp $	*/
+/*	$NetBSD: siop_common.c,v 1.60 2024/02/08 19:44:08 andvar Exp $	*/
 
 /*
  * Copyright (c) 2000, 2002 Manuel Bouyer.
@@ -28,7 +28,7 @@
 /* SYM53c7/8xx PCI-SCSI I/O Processors driver */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siop_common.c,v 1.59 2022/09/25 18:43:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siop_common.c,v 1.60 2024/02/08 19:44:08 andvar Exp $");
 
 #include 
 #include 
@@ -434,7 +434,7 @@ siop_ppr_neg(struct siop_common_cmd *sio
 		offset = tables->msg_in[5];
 		options = tables->msg_in[7];
 		if (options != MSG_EXT_PPR_DT) {
-			

CVS commit: src/sys

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 19:44:09 UTC 2024

Modified Files:
src/sys/arch/bebox/stand/boot: siop.c
src/sys/arch/prep/stand/boot: siop.c
src/sys/dev/ic: esiop.c siop.c siop_common.c
src/sys/dev/iscsi: iscsi_text.c
src/sys/dev/mii: amhphy.c

Log Message:
s/should't/shouldn't/ and s/mistmatch/mismatch/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/bebox/stand/boot/siop.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/prep/stand/boot/siop.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/ic/esiop.c
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/ic/siop.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/ic/siop_common.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/iscsi/iscsi_text.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/mii/amhphy.c

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



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

2024-02-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  8 19:32:12 UTC 2024

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

Log Message:
lint: clean up comments, add debug output for Bison


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

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

Modified files:

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.487 src/usr.bin/xlint/lint1/cgram.y:1.488
--- src/usr.bin/xlint/lint1/cgram.y:1.487	Mon Feb  5 23:11:22 2024
+++ src/usr.bin/xlint/lint1/cgram.y	Thu Feb  8 19:32:12 2024
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.487 2024/02/05 23:11:22 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.488 2024/02/08 19:32:12 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: cgram.y,v 1.487 2024/02/05 23:11:22 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.488 2024/02/08 19:32:12 rillig Exp $");
 #endif
 
 #include 
@@ -85,18 +85,6 @@ clear_warning_flags_loc(const char *file
 static void
 save_warning_flags_loc(const char *file, size_t line)
 {
-	/*
-	 * There used to be an assertion that saved_lwarn is
-	 * LWARN_NOTHING_SAVED here, but that triggered for the following
-	 * code:
-	 *
-	 * void function(int x) { if (x > 0) if (x > 1) return; }
-	 *
-	 * It didn't trigger if the inner 'if' was enclosed in braces though.
-	 *
-	 * TODO: If actually needed, add support for nested suppression of
-	 *  warnings.
-	 */
 	debug_step("%s:%zu: saving flags %d", file, line, lwarn);
 	saved_lwarn = lwarn;
 }
@@ -108,10 +96,6 @@ restore_warning_flags_loc(const char *fi
 	if (saved_lwarn != LWARN_NOTHING_SAVED) {
 		lwarn = saved_lwarn;
 		debug_step("%s:%zu: restoring flags %d", file, line, lwarn);
-		/*
-		 * Do not set 'saved_lwarn = LWARN_NOTHING_SAVED' here, to
-		 * avoid triggering the assertion in save_warning_flags_loc.
-		 */
 	} else
 		clear_warning_flags_loc(file, line);
 }
@@ -179,6 +163,12 @@ is_either(const char *s, const char *a, 
 %printer {
 	fprintf(yyo, "%s", function_specifier_name($$));
 } 
+%printer {
+	size_t n = 0;
+	for (const sym_t *p = $$.first; p != NULL; p = p->s_next)
+		n++;
+	fprintf(yyo, "%zu parameter%s", n, n != 1 ? "s" : "");
+} 
 %printer { fprintf(yyo, "%s", type_name($$)); } 
 %printer {
 	if ($$ == NULL)
@@ -196,6 +186,19 @@ is_either(const char *s, const char *a, 
 %printer { fprintf(yyo, "%s", type_name($$->ga_arg)); } 
 %printer { fprintf(yyo, "%d", $$.dim); } 
 %printer { fprintf(yyo, "%s", $$ ? "yes" : "no"); } 
+%printer {
+	if ($$.dn_len == 0)
+		fprintf(yyo, "(empty)");
+	for (size_t i = 0; i < $$.dn_len; i++) {
+		const designator *dr = $$.dn_items + i;
+		if (dr->dr_kind == DK_MEMBER)
+			fprintf(yyo, ".%s", dr->dr_member->s_name);
+		else if (dr->dr_kind == DK_SUBSCRIPT)
+			fprintf(yyo, "[%zu]", dr->dr_subscript);
+		else
+			fprintf(yyo, "");
+	}
+} 
 */
 
 %token			T_LBRACE T_RBRACE T_LBRACK T_RBRACK T_LPAREN T_RPAREN
@@ -1042,7 +1045,7 @@ braced_member_declaration_list:	/* see C
 member_declaration_list_with_rbrace:	/* see C99 6.7.2.1 */
 	member_declaration_list T_RBRACE
 |	T_RBRACE {
-		/* XXX: This is not allowed by any C standard. */
+		/* XXX: Allowed since C23. */
 		$$ = NULL;
 	}
 ;



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

2024-02-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  8 19:32:12 UTC 2024

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

Log Message:
lint: clean up comments, add debug output for Bison


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

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



CVS commit: src/sys/arch/acorn32/stand/lib

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  8 19:28:42 UTC 2024

Modified Files:
src/sys/arch/acorn32/stand/lib: newvers_rm.sh

Log Message:
PR/57912: Jan-Benedict Glaw: Use repro epoch for generating date string


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/acorn32/stand/lib/newvers_rm.sh

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/acorn32/stand/lib/newvers_rm.sh
diff -u src/sys/arch/acorn32/stand/lib/newvers_rm.sh:1.2 src/sys/arch/acorn32/stand/lib/newvers_rm.sh:1.3
--- src/sys/arch/acorn32/stand/lib/newvers_rm.sh:1.2	Wed Apr 30 09:10:59 2008
+++ src/sys/arch/acorn32/stand/lib/newvers_rm.sh	Thu Feb  8 14:28:42 2024
@@ -1,6 +1,6 @@
 #! /bin/sh -
 #
-# $NetBSD: newvers_rm.sh,v 1.2 2008/04/30 13:10:59 martin Exp $
+# $NetBSD: newvers_rm.sh,v 1.3 2024/02/08 19:28:42 christos Exp $
 #
 # Copyright (c) 2000 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -37,10 +37,17 @@
 
 set -e
 
-r=`awk -F: '$1 ~ /^[0-9.]*$/ { it = $1; } END { print it }' $1`
-r=`echo $r | sed 's/\.\([0-9]\)$/.0\1/'`
+r=$(awk -F: '$1 ~ /^[0-9.]*$/ { it = $1; } END { print it }' $1)
+r=$(echo $r | sed 's/\.\([0-9]\)$/.0\1/')
 
-t=`date +"%d %b %Y"`
+
+if [ -n "$MKREPRO_TIMESTAMP" ]; then
+	# Try NetBSD date, fall back to GNU date.
+	t=$(date -u -r "$MKREPRO_TIMESTAMP" '+%d %b %Y' 2> /dev/null || \
+	date -u -d "@$MKREPRO_TIMESTAMP" '+%d %b %Y')
+else
+   t=$(date +"%d %b %Y")
+fi
 
 echo "const char rmhelp[] = \"$2\\t${r} (${t})\";" > rmvers.c
 



CVS commit: src/sys/arch/acorn32/stand/lib

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  8 19:28:42 UTC 2024

Modified Files:
src/sys/arch/acorn32/stand/lib: newvers_rm.sh

Log Message:
PR/57912: Jan-Benedict Glaw: Use repro epoch for generating date string


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/acorn32/stand/lib/newvers_rm.sh

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



CVS commit: src

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  8 19:24:43 UTC 2024

Modified Files:
src/distrib/hppa/sysnbsd: Makefile
src/sys/arch/hppa/stand/mkboot: mkboot.c

Log Message:
PR/57911: Jan-Benedict Glaw: Allow to set repro timestamp (and use it)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/hppa/sysnbsd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/stand/mkboot/mkboot.c

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

Modified files:

Index: src/distrib/hppa/sysnbsd/Makefile
diff -u src/distrib/hppa/sysnbsd/Makefile:1.1 src/distrib/hppa/sysnbsd/Makefile:1.2
--- src/distrib/hppa/sysnbsd/Makefile:1.1	Mon Feb 24 02:23:39 2014
+++ src/distrib/hppa/sysnbsd/Makefile	Thu Feb  8 14:24:43 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2014/02/24 07:23:39 skrll Exp $
+#	$NetBSD: Makefile,v 1.2 2024/02/08 19:24:43 christos Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -10,8 +10,12 @@ MKBOOT = ${TOOLDIR}/bin/${_TOOL_PREFIX}h
 KERN=	${KERNOBJDIR}/GENERIC/netbsd
 LIF=	SYSNBSD
 
+.if ${MKREPRO_TIMESTAMP:Uno} != "no"
+MKBOOT_TIMESTAMP=-t "${MKREPRO_TIMESTAMP}"
+.endif
+
 release: check_RELEASEDIR 
-	${MKBOOT} ${DESTDIR}/usr/mdec/boot ${KERN} ${.OBJDIR}/${LIF}
+	${MKBOOT} ${MKBOOT_TIMESTAMP} ${DESTDIR}/usr/mdec/boot ${KERN} ${.OBJDIR}/${LIF}
 	${RELEASE_INSTALL} ${.OBJDIR}/${LIF} \
 	${RELEASEDIR}/${RELEASEMACHINEDIR}/installation
 

Index: src/sys/arch/hppa/stand/mkboot/mkboot.c
diff -u src/sys/arch/hppa/stand/mkboot/mkboot.c:1.2 src/sys/arch/hppa/stand/mkboot/mkboot.c:1.3
--- src/sys/arch/hppa/stand/mkboot/mkboot.c:1.2	Thu Jan 21 12:00:23 2016
+++ src/sys/arch/hppa/stand/mkboot/mkboot.c	Thu Feb  8 14:24:43 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkboot.c,v 1.2 2016/01/21 17:00:23 christos Exp $	*/
+/*	$NetBSD: mkboot.c,v 1.3 2024/02/08 19:24:43 christos Exp $	*/
 
 /*	$OpenBSD: mkboot.c,v 1.9 2001/05/17 00:57:55 pvalchev Exp $	*/
 
@@ -115,6 +115,7 @@ int cksum(int, int *, int);
 char *to_file;
 int loadpoint, verbose;
 u_long entry;
+time_t repro_epoch = 0;
 
 /*
  * Old Format:
@@ -140,14 +141,17 @@ main(int argc, char **argv)
 	struct hppa_lifvol *lifv = (struct hppa_lifvol *)buf;
 	struct hppa_lifdir *lifd = (struct hppa_lifdir *)(buf + HPPA_LIF_DIRSTART);
 
-	while ((c = getopt(argc, argv, "vl:")) != -1) {
+	while ((c = getopt(argc, argv, "l:t:v")) != -1) {
 		switch (c) {
+		case 'l':
+			loadpoint = strtol(optarg, NULL, 0);
+			break;
+		case 't':
+			repro_epoch = atoll(optarg);
+			break;
 		case 'v':
 			verbose++;
 			break;
-		case 'l':
-			sscanf(optarg, "0x%x", );
-			break;
 		default:
 			usage();
 		}
@@ -374,8 +378,8 @@ void __dead
 usage(void)
 {
 	fprintf(stderr,
-		"usage: %s [-v] [-l loadpoint] prog1 {progN} outfile\n",
-		getprogname());
+	"Usage: %s [-v] [-l ] [-t ] prog1 {progN} outfile\n",
+	getprogname());
 	exit(1);
 }
 
@@ -411,6 +415,12 @@ bcddate(char *file, char *toc)
 	struct stat statb;
 	struct tm *tm;
 
+	if (repro_epoch)
+		tm = gmtime(_epoch);
+	else {
+		stat(file, );
+		tm = localtime(_ctime);
+	}
 	stat(file, );
 	tm = localtime(_ctime);
 	tm->tm_year %= 100;



CVS commit: src

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  8 19:24:43 UTC 2024

Modified Files:
src/distrib/hppa/sysnbsd: Makefile
src/sys/arch/hppa/stand/mkboot: mkboot.c

Log Message:
PR/57911: Jan-Benedict Glaw: Allow to set repro timestamp (and use it)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/hppa/sysnbsd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/stand/mkboot/mkboot.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/riscv/riscv

2024-02-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Feb  8 18:25:58 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: bus_dma.c

Log Message:
Define _RISCV_NEED_BUS_DMA_BOUNCE.

Pointed out as being needed by jmcneill. Thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/riscv/bus_dma.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/riscv/riscv

2024-02-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Feb  8 18:25:58 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: bus_dma.c

Log Message:
Define _RISCV_NEED_BUS_DMA_BOUNCE.

Pointed out as being needed by jmcneill. Thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/riscv/bus_dma.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/riscv/riscv/bus_dma.c
diff -u src/sys/arch/riscv/riscv/bus_dma.c:1.1 src/sys/arch/riscv/riscv/bus_dma.c:1.2
--- src/sys/arch/riscv/riscv/bus_dma.c:1.1	Sun May  7 12:41:48 2023
+++ src/sys/arch/riscv/riscv/bus_dma.c	Thu Feb  8 18:25:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.1 2023/05/07 12:41:48 skrll Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.2 2024/02/08 18:25:58 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2020 The NetBSD Foundation, Inc.
@@ -31,9 +31,10 @@
  */
 
 #define _RISCV_BUS_DMA_PRIVATE
+#define _RISCV_NEED_BUS_DMA_BOUNCE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.1 2023/05/07 12:41:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.2 2024/02/08 18:25:58 skrll Exp $");
 
 #include 
 



CVS commit: src/distrib/common/bootimage

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  8 18:14:02 UTC 2024

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
PR/57910: Jan-Benedict Glaw: Fix typo preventing reproducible builds


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/distrib/common/bootimage/Makefile.bootimage

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

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.32 src/distrib/common/bootimage/Makefile.bootimage:1.33
--- src/distrib/common/bootimage/Makefile.bootimage:1.32	Sun Dec  3 02:20:23 2023
+++ src/distrib/common/bootimage/Makefile.bootimage	Thu Feb  8 13:14:02 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.32 2023/12/03 07:20:23 tsutsui Exp $
+#	$NetBSD: Makefile.bootimage,v 1.33 2024/02/08 18:14:02 christos Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -235,8 +235,8 @@ FSCYLINDERS!=	expr ${FSSECTORS} / \( ${H
 SWAPCYLINDERS!=	expr ${SWAPSECTORS} / \( ${HEADS} \* ${SECTORS} \) || true
 
 .if ${USE_GPT} != "no"
-BOOTDISK_UUID=`${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKMBR} show -i 2 | ${TOOL_AWK} '/^GUID/ {print $$2}'`
-SWAPDISK_UUID=`${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKMBR} show -i 3 | ${TOOL_AWK} '/^GUID/ {print $$2}'`
+BOOTDISK_UUID=`${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKMBR} show -i 2 | ${TOOL_AWK} '/^GUID/ {print $$2}'`
+SWAPDISK_UUID=`${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKMBR} show -i 3 | ${TOOL_AWK} '/^GUID/ {print $$2}'`
 .endif
 
 #
@@ -525,11 +525,11 @@ ${WORKMBR}:
 	@echo creating GPT header and partition entries...
 	${RM} -f ${WORKMBR}
 	${DD} if=/dev/zero of=${WORKMBR} seek=$$((${IMAGESECTORS} - 1)) count=1
-	${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKMBR} create
-	${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKMBR} add -a 1m -s ${EFISECTORS} -t efi -l "EFI system"
-	${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKMBR} add -a 1m -s ${FSSECTORS} -t ffs
+	${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKMBR} create
+	${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKMBR} add -a 1m -s ${EFISECTORS} -t efi -l "EFI system"
+	${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKMBR} add -a 1m -s ${FSSECTORS} -t ffs
 .  if ${SWAPSECTORS} != 0
-	${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKMBR} add -a 1m -s ${SWAPSECTORS} -t swap
+	${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKMBR} add -a 1m -s ${SWAPSECTORS} -t swap
 .  endif
 .elif ${USE_MBR} != "no"
 	@echo creating MBR labels...
@@ -584,10 +584,10 @@ ${IMGBASE}.img:	${TARGET_BLOCKS}
 	${CAT} ${TARGET_BLOCKS} > ${WORKIMG}
 .if ${USE_GPT} != "no"
 .if ${USE_GPTMBR} != "no"
-	${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKIMG} biosboot -i 2		\
+	${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKIMG} biosboot -i 2		\
 	-c ${.OBJDIR}/${WORKDIR}/usr/mdec/gptmbr.bin
 .endif
-	${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKIMG} set -a bootme -i 2
+	${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKIMG} set -a bootme -i 2
 .endif	# USE_GPT != "no"
 .if ${USE_SUNLABEL} != "no"
 	@echo Creating sun disklabel...



CVS commit: src/distrib/common/bootimage

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  8 18:14:02 UTC 2024

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
PR/57910: Jan-Benedict Glaw: Fix typo preventing reproducible builds


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/distrib/common/bootimage/Makefile.bootimage

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



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

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  8 18:10:34 UTC 2024

Modified Files:
src/sys/arch/hp300/stand: Makefile.buildboot
src/sys/arch/hp300/stand/mkboot: mkboot.c

Log Message:
PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/hp300/stand/Makefile.buildboot
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp300/stand/mkboot/mkboot.c

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

Modified files:

Index: src/sys/arch/hp300/stand/Makefile.buildboot
diff -u src/sys/arch/hp300/stand/Makefile.buildboot:1.37 src/sys/arch/hp300/stand/Makefile.buildboot:1.38
--- src/sys/arch/hp300/stand/Makefile.buildboot:1.37	Fri Jul  9 13:44:28 2021
+++ src/sys/arch/hp300/stand/Makefile.buildboot	Thu Feb  8 13:10:34 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.buildboot,v 1.37 2021/07/09 17:44:28 tsutsui Exp $
+#	$NetBSD: Makefile.buildboot,v 1.38 2024/02/08 18:10:34 christos Exp $
 
 # RELOC=FFF0 allows for boot prog up to FF000 (1044480) bytes long
 RELOC=	FFF0
@@ -29,9 +29,13 @@ LIBC=
 LIBCRTBEGIN=
 LIBCRTEND=
 
+.if ${MKREPRO_TIMESTAMP:Uno} != "no"
+HP300MKBOOT_TIMESTAMP=-t "${MKREPRO_TIMESTAMP}"
+.endif
+
 ${PROG}: ${PROGAOUT}
 	${OBJCOPY} --output-target=binary ${PROGAOUT} ${PROGAOUT}.bin
-	${TOOL_HP300MKBOOT} -l 0x${RELOC} ${PROGAOUT}.bin ${PROG}
+	${TOOL_HP300MKBOOT} -l 0x${RELOC} ${HP300MKBOOT_TIMESTAMP} ${PROGAOUT}.bin ${PROG}
 	rm -f ${PROGAOUT}.bin
 
 .include "${S}/conf/newvers_stand.mk"

Index: src/sys/arch/hp300/stand/mkboot/mkboot.c
diff -u src/sys/arch/hp300/stand/mkboot/mkboot.c:1.11 src/sys/arch/hp300/stand/mkboot/mkboot.c:1.12
--- src/sys/arch/hp300/stand/mkboot/mkboot.c:1.11	Sat Oct 11 01:33:25 2014
+++ src/sys/arch/hp300/stand/mkboot/mkboot.c	Thu Feb  8 13:10:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkboot.c,v 1.11 2014/10/11 05:33:25 dholland Exp $	*/
+/*	$NetBSD: mkboot.c,v 1.12 2024/02/08 18:10:34 christos Exp $	*/
 
 /*
  * Copyright (c) 1990, 1993
@@ -47,7 +47,7 @@ __COPYRIGHT(
 #ifdef notdef
 static char sccsid[] = "@(#)mkboot.c	7.2 (Berkeley) 12/16/90";
 #endif
-__RCSID("$NetBSD: mkboot.c,v 1.11 2014/10/11 05:33:25 dholland Exp $");
+__RCSID("$NetBSD: mkboot.c,v 1.12 2024/02/08 18:10:34 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -60,6 +60,7 @@ __RCSID("$NetBSD: mkboot.c,v 1.11 2014/1
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -78,11 +79,11 @@ __RCSID("$NetBSD: mkboot.c,v 1.11 2014/1
 #define btolifs(b)	(((b) + (SECTSIZE - 1)) / SECTSIZE)
 #define lifstob(s)	((s) * SECTSIZE)
 
-int	lpflag;
-int	loadpoint;
+int	loadpoint = -1;
 struct  load ld;
 struct	lifvol lifv;
 struct	lifdir lifd[LIF_NUMDIR];
+time_t repro_epoch = 0;
 
 int	 main(int, char **);
 void	 bcddate(char *, char *);
@@ -110,24 +111,25 @@ int
 main(int argc, char **argv)
 {
 	char *n1, *n2, *n3;
-	int n, to;
+	int n, to, ch;
 	int count;
 
-	--argc;
-	++argv;
-	if (argc == 0)
-		usage();
-	if (!strcmp(argv[0], "-l")) {
-		argv++;
-		argc--;
-		if (argc == 0)
+
+	while ((ch = getopt(argc, argv, "l:t:")) != -1)
+		switch (ch) {
+		case 'l':
+			loadpoint = strtol(optarg, NULL, 0);
+			break;
+		case 't':
+			repro_epoch = (time_t)atoll(optarg);
+			break;
+		default:
 			usage();
-		sscanf(argv[0], "0x%x", );
-		lpflag++;
-		argv++;
-		argc--;
-	}
-	if (!lpflag || argc == 0)
+		}
+
+	argc -= optind;
+	argv += optind;
+	if (loadpoint == -1 || argc == 0)
 		usage();
 	n1 = argv[0];
 	argv++;
@@ -147,11 +149,8 @@ main(int argc, char **argv)
 	} else
 		n2 = n3 = NULL;
 
-	to = open(argv[0], O_WRONLY | O_TRUNC | O_CREAT, 0644);
-	if (to < 0) {
-		perror("open");
-		exit(1);
-	}
+	if ((to = open(argv[0], O_WRONLY | O_TRUNC | O_CREAT, 0644)) == -1)
+		err(1, "Can't open `%s'", argv[0]);
 	/* clear possibly unused directory entries */
 	strncpy(lifd[1].dir_name, "  ", 10);
 	lifd[1].dir_type = htobe16(-1);
@@ -250,8 +249,7 @@ void
 usage(void)
 {
 
-	fprintf(stderr,
-		"usage:	 mkboot -l loadpoint prog1 [ prog2 ] outfile\n");
+	fprintf(stderr, "Usage:	%s -l ] prog1 [ prog2 ] outfile\n", getprogname());
 	exit(1);
 }
 



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

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  8 18:10:34 UTC 2024

Modified Files:
src/sys/arch/hp300/stand: Makefile.buildboot
src/sys/arch/hp300/stand/mkboot: mkboot.c

Log Message:
PR/57909: Jan-Benedict Glaw: Don't include (build) timestamp when doing a
reproducible build


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/hp300/stand/Makefile.buildboot
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp300/stand/mkboot/mkboot.c

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



CVS commit: src

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  8 17:57:54 UTC 2024

Modified Files:
src/distrib/bebox/floppies/bootfloppy-common: Makefile.inc
src/sys/arch/powerpc/stand/mkbootimage: mkbootimage.c

Log Message:
PR/57906: Jan-Benedict Glaw: Extend`mkbootimage` to allow for
$MKREPRO_TIMESTAMP usage


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/distrib/bebox/floppies/bootfloppy-common/Makefile.inc
cvs rdiff -u -r1.19 -r1.20 \
src/sys/arch/powerpc/stand/mkbootimage/mkbootimage.c

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

Modified files:

Index: src/distrib/bebox/floppies/bootfloppy-common/Makefile.inc
diff -u src/distrib/bebox/floppies/bootfloppy-common/Makefile.inc:1.13 src/distrib/bebox/floppies/bootfloppy-common/Makefile.inc:1.14
--- src/distrib/bebox/floppies/bootfloppy-common/Makefile.inc:1.13	Sun Oct 17 07:19:53 2010
+++ src/distrib/bebox/floppies/bootfloppy-common/Makefile.inc	Thu Feb  8 12:57:54 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.13 2010/10/17 11:19:53 kiyohara Exp $
+#	$NetBSD: Makefile.inc,v 1.14 2024/02/08 17:57:54 christos Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -9,8 +9,13 @@
 MDEC?=		${DESTDIR}/usr/mdec
 BOOTLOADER?=	${MDEC}/boot
 
+.if ${MKREPRO_TIMESTAMP:Uno} != "no"
+MKBOOTIMAGE_TIMESTAMP=-t "${MKREPRO_TIMESTAMP}"
+.endif
+
+
 ${IMAGE}:
-	${TOOL_POWERPCMKBOOTIMAGE} -I -m ${MACHINE} -b ${BOOTLOADER} ${.TARGET}
+	${TOOL_POWERPCMKBOOTIMAGE} -I -m ${MACHINE} -b ${BOOTLOADER} ${MKBOOTIMAGE_TIMESTAMP} ${.TARGET}
 
 KFILES=	${IMAGE}
 

Index: src/sys/arch/powerpc/stand/mkbootimage/mkbootimage.c
diff -u src/sys/arch/powerpc/stand/mkbootimage/mkbootimage.c:1.19 src/sys/arch/powerpc/stand/mkbootimage/mkbootimage.c:1.20
--- src/sys/arch/powerpc/stand/mkbootimage/mkbootimage.c:1.19	Thu Jan 21 12:14:05 2016
+++ src/sys/arch/powerpc/stand/mkbootimage/mkbootimage.c	Thu Feb  8 12:57:54 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkbootimage.c,v 1.19 2016/01/21 17:14:05 christos Exp $	*/
+/*	$NetBSD: mkbootimage.c,v 1.20 2024/02/08 17:57:54 christos Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -105,9 +105,7 @@ static void usage(int);
 static int open_file(const char *, char *, Elf32_External_Ehdr *,
 struct stat *);
 static void check_mbr(int, char *);
-static int prep_build_image(char *, char *, char *, char *);
 static void rs6000_build_records(int);
-static int rs6000_build_image(char *, char *, char *, char *);
 int main(int, char **);
 
 
@@ -127,10 +125,10 @@ usage(int extended)
 	}
 #ifdef USE_SYSCTL
 	fprintf(stderr, "usage: %s [-Ilsv] [-m machine] [-b bootfile] "
-	"[-k kernel] [-r rawdev] bootimage\n", getprogname());
+	"[-k kernel] [-r rawdev] [-t epoch] bootimage\n", getprogname());
 #else
 	fprintf(stderr, "usage: %s [-Ilsv] -m machine [-b bootfile] "
-	"[-k kernel] [-r rawdev] bootimage\n", getprogname());
+	"[-k kernel] [-r rawdev] [-t epoch]  bootimage\n", getprogname());
 #endif
 	exit(1);
 }
@@ -163,7 +161,7 @@ open_file(const char *ftype, char *file,
 	if (ELFGET16(hdr->e_machine) != EM_PPC)
 		errx(3, "input '%s' is not PowerPC exec binary", file);
 
-	return(fd);
+	return fd;
 }
 
 static void
@@ -680,7 +678,7 @@ bebox_write_header(int bebox_fd, int elf
 }
 
 static int
-bebox_build_image(char *kernel, char *boot, char *rawdev, char *outname)
+bebox_build_image(char *kernel, char *boot, char *rawdev, char *outname, char *repro_timestamp)
 {
 	unsigned char *elf_img = NULL, *kern_img = NULL, *header_img = NULL;
 	int i, ch, tmp, kgzlen, err, hsize = BEBOX_HEADER_SIZE;
@@ -822,7 +820,11 @@ bebox_build_image(char *kernel, char *bo
 	*(int32_t *)(header_img + BEBOX_FILE_SIZE_ALIGN_OFFSET) =
 	(int32_t)sa_htobe32(roundup(tmp, BEBOX_FILE_BLOCK_SIZE));
 
-	gettimeofday(, 0);
+	if (repro_timestamp) {
+		tp.tv_sec = (time_t)atoll(repro_timestamp);
+		tp.tv_usec = 0;
+	} else
+		gettimeofday(, 0);
 	for (offset = bebox_mtime_offset; *offset != -1; offset++)
 		*(int32_t *)(header_img + *offset) =
 		(int32_t)sa_htobe32(tp.tv_sec);
@@ -848,6 +850,7 @@ main(int argc, char **argv)
 	int ch, lfloppyflag=0;
 	char *kernel = NULL, *boot = NULL, *rawdev = NULL, *outname = NULL;
 	char *march = NULL;
+	char *repro_timestamp = NULL;
 #ifdef USE_SYSCTL
 	char machine[SYS_NMLN];
 	int mib[2] = { CTL_HW, HW_MACHINE };
@@ -856,7 +859,7 @@ main(int argc, char **argv)
 	setprogname(argv[0]);
 	kern_len = 0;
 
-	while ((ch = getopt(argc, argv, "b:Ik:lm:r:sv")) != -1)
+	while ((ch = getopt(argc, argv, "b:Ik:lm:r:st:v")) != -1)
 		switch (ch) {
 		case 'b':
 			boot = optarg;
@@ -880,6 +883,9 @@ main(int argc, char **argv)
 		case 's':
 			saloneflag = 1;
 			break;
+		case 't':
+			repro_timestamp = optarg;
+			break;
 		case 'v':
 			verboseflag = 1;
 			break;
@@ -924,12 +930,13 @@ main(int argc, char **argv)
 	outname = argv[0];
 
 	if (strcmp(march, "prep") == 0)
-		

CVS commit: src

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  8 17:57:54 UTC 2024

Modified Files:
src/distrib/bebox/floppies/bootfloppy-common: Makefile.inc
src/sys/arch/powerpc/stand/mkbootimage: mkbootimage.c

Log Message:
PR/57906: Jan-Benedict Glaw: Extend`mkbootimage` to allow for
$MKREPRO_TIMESTAMP usage


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/distrib/bebox/floppies/bootfloppy-common/Makefile.inc
cvs rdiff -u -r1.19 -r1.20 \
src/sys/arch/powerpc/stand/mkbootimage/mkbootimage.c

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



CVS commit: src/sys

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 11:31:00 UTC 2024

Modified Files:
src/sys/arch/arm/imx: imxusbreg.h
src/sys/arch/arm/xilinx: zynq_usbreg.h
src/sys/dev/isa: if_ec.c

Log Message:
s/transeiver/transceiver/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/imxusbreg.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/xilinx/zynq_usbreg.h
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/isa/if_ec.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/arm/imx/imxusbreg.h
diff -u src/sys/arch/arm/imx/imxusbreg.h:1.5 src/sys/arch/arm/imx/imxusbreg.h:1.6
--- src/sys/arch/arm/imx/imxusbreg.h:1.5	Tue May 17 06:44:46 2016
+++ src/sys/arch/arm/imx/imxusbreg.h	Thu Feb  8 11:31:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: imxusbreg.h,v 1.5 2016/05/17 06:44:46 ryo Exp $	*/
+/*	$NetBSD: imxusbreg.h,v 1.6 2024/02/08 11:31:00 andvar Exp $	*/
 /*
  * Copyright (c) 2009, 2010  Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -101,7 +101,7 @@
 #define	PORTSC_PTS_SERIAL	__SHIFTIN(3,PORTSC_PTS)
 #define	PORTSC_PTS2		__BIT(25)	/* iMX6,7 */
 
-#define	PORTSC_STS	__BIT(29)	/* serial transeiver select */
+#define	PORTSC_STS	__BIT(29)	/* serial transceiver select */
 #define	PORTSC_PTW	__BIT(28)	/* parallel transceiver width */
 #define	PORTSC_PTW_8	0
 #define	PORTSC_PTW_16	PORTSC_PTW

Index: src/sys/arch/arm/xilinx/zynq_usbreg.h
diff -u src/sys/arch/arm/xilinx/zynq_usbreg.h:1.1 src/sys/arch/arm/xilinx/zynq_usbreg.h:1.2
--- src/sys/arch/arm/xilinx/zynq_usbreg.h:1.1	Tue Jun 11 13:01:48 2019
+++ src/sys/arch/arm/xilinx/zynq_usbreg.h	Thu Feb  8 11:31:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: zynq_usbreg.h,v 1.1 2019/06/11 13:01:48 skrll Exp $	*/
+/*	$NetBSD: zynq_usbreg.h,v 1.2 2024/02/08 11:31:00 andvar Exp $	*/
 /*-
  * Copyright (c) 2015  Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -101,7 +101,7 @@
 #define	PORTSC_PTS_PHILIPS	__SHIFTIN(1, PORTSC_PTS)
 #define	PORTSC_PTS_ULPI		__SHIFTIN(2, PORTSC_PTS)
 #define	PORTSC_PTS_SERIAL	__SHIFTIN(3, PORTSC_PTS)
-#define	PORTSC_STS		__BIT(29)	/* serial transeiver select */
+#define	PORTSC_STS		__BIT(29)	/* serial transceiver select */
 #define	PORTSC_PTW		__BIT(28)	/* parallel transceiver width */
 #define	PORTSC_PTW_8		0
 #define	PORTSC_PTW_16		PORTSC_PTW

Index: src/sys/dev/isa/if_ec.c
diff -u src/sys/dev/isa/if_ec.c:1.36 src/sys/dev/isa/if_ec.c:1.37
--- src/sys/dev/isa/if_ec.c:1.36	Wed May 29 06:21:57 2019
+++ src/sys/dev/isa/if_ec.c	Thu Feb  8 11:31:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ec.c,v 1.36 2019/05/29 06:21:57 msaitoh Exp $	*/
+/*	$NetBSD: if_ec.c,v 1.37 2024/02/08 11:31:00 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.36 2019/05/29 06:21:57 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.37 2024/02/08 11:31:00 andvar Exp $");
 
 #include 
 #include 
@@ -303,7 +303,7 @@ ec_attach(device_t parent, device_t self
 	/* Now we can use the NIC_{GET,PUT}() macros. */
 
 	/*
-	 * Reset NIC and ASIC.  Enable on-board transeiver throughout
+	 * Reset NIC and ASIC.  Enable on-board transceiver throughout
 	 * reset sequence since it will lock up if the cable isn't
 	 * connected if we don't.
 	 */



CVS commit: src/sys

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 11:31:00 UTC 2024

Modified Files:
src/sys/arch/arm/imx: imxusbreg.h
src/sys/arch/arm/xilinx: zynq_usbreg.h
src/sys/dev/isa: if_ec.c

Log Message:
s/transeiver/transceiver/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/imxusbreg.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/xilinx/zynq_usbreg.h
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/isa/if_ec.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/evbsh3/nextvod

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 10:30:26 UTC 2024

Modified Files:
src/sys/arch/evbsh3/nextvod: stasc.c

Log Message:
s/Reciever/Receiver/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbsh3/nextvod/stasc.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/evbsh3/nextvod/stasc.c
diff -u src/sys/arch/evbsh3/nextvod/stasc.c:1.2 src/sys/arch/evbsh3/nextvod/stasc.c:1.3
--- src/sys/arch/evbsh3/nextvod/stasc.c:1.2	Mon Jul 20 01:06:33 2020
+++ src/sys/arch/evbsh3/nextvod/stasc.c	Thu Feb  8 10:30:25 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: stasc.c,v 1.2 2020/07/20 01:06:33 uwe Exp $ */
+/* $NetBSD: stasc.c,v 1.3 2024/02/08 10:30:25 andvar Exp $ */
 /*
  * Copyright (c) 2020 Valery Ushakov
  * All rights reserved.
@@ -28,7 +28,7 @@
  * STMicroelectronics ST40 Asynchronous Serial Controller
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: stasc.c,v 1.2 2020/07/20 01:06:33 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: stasc.c,v 1.3 2024/02/08 10:30:25 andvar Exp $");
 
 #include 
 #include 
@@ -101,7 +101,7 @@ __KERNEL_RCSID(0, "$NetBSD: stasc.c,v 1.
 #define ASC_INT_STA_PE		0x0008 /* Rx: Parity Error */
 #define	ASC_INT_STA_THE		0x0004 /* Tx: Transmitter FIFO Half Empty */
 #define ASC_INT_STA_TE		0x0002 /* Tx: Transmitter Empty */
-#define ASC_INT_STA_RBF		0x0001 /* Rx: Reciever Buffer Full */
+#define ASC_INT_STA_RBF		0x0001 /* Rx: Receiver Buffer Full */
 
 
 



CVS commit: src/sys/arch/evbsh3/nextvod

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 10:30:26 UTC 2024

Modified Files:
src/sys/arch/evbsh3/nextvod: stasc.c

Log Message:
s/Reciever/Receiver/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbsh3/nextvod/stasc.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

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 10:05:01 UTC 2024

Modified Files:
src/sys/dev/acpi: acpidevs_data.h

Log Message:
Regen with typo fixed.

Regeneration script doesn't seem to react to description changes only, thus
regenerated it twice by changing device name locally and putting it back
to original value.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/acpi/acpidevs_data.h

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

Modified files:

Index: src/sys/dev/acpi/acpidevs_data.h
diff -u src/sys/dev/acpi/acpidevs_data.h:1.26 src/sys/dev/acpi/acpidevs_data.h:1.27
--- src/sys/dev/acpi/acpidevs_data.h:1.26	Wed Jun 22 19:26:36 2011
+++ src/sys/dev/acpi/acpidevs_data.h	Thu Feb  8 10:05:01 2024
@@ -1,10 +1,10 @@
-/*	$NetBSD: acpidevs_data.h,v 1.26 2011/06/22 19:26:36 jruoho Exp $	*/
+/*	$NetBSD: acpidevs_data.h,v 1.27 2024/02/08 10:05:01 andvar Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	# NetBSD: acpidevs,v 1.35 2011/06/22 19:26:22 jruoho Exp
+ *	# NetBSD: acpidevs,v 1.36 2019/05/28 08:59:34 msaitoh Exp
  */
 
 const struct { const char *pnp, *str; } acpi_knowndevs[] = {
@@ -1434,7 +1434,7 @@ const struct { const char *pnp, *str; } 
 	},
 	{
 	"ENE0100",
-	"KB3924-based CIR Port Reciever",
+	"KB3924-based CIR Port Receiver",
 	},
 	{
 	"HPQ0004",



CVS commit: src/sys/dev/acpi

2024-02-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  8 10:05:01 UTC 2024

Modified Files:
src/sys/dev/acpi: acpidevs_data.h

Log Message:
Regen with typo fixed.

Regeneration script doesn't seem to react to description changes only, thus
regenerated it twice by changing device name locally and putting it back
to original value.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/acpi/acpidevs_data.h

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



CVS commit: src/sys/dev/pci/igc

2024-02-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  8 09:59:35 UTC 2024

Modified Files:
src/sys/dev/pci/igc: if_igc.c

Log Message:
igc: Add missing igc_check_for_link() call.

 It's required to set the collision distance, configure flow control
from the negotiated result and set the LTR thresholds.
With this change, ifconfig igcN show the flow control status correctly.


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

2024-02-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  8 09:59:35 UTC 2024

Modified Files:
src/sys/dev/pci/igc: if_igc.c

Log Message:
igc: Add missing igc_check_for_link() call.

 It's required to set the collision distance, configure flow control
from the negotiated result and set the LTR thresholds.
With this change, ifconfig igcN show the flow control status correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/igc/if_igc.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/igc/if_igc.c
diff -u src/sys/dev/pci/igc/if_igc.c:1.10 src/sys/dev/pci/igc/if_igc.c:1.11
--- src/sys/dev/pci/igc/if_igc.c:1.10	Thu Jan 25 05:48:56 2024
+++ src/sys/dev/pci/igc/if_igc.c	Thu Feb  8 09:59:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_igc.c,v 1.10 2024/01/25 05:48:56 msaitoh Exp $	*/
+/*	$NetBSD: if_igc.c,v 1.11 2024/02/08 09:59:35 msaitoh Exp $	*/
 /*	$OpenBSD: if_igc.c,v 1.13 2023/04/28 10:18:57 bluhm Exp $	*/
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_igc.c,v 1.10 2024/01/25 05:48:56 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_igc.c,v 1.11 2024/02/08 09:59:35 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_igc.h"
@@ -2548,6 +2548,9 @@ igc_update_link_status(struct igc_softc 
 	struct ifnet *ifp = >sc_ec.ec_if;
 	struct igc_hw *hw = >hw;
 
+	if (hw->mac.get_link_status == true)
+		igc_check_for_link(hw);
+
 	if (IGC_READ_REG(>hw, IGC_STATUS) & IGC_STATUS_LU) {
 		if (sc->link_active == 0) {
 			igc_get_speed_and_duplex(hw, >link_speed,