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

2021-07-26 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jul 27 05:52:53 UTC 2021

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

Log Message:
lint: inline align_as in the grammar

This saves 500 bytes in the resulting binary.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.350 -r1.351 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.350 src/usr.bin/xlint/lint1/cgram.y:1.351
--- src/usr.bin/xlint/lint1/cgram.y:1.350	Tue Jul 27 05:42:36 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Tue Jul 27 05:52:53 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.350 2021/07/27 05:42:36 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.351 2021/07/27 05:52:53 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.350 2021/07/27 05:42:36 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.351 2021/07/27 05:52:53 rillig Exp $");
 #endif
 
 #include 
@@ -836,19 +836,14 @@ type_attribute_opt:
 
 type_attribute:			/* See C11 6.7 declaration-specifiers */
 	  gcc_attribute
-	  /* TODO: c11ism */
-	| T_ALIGNAS T_LPAREN align_as T_RPAREN
+	| T_ALIGNAS T_LPAREN type_specifier T_RPAREN	/* C11 6.7.5 */
+	| T_ALIGNAS T_LPAREN constant_expr T_RPAREN	/* C11 6.7.5 */
 	| T_PACKED {
 		addpacked();
 	  }
 	| T_NORETURN
 	;
 
-align_as:			/* See alignment-specifier in C11 6.7.5 */
-	  type_specifier
-	| constant_expr
-	;
-
 begin_type:
 	  /* empty */ {
 		begin_type();



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

2021-07-26 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jul 27 05:42:36 UTC 2021

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

Log Message:
lint: provide a direct link to the documentation

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.349 -r1.350 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.349 src/usr.bin/xlint/lint1/cgram.y:1.350
--- src/usr.bin/xlint/lint1/cgram.y:1.349	Mon Jul 26 18:10:14 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Tue Jul 27 05:42:36 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.349 2021/07/26 18:10:14 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.350 2021/07/27 05:42:36 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.349 2021/07/26 18:10:14 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.350 2021/07/27 05:42:36 rillig Exp $");
 #endif
 
 #include 
@@ -1154,8 +1154,8 @@ type_qualifier_list:		/* C99 6.7.5 */
 	;
 
 /*
- * For an explanation of 'notype' in the following rules, see the Bison
- * manual, section 7.1 "Semantic Info in Token Kinds".
+ * For an explanation of 'notype' in the following rules, see
+ * https://www.gnu.org/software/bison/manual/bison.html#Semantic-Tokens.
  */
 
 notype_init_declarators:



CVS commit: src/sys/dev/raidframe

2021-07-26 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Tue Jul 27 03:09:27 UTC 2021

Modified Files:
src/sys/dev/raidframe: rf_cvscan.c rf_cvscan.h

Log Message:
Missed cleaning up this "peek" routines the other day.  Take care of it now.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/raidframe/rf_cvscan.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/raidframe/rf_cvscan.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/raidframe/rf_cvscan.c
diff -u src/sys/dev/raidframe/rf_cvscan.c:1.17 src/sys/dev/raidframe/rf_cvscan.c:1.18
--- src/sys/dev/raidframe/rf_cvscan.c:1.17	Sat Feb  9 03:33:59 2019
+++ src/sys/dev/raidframe/rf_cvscan.c	Tue Jul 27 03:09:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_cvscan.c,v 1.17 2019/02/09 03:33:59 christos Exp $	*/
+/*	$NetBSD: rf_cvscan.c,v 1.18 2021/07/27 03:09:26 oster Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -35,7 +35,7 @@
  **/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_cvscan.c,v 1.17 2019/02/09 03:33:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_cvscan.c,v 1.18 2021/07/27 03:09:26 oster Exp $");
 
 #include 
 #include "rf_alloclist.h"
@@ -272,44 +272,6 @@ rf_CvscanDequeue(void *q_in)
 	return (ret);
 }
 
-
-
-RF_DiskQueueData_t *
-rf_CvscanPeek(void *q_in)
-{
-	RF_CvscanHeader_t *hdr = (RF_CvscanHeader_t *) q_in;
-	longrange, i, sum_dist_left, sum_dist_right;
-	RF_DiskQueueData_t *tmp, *headElement;
-
-	DO_CHECK_STATE(hdr);
-
-	if (hdr->left_cnt == 0 && hdr->right_cnt == 0)
-		headElement = NULL;
-	else {
-		range = RF_MIN(hdr->range_for_avg, RF_MIN(hdr->left_cnt, hdr->right_cnt));
-		for (i = 0, tmp = hdr->left, sum_dist_left =
-		((hdr->direction == rf_cvscan_RIGHT) ? range * hdr->change_penalty : 0);
-		tmp != NULL && i < range;
-		tmp = tmp->next, i++) {
-			sum_dist_left += hdr->cur_block - tmp->sectorOffset;
-		}
-		for (i = 0, tmp = hdr->right, sum_dist_right =
-		((hdr->direction == rf_cvscan_LEFT) ? range * hdr->change_penalty : 0);
-		tmp != NULL && i < range;
-		tmp = tmp->next, i++) {
-			sum_dist_right += tmp->sectorOffset - hdr->cur_block;
-		}
-
-		if (hdr->right_cnt == 0 || sum_dist_left < sum_dist_right)
-			headElement = hdr->left;
-		else
-			headElement = hdr->right;
-	}
-	return (headElement);
-}
-
-
-
 /*
 ** CVSCAN( 1, 0 ) is Shortest Seek Time First (SSTF)
 **lowest average response time

Index: src/sys/dev/raidframe/rf_cvscan.h
diff -u src/sys/dev/raidframe/rf_cvscan.h:1.6 src/sys/dev/raidframe/rf_cvscan.h:1.7
--- src/sys/dev/raidframe/rf_cvscan.h:1.6	Sun Dec 11 12:23:37 2005
+++ src/sys/dev/raidframe/rf_cvscan.h	Tue Jul 27 03:09:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_cvscan.h,v 1.6 2005/12/11 12:23:37 christos Exp $	*/
+/*	$NetBSD: rf_cvscan.h,v 1.7 2021/07/27 03:09:26 oster Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -75,7 +75,6 @@ rf_CvscanCreate(RF_SectorCount_t sect_pe
 RF_AllocListElem_t * cl_list, RF_ShutdownList_t ** listp);
 voidrf_CvscanEnqueue(void *qptr, RF_DiskQueueData_t * req, int priority);
 RF_DiskQueueData_t *rf_CvscanDequeue(void *qptr);
-RF_DiskQueueData_t *rf_CvscanPeek(void *qptr);
 int
 rf_CvscanPromote(void *qptr, RF_StripeNum_t parityStripeID,
 RF_ReconUnitNum_t which_ru);



CVS commit: src/sys/dev/raidframe

2021-07-26 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Tue Jul 27 03:01:48 UTC 2021

Modified Files:
src/sys/dev/raidframe: rf_copyback.c rf_dagfuncs.c rf_diskqueue.c
rf_diskqueue.h rf_reconstruct.c

Log Message:
rf_CreateDiskQueueData() no longer uses waitflag, and will always succeed.
Cleanup the error path for the (no longer needed) PR_NOWAIT cases.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/raidframe/rf_copyback.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/raidframe/rf_dagfuncs.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/raidframe/rf_diskqueue.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/raidframe/rf_diskqueue.h
cvs rdiff -u -r1.126 -r1.127 src/sys/dev/raidframe/rf_reconstruct.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/raidframe/rf_copyback.c
diff -u src/sys/dev/raidframe/rf_copyback.c:1.54 src/sys/dev/raidframe/rf_copyback.c:1.55
--- src/sys/dev/raidframe/rf_copyback.c:1.54	Fri Jul 23 00:54:45 2021
+++ src/sys/dev/raidframe/rf_copyback.c	Tue Jul 27 03:01:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_copyback.c,v 1.54 2021/07/23 00:54:45 oster Exp $	*/
+/*	$NetBSD: rf_copyback.c,v 1.55 2021/07/27 03:01:48 oster Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -38,7 +38,7 @@
  /
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.54 2021/07/23 00:54:45 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.55 2021/07/27 03:01:48 oster Exp $");
 
 #include 
 
@@ -335,12 +335,10 @@ rf_CopybackOne(RF_CopybackDesc_t *desc, 
 	/* create reqs to read the old location & write the new */
 	desc->readreq = rf_CreateDiskQueueData(RF_IO_TYPE_READ, spOffs,
 	sectPerSU, desc->databuf, 0L, 0, rf_CopybackReadDoneProc, desc,
-	NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL,
-	PR_WAITOK);
+	NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL);
 	desc->writereq = rf_CreateDiskQueueData(RF_IO_TYPE_WRITE, testOffs,
 	sectPerSU, desc->databuf, 0L, 0, rf_CopybackWriteDoneProc, desc,
-	NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL,
-	PR_WAITOK);
+	NULL, (void *) raidPtr, RF_DISKQUEUE_DATA_FLAGS_NONE, NULL);
 	desc->fcol = testCol;
 
 	/* enqueue the read.  the write will go out as part of the callback on

Index: src/sys/dev/raidframe/rf_dagfuncs.c
diff -u src/sys/dev/raidframe/rf_dagfuncs.c:1.32 src/sys/dev/raidframe/rf_dagfuncs.c:1.33
--- src/sys/dev/raidframe/rf_dagfuncs.c:1.32	Fri Jun 19 19:29:39 2020
+++ src/sys/dev/raidframe/rf_dagfuncs.c	Tue Jul 27 03:01:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_dagfuncs.c,v 1.32 2020/06/19 19:29:39 jdolecek Exp $	*/
+/*	$NetBSD: rf_dagfuncs.c,v 1.33 2021/07/27 03:01:48 oster Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_dagfuncs.c,v 1.32 2020/06/19 19:29:39 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagfuncs.c,v 1.33 2021/07/27 03:01:48 oster Exp $");
 
 #include 
 #include 
@@ -280,13 +280,10 @@ rf_DiskReadFuncForThreads(RF_DagNode_t *
 #else
  NULL,
 #endif
-	(void *) (node->dagHdr->raidPtr), 0, node->dagHdr->bp, PR_NOWAIT);
-	if (!req) {
-		(node->wakeFunc) (node, ENOMEM);
-	} else {
-		node->dagFuncData = (void *) req;
-		rf_DiskIOEnqueue(&(dqs[pda->col]), req, priority);
-	}
+	(void *) (node->dagHdr->raidPtr), 0, node->dagHdr->bp);
+
+	node->dagFuncData = (void *) req;
+	rf_DiskIOEnqueue(&(dqs[pda->col]), req, priority);
 }
 
 
@@ -314,14 +311,10 @@ rf_DiskWriteFuncForThreads(RF_DagNode_t 
 	NULL,
 #endif
 	(void *) (node->dagHdr->raidPtr),
-	0, node->dagHdr->bp, PR_NOWAIT);
+	0, node->dagHdr->bp);
 
-	if (!req) {
-		(node->wakeFunc) (node, ENOMEM);
-	} else {
-		node->dagFuncData = (void *) req;
-		rf_DiskIOEnqueue(&(dqs[pda->col]), req, priority);
-	}
+	node->dagFuncData = (void *) req;
+	rf_DiskIOEnqueue(&(dqs[pda->col]), req, priority);
 }
 /*
  * the undo function for disk nodes
@@ -343,13 +336,10 @@ rf_DiskUndoFunc(RF_DagNode_t *node)
 	 NULL,
 #endif
 	(void *) (node->dagHdr->raidPtr),
-	0, NULL, PR_NOWAIT);
-	if (!req)
-		(node->wakeFunc) (node, ENOMEM);
-	else {
-		node->dagFuncData = (void *) req;
-		rf_DiskIOEnqueue(&(dqs[pda->col]), req, RF_IO_NORMAL_PRIORITY);
-	}
+	0, NULL);
+
+	node->dagFuncData = (void *) req;
+	rf_DiskIOEnqueue(&(dqs[pda->col]), req, RF_IO_NORMAL_PRIORITY);
 }
 
 /*

Index: src/sys/dev/raidframe/rf_diskqueue.c
diff -u src/sys/dev/raidframe/rf_diskqueue.c:1.61 src/sys/dev/raidframe/rf_diskqueue.c:1.62
--- src/sys/dev/raidframe/rf_diskqueue.c:1.61	Fri Jul 23 20:18:24 2021
+++ 

CVS commit: src/sys/dev/eisa

2021-07-26 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jul 27 01:18:04 UTC 2021

Modified Files:
src/sys/dev/eisa: ahb.c

Log Message:
- Remove unused  include.
- Rename ahb_ecb_phys_kv() to ahb_ecb_lookup().
- Remove a bogus comment.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/eisa/ahb.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/eisa/ahb.c
diff -u src/sys/dev/eisa/ahb.c:1.68 src/sys/dev/eisa/ahb.c:1.69
--- src/sys/dev/eisa/ahb.c:1.68	Mon Jul 26 16:45:56 2021
+++ src/sys/dev/eisa/ahb.c	Tue Jul 27 01:18:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahb.c,v 1.68 2021/07/26 16:45:56 thorpej Exp $	*/
+/*	$NetBSD: ahb.c,v 1.69 2021/07/27 01:18:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahb.c,v 1.68 2021/07/26 16:45:56 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahb.c,v 1.69 2021/07/27 01:18:04 thorpej Exp $");
 
 #include "opt_ddb.h"
 
@@ -58,7 +58,6 @@ __KERNEL_RCSID(0, "$NetBSD: ahb.c,v 1.68
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -121,7 +120,7 @@ static void	ahb_send_immed(struct ahb_so
 static int	ahbintr(void *);
 static void	ahb_free_ecb(struct ahb_softc *, struct ahb_ecb *);
 static struct	ahb_ecb *ahb_get_ecb(struct ahb_softc *);
-static struct	ahb_ecb *ahb_ecb_phys_kv(struct ahb_softc *, uint32_t);
+static struct	ahb_ecb *ahb_ecb_lookup(struct ahb_softc *, uint32_t);
 static void	ahb_done(struct ahb_softc *, struct ahb_ecb *);
 static int	ahb_find(bus_space_tag_t, bus_space_handle_t,
 		struct ahb_probe_data *);
@@ -324,7 +323,7 @@ ahb_send_immed(struct ahb_softc *sc, u_i
 		Debugger();
 	}
 
-	bus_space_write_4(iot, ioh, MBOXOUT0, cmd);	/* don't know this will work */
+	bus_space_write_4(iot, ioh, MBOXOUT0, cmd);
 	bus_space_write_1(iot, ioh, G2CNTRL, G2CNTRL_SET_HOST_READY);
 	bus_space_write_1(iot, ioh, ATTN, OP_IMMED |
 		ecb->xs->xs_periph->periph_target);
@@ -374,7 +373,7 @@ ahbintr(void *arg)
 		case AHB_ECB_OK:
 		case AHB_ECB_RECOVERED:
 		case AHB_ECB_ERR:
-			ecb = ahb_ecb_phys_kv(sc, mboxval);
+			ecb = ahb_ecb_lookup(sc, mboxval);
 			if (!ecb) {
 aprint_error_dev(sc->sc_dev,
 "BAD ECB RETURNED!\n");
@@ -506,10 +505,10 @@ ahb_get_ecb(struct ahb_softc *sc)
 }
 
 /*
- * given a physical address, find the ecb that it corresponds to.
+ * Lookup and return the ECB that has the specified DMA address.
  */
 static struct ahb_ecb *
-ahb_ecb_phys_kv(struct ahb_softc *sc, uint32_t ecb_phys)
+ahb_ecb_lookup(struct ahb_softc *sc, uint32_t ecb_phys)
 {
 	int hashnum = ECB_HASH(ecb_phys);
 	struct ahb_ecb *ecb = sc->sc_ecbhash[hashnum];



CVS commit: src/sys/dev/raidframe

2021-07-26 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Mon Jul 26 22:50:36 UTC 2021

Modified Files:
src/sys/dev/raidframe: rf_netbsdkintf.c

Log Message:
Add support for detecting and configuring nested RAID setups at boot.


To generate a diff of this commit:
cvs rdiff -u -r1.396 -r1.397 src/sys/dev/raidframe/rf_netbsdkintf.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/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.396 src/sys/dev/raidframe/rf_netbsdkintf.c:1.397
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.396	Fri Jul 23 02:35:14 2021
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Mon Jul 26 22:50:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.396 2021/07/23 02:35:14 oster Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.397 2021/07/26 22:50:36 oster Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.396 2021/07/23 02:35:14 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.397 2021/07/26 22:50:36 oster Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_raid_autoconfig.h"
@@ -483,42 +483,56 @@ rf_containsboot(RF_Raid_t *r, device_t b
 static void
 rf_buildroothack(RF_ConfigSet_t *config_sets)
 {
+	RF_AutoConfig_t *ac_list;
 	RF_ConfigSet_t *cset;
 	RF_ConfigSet_t *next_cset;
 	int num_root;
+	int raid_added;
 	struct raid_softc *sc, *rsc;
 	struct dk_softc *dksc = NULL;	/* XXX gcc -Os: may be used uninit. */
 
 	sc = rsc = NULL;
 	num_root = 0;
-	cset = config_sets;
-	while (cset != NULL) {
-		next_cset = cset->next;
-		if (rf_have_enough_components(cset) &&
-		cset->ac->clabel->autoconfigure == 1) {
-			sc = rf_auto_config_set(cset);
-			if (sc != NULL) {
-aprint_debug("raid%d: configured ok, rootable %d\n",
-sc->sc_unit, cset->rootable);
-if (cset->rootable) {
-	rsc = sc;
-	num_root++;
+
+	raid_added = 1;
+	while (raid_added > 0) {
+		raid_added = 0;
+		cset = config_sets;
+		while (cset != NULL) {
+			next_cset = cset->next;
+			if (rf_have_enough_components(cset) &&
+			cset->ac->clabel->autoconfigure == 1) {
+sc = rf_auto_config_set(cset);
+if (sc != NULL) {
+	aprint_debug("raid%d: configured ok, rootable %d\n",
+		 sc->sc_unit, cset->rootable);
+	/* We added one RAID set */
+	raid_added++;
+	if (cset->rootable) {
+		rsc = sc;
+		num_root++;
+	}
+} else {
+	/* The autoconfig didn't work :( */
+	aprint_debug("Autoconfig failed\n");
+	rf_release_all_vps(cset);
 }
 			} else {
-/* The autoconfig didn't work :( */
-aprint_debug("Autoconfig failed\n");
+/* we're not autoconfiguring this set...
+   release the associated resources */
 rf_release_all_vps(cset);
 			}
-		} else {
-			/* we're not autoconfiguring this set...
-			   release the associated resources */
-			rf_release_all_vps(cset);
+			/* cleanup */
+			rf_cleanup_config_set(cset);
+			cset = next_cset;
+		}
+		if (raid_added > 0) {
+			/* We added at least one RAID set, so re-scan for recursive RAID */
+			ac_list = rf_find_raid_components();
+			config_sets = rf_create_auto_sets(ac_list);
 		}
-		/* cleanup */
-		rf_cleanup_config_set(cset);
-		cset = next_cset;
 	}
-
+	
 	/* if the user has specified what the root device should be
 	   then we don't touch booted_device or boothowto... */
 



CVS commit: src/sys/arch/sh3/sh3

2021-07-26 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jul 26 21:43:11 UTC 2021

Modified Files:
src/sys/arch/sh3/sh3: exception_vector.S pmap.c

Log Message:
Revert rename back to OFSET, since the name follows historical PGOFSET 
definition. Noted by tsutsui.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/sh3/sh3/exception_vector.S
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/sh3/sh3/pmap.c

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

Modified files:

Index: src/sys/arch/sh3/sh3/exception_vector.S
diff -u src/sys/arch/sh3/sh3/exception_vector.S:1.52 src/sys/arch/sh3/sh3/exception_vector.S:1.53
--- src/sys/arch/sh3/sh3/exception_vector.S:1.52	Sat Jul 24 21:31:35 2021
+++ src/sys/arch/sh3/sh3/exception_vector.S	Mon Jul 26 21:43:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: exception_vector.S,v 1.52 2021/07/24 21:31:35 andvar Exp $	*/
+/*	$NetBSD: exception_vector.S,v 1.53 2021/07/26 21:43:11 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2019 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
 #define _ALIGN_TEXT	.align 5
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: exception_vector.S,v 1.52 2021/07/24 21:31:35 andvar Exp $")
+__KERNEL_RCSID(0, "$NetBSD: exception_vector.S,v 1.53 2021/07/26 21:43:11 andvar Exp $")
 
 
 /*
@@ -220,7 +220,7 @@ NENTRY(sh3_vector_tlbmiss)
 	bt/s	.L3_call_tlb_exception
 	 mov	#-(PGSHIFT - 2), r1
 
-	!! __PMAP_PTP_OFFSET(vpn) - except we pre-shift 2 bits left to
+	!! __PMAP_PTP_OFSET(vpn) - except we pre-shift 2 bits left to
 	!! get the array offset directly, as we know bits 10 and 11
 	!! are zero (we cleaned them in r5 to get 4K aligned VPN)
 	shld	r1, r2		! vpn >> (PGSHIFT - 2)

Index: src/sys/arch/sh3/sh3/pmap.c
diff -u src/sys/arch/sh3/sh3/pmap.c:1.84 src/sys/arch/sh3/sh3/pmap.c:1.85
--- src/sys/arch/sh3/sh3/pmap.c:1.84	Sat Jul 24 21:31:35 2021
+++ src/sys/arch/sh3/sh3/pmap.c	Mon Jul 26 21:43:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.84 2021/07/24 21:31:35 andvar Exp $	*/
+/*	$NetBSD: pmap.c,v 1.85 2021/07/26 21:43:11 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.84 2021/07/24 21:31:35 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.85 2021/07/26 21:43:11 andvar Exp $");
 
 #include 
 #include 
@@ -55,7 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.8
 	(((va) + (1 << __PMAP_PTP_SHIFT) - 1) & ~((1 << __PMAP_PTP_SHIFT) - 1))
 #define	__PMAP_PTP_PG_N		(PAGE_SIZE / sizeof(pt_entry_t))
 #define	__PMAP_PTP_INDEX(va)	(((va) >> __PMAP_PTP_SHIFT) & (__PMAP_PTP_N - 1))
-#define	__PMAP_PTP_OFFSET(va)	((va >> PGSHIFT) & (__PMAP_PTP_PG_N - 1))
+#define	__PMAP_PTP_OFSET(va)	((va >> PGSHIFT) & (__PMAP_PTP_PG_N - 1))
 
 struct pmap __pmap_kernel;
 struct pmap *const kernel_pmap_ptr = &__pmap_kernel;
@@ -966,7 +966,7 @@ __pmap_pte_alloc(pmap_t pmap, vaddr_t va
 	ptp = (pt_entry_t *)SH3_PHYS_TO_P1SEG(VM_PAGE_TO_PHYS(pg));
 	pmap->pm_ptp[__PMAP_PTP_INDEX(va)] = ptp;
 
-	return (ptp + __PMAP_PTP_OFFSET(va));
+	return (ptp + __PMAP_PTP_OFSET(va));
 }
 
 /*
@@ -986,7 +986,7 @@ __pmap_pte_lookup(pmap_t pmap, vaddr_t v
 	if (ptp == NULL)
 		return (NULL);
 
-	return (ptp + __PMAP_PTP_OFFSET(va));
+	return (ptp + __PMAP_PTP_OFSET(va));
 }
 
 /*
@@ -1002,7 +1002,7 @@ __pmap_kpte_lookup(vaddr_t va)
 	if (ptp == NULL)
 		return NULL;
 
-	return (ptp + __PMAP_PTP_OFFSET(va));
+	return (ptp + __PMAP_PTP_OFSET(va));
 }
 
 /*



CVS commit: src/lib/libcurses

2021-07-26 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon Jul 26 20:17:10 UTC 2021

Modified Files:
src/lib/libcurses: curses_standout.3

Log Message:
The BUGS sections is incorrect again for "modern" terminals.

For example, wscons and xterm both display standout differently to bold.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libcurses/curses_standout.3

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

Modified files:

Index: src/lib/libcurses/curses_standout.3
diff -u src/lib/libcurses/curses_standout.3:1.7 src/lib/libcurses/curses_standout.3:1.8
--- src/lib/libcurses/curses_standout.3:1.7	Tue Nov 29 17:33:48 2016
+++ src/lib/libcurses/curses_standout.3	Mon Jul 26 20:17:09 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: curses_standout.3,v 1.7 2016/11/29 17:33:48 christos Exp $
+.\"	$NetBSD: curses_standout.3,v 1.8 2021/07/26 20:17:09 nia Exp $
 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
 .\"
@@ -25,7 +25,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 29, 2016
+.Dd July 26, 2021
 .Dt CURSES_STANDOUT 3
 .Os
 .Sh NAME
@@ -101,8 +101,3 @@ Single Unix Specification.
 .Sh HISTORY
 The Curses package appeared in
 .Bx 4.0 .
-.Sh BUGS
-On modern terminals that support other attributes, there is no difference
-between characters displayed with the standout attribute set and those
-displayed with one of the other attributes set (usually bold).
-It is best to avoid using standout if the terminal supports other attributes.



CVS commit: src

2021-07-26 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Jul 26 18:10:14 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: expr_precedence.c expr_precedence.exp
src/usr.bin/xlint/lint1: cgram.y

Log Message:
lint: fix parse error in conditional expression (since 2021-07-15)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/expr_precedence.c \
src/tests/usr.bin/xlint/lint1/expr_precedence.exp
cvs rdiff -u -r1.348 -r1.349 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/tests/usr.bin/xlint/lint1/expr_precedence.c
diff -u src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.6 src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.7
--- src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.6	Mon Jul 26 18:06:43 2021
+++ src/tests/usr.bin/xlint/lint1/expr_precedence.c	Mon Jul 26 18:10:14 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: expr_precedence.c,v 1.6 2021/07/26 18:06:43 rillig Exp $	*/
+/*	$NetBSD: expr_precedence.c,v 1.7 2021/07/26 18:10:14 rillig Exp $	*/
 # 3 "expr_precedence.c"
 
 /*
@@ -60,7 +60,6 @@ conditional_associativity(_Bool cond1, _
 	var = cond1 ? (cond2 ? a : b) : c;
 
 	/* The then-expression can even be a comma-expression. */
-	/* expect+1: error: syntax error ',' [249] *//* FIXME */
 	var = cond1 ? cond2 ? a, b : (b, a) : c;
 
 	var = cond1 ? a : cond2 ? b : c;
Index: src/tests/usr.bin/xlint/lint1/expr_precedence.exp
diff -u src/tests/usr.bin/xlint/lint1/expr_precedence.exp:1.6 src/tests/usr.bin/xlint/lint1/expr_precedence.exp:1.7
--- src/tests/usr.bin/xlint/lint1/expr_precedence.exp:1.6	Mon Jul 26 18:06:43 2021
+++ src/tests/usr.bin/xlint/lint1/expr_precedence.exp	Mon Jul 26 18:10:14 2021
@@ -2,4 +2,3 @@ expr_precedence.c(15): error: syntax err
 expr_precedence.c(18): error: non-constant initializer [177]
 expr_precedence.c(35): error: 'var' undefined [99]
 expr_precedence.c(35): error: syntax error '=' [249]
-expr_precedence.c(64): error: syntax error ',' [249]

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.348 src/usr.bin/xlint/lint1/cgram.y:1.349
--- src/usr.bin/xlint/lint1/cgram.y:1.348	Mon Jul 26 17:27:22 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Mon Jul 26 18:10:14 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.348 2021/07/26 17:27:22 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.349 2021/07/26 18:10:14 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.348 2021/07/26 17:27:22 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.349 2021/07/26 18:10:14 rillig Exp $");
 #endif
 
 #include 
@@ -682,7 +682,7 @@ conditional_expression:
 	| conditional_expression T_LOGOR conditional_expression {
 		$$ = build_binary($1, LOGOR, $3);
 	  }
-	| conditional_expression T_QUEST conditional_expression
+	| conditional_expression T_QUEST expression
 	T_COLON conditional_expression {
 		$$ = build_binary($1, QUEST, build_binary($3, COLON, $5));
 	  }



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

2021-07-26 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Jul 26 18:06:43 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: expr_precedence.c expr_precedence.exp

Log Message:
tests/lint: show bug in conditional expression (since 2021-07-15)

Since cgram.y 1.325 from 2021-07-15, conditional expressions did not
accept a comma-expression in the then-branch anymore.  In practice, this
is an edge case though since comma expressions are rare.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/expr_precedence.c \
src/tests/usr.bin/xlint/lint1/expr_precedence.exp

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/expr_precedence.c
diff -u src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.5 src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.6
--- src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.5	Mon Jul 26 17:27:22 2021
+++ src/tests/usr.bin/xlint/lint1/expr_precedence.c	Mon Jul 26 18:06:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: expr_precedence.c,v 1.5 2021/07/26 17:27:22 rillig Exp $	*/
+/*	$NetBSD: expr_precedence.c,v 1.6 2021/07/26 18:06:43 rillig Exp $	*/
 # 3 "expr_precedence.c"
 
 /*
@@ -51,3 +51,27 @@ assignment_associativity(int arg)
 
 	left = arg;
 }
+
+void
+conditional_associativity(_Bool cond1, _Bool cond2, int a, int b, int c)
+{
+	/* The then-expression can be an arbitrary expression. */
+	var = cond1 ? cond2 ? a : b : c;
+	var = cond1 ? (cond2 ? a : b) : c;
+
+	/* The then-expression can even be a comma-expression. */
+	/* expect+1: error: syntax error ',' [249] *//* FIXME */
+	var = cond1 ? cond2 ? a, b : (b, a) : c;
+
+	var = cond1 ? a : cond2 ? b : c;
+	/*
+	 * In almost all programming languages, '?:' is right-associative,
+	 * which allows for easy chaining.
+	 */
+	var = cond1 ? a : (cond2 ? b : c);
+	/*
+	 * In PHP, '?:' is left-associative, which is rather surprising and
+	 * requires more parentheses to get the desired effect.
+	 */
+	var = (cond1 ? a : cond2) ? b : c;
+}
Index: src/tests/usr.bin/xlint/lint1/expr_precedence.exp
diff -u src/tests/usr.bin/xlint/lint1/expr_precedence.exp:1.5 src/tests/usr.bin/xlint/lint1/expr_precedence.exp:1.6
--- src/tests/usr.bin/xlint/lint1/expr_precedence.exp:1.5	Mon Jul 26 17:27:22 2021
+++ src/tests/usr.bin/xlint/lint1/expr_precedence.exp	Mon Jul 26 18:06:43 2021
@@ -2,3 +2,4 @@ expr_precedence.c(15): error: syntax err
 expr_precedence.c(18): error: non-constant initializer [177]
 expr_precedence.c(35): error: 'var' undefined [99]
 expr_precedence.c(35): error: syntax error '=' [249]
+expr_precedence.c(64): error: syntax error ',' [249]



CVS commit: src

2021-07-26 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Jul 26 17:27:22 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: expr_precedence.c expr_precedence.exp
src/usr.bin/xlint/lint1: cgram.y

Log Message:
lint: fix parsing of chained assignments (since 2021-07-15)

The grammar rule for assignment_expression is quite different from those
of the other expressions, for 2 reasons: first, its precedence is
right-to-left.  Second, its left-hand side must be an lvalue, which
rules out all binary operators.  K C even had a grammar rule named
'lvalue' for this purpose.  Later C standards made the kinds of
expressions more fine-grained and used 'unary_expression' in this place.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/expr_precedence.c \
src/tests/usr.bin/xlint/lint1/expr_precedence.exp
cvs rdiff -u -r1.347 -r1.348 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/tests/usr.bin/xlint/lint1/expr_precedence.c
diff -u src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.4 src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.5
--- src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.4	Mon Jul 26 17:09:46 2021
+++ src/tests/usr.bin/xlint/lint1/expr_precedence.c	Mon Jul 26 17:27:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: expr_precedence.c,v 1.4 2021/07/26 17:09:46 rillig Exp $	*/
+/*	$NetBSD: expr_precedence.c,v 1.5 2021/07/26 17:27:22 rillig Exp $	*/
 # 3 "expr_precedence.c"
 
 /*
@@ -42,8 +42,11 @@ assignment_associativity(int arg)
 {
 	int left, right;
 
-	/* FIXME */
-	/* expect+1: error: left operand of '=' must be lvalue [114] */
+	/*
+	 * Assignments are right-associative.  If they were left-associative,
+	 * the result of (left = right) would be an rvalue, resulting in this
+	 * error message: 'left operand of '=' must be lvalue [114]'.
+	 */
 	left = right = arg;
 
 	left = arg;
Index: src/tests/usr.bin/xlint/lint1/expr_precedence.exp
diff -u src/tests/usr.bin/xlint/lint1/expr_precedence.exp:1.4 src/tests/usr.bin/xlint/lint1/expr_precedence.exp:1.5
--- src/tests/usr.bin/xlint/lint1/expr_precedence.exp:1.4	Mon Jul 26 17:09:46 2021
+++ src/tests/usr.bin/xlint/lint1/expr_precedence.exp	Mon Jul 26 17:27:22 2021
@@ -2,4 +2,3 @@ expr_precedence.c(15): error: syntax err
 expr_precedence.c(18): error: non-constant initializer [177]
 expr_precedence.c(35): error: 'var' undefined [99]
 expr_precedence.c(35): error: syntax error '=' [249]
-expr_precedence.c(47): error: left operand of '=' must be lvalue [114]

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.347 src/usr.bin/xlint/lint1/cgram.y:1.348
--- src/usr.bin/xlint/lint1/cgram.y:1.347	Mon Jul 26 17:15:24 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Mon Jul 26 17:27:22 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.347 2021/07/26 17:15:24 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.348 2021/07/26 17:27:22 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.347 2021/07/26 17:15:24 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.348 2021/07/26 17:27:22 rillig Exp $");
 #endif
 
 #include 
@@ -691,10 +691,10 @@ conditional_expression:
 /* K ???, C90 ???, C99 6.5.16, C11 6.5.16 */
 assignment_expression:
 	  conditional_expression
-	| assignment_expression T_ASSIGN conditional_expression {
+	| unary_expression T_ASSIGN assignment_expression {
 		$$ = build_binary($1, ASSIGN, $3);
 	  }
-	| assignment_expression T_OPASSIGN conditional_expression {
+	| unary_expression T_OPASSIGN assignment_expression {
 		$$ = build_binary($1, $2, $3);
 	  }
 	;



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

2021-07-26 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Jul 26 17:15:24 UTC 2021

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

Log Message:
lint: remove redundant associativity declarations

Since cgram.y 1.325 from 2021-07-15, these are not needed anymore.
Strangely, neither yacc nor Bison warned about this redundancy.

No functional change, the grammar rules are the same as before.


To generate a diff of this commit:
cvs rdiff -u -r1.346 -r1.347 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.346 src/usr.bin/xlint/lint1/cgram.y:1.347
--- src/usr.bin/xlint/lint1/cgram.y:1.346	Sun Jul 25 21:31:01 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Mon Jul 26 17:15:24 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.346 2021/07/25 21:31:01 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.347 2021/07/26 17:15:24 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.346 2021/07/25 21:31:01 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.347 2021/07/26 17:15:24 rillig Exp $");
 #endif
 
 #include 
@@ -260,8 +260,6 @@ anonymize(sym_t *s)
 
 %left	T_THEN
 %left	T_ELSE
-%left	T_COMMA
-%right	T_ASSIGN T_OPASSIGN
 %right	T_QUEST T_COLON
 %left	T_LOGOR
 %left	T_LOGAND



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

2021-07-26 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Jul 26 17:09:46 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: expr_precedence.c expr_precedence.exp

Log Message:
tests/lint: demonstrate bug in chained assignment (since 2021-07-15)

Since cgram.y 1.325 from 2021-07-15, lint has been parsing assignment
expressions correctly.  It got the associativity wrong.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/expr_precedence.c \
src/tests/usr.bin/xlint/lint1/expr_precedence.exp

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/expr_precedence.c
diff -u src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.3 src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.4
--- src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.3	Thu Jul 15 17:48:10 2021
+++ src/tests/usr.bin/xlint/lint1/expr_precedence.c	Mon Jul 26 17:09:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: expr_precedence.c,v 1.3 2021/07/15 17:48:10 rillig Exp $	*/
+/*	$NetBSD: expr_precedence.c,v 1.4 2021/07/26 17:09:46 rillig Exp $	*/
 # 3 "expr_precedence.c"
 
 /*
@@ -36,3 +36,15 @@ void __attribute__((format(printf,
 /* Syntactically ok, must be a constant expression though. */
 var > 0 ? 2 : 1)))
 my_printf(const char *, ...);
+
+void
+assignment_associativity(int arg)
+{
+	int left, right;
+
+	/* FIXME */
+	/* expect+1: error: left operand of '=' must be lvalue [114] */
+	left = right = arg;
+
+	left = arg;
+}
Index: src/tests/usr.bin/xlint/lint1/expr_precedence.exp
diff -u src/tests/usr.bin/xlint/lint1/expr_precedence.exp:1.3 src/tests/usr.bin/xlint/lint1/expr_precedence.exp:1.4
--- src/tests/usr.bin/xlint/lint1/expr_precedence.exp:1.3	Thu Jul 15 17:48:10 2021
+++ src/tests/usr.bin/xlint/lint1/expr_precedence.exp	Mon Jul 26 17:09:46 2021
@@ -2,3 +2,4 @@ expr_precedence.c(15): error: syntax err
 expr_precedence.c(18): error: non-constant initializer [177]
 expr_precedence.c(35): error: 'var' undefined [99]
 expr_precedence.c(35): error: syntax error '=' [249]
+expr_precedence.c(47): error: left operand of '=' must be lvalue [114]



CVS commit: src/sys/dev/eisa

2021-07-26 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jul 26 16:45:56 UTC 2021

Modified Files:
src/sys/dev/eisa: ahb.c ahbreg.h

Log Message:
- Type hygiene.
- Rename ahb_ecb::hashkey to ahb_ecb::ecb_dma_addr, and use that value
  rather than recomputing it all the time.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/eisa/ahb.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/eisa/ahbreg.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/eisa/ahb.c
diff -u src/sys/dev/eisa/ahb.c:1.67 src/sys/dev/eisa/ahb.c:1.68
--- src/sys/dev/eisa/ahb.c:1.67	Sat Jul 24 15:52:16 2021
+++ src/sys/dev/eisa/ahb.c	Mon Jul 26 16:45:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahb.c,v 1.67 2021/07/24 15:52:16 thorpej Exp $	*/
+/*	$NetBSD: ahb.c,v 1.68 2021/07/26 16:45:56 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahb.c,v 1.67 2021/07/24 15:52:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahb.c,v 1.68 2021/07/26 16:45:56 thorpej Exp $");
 
 #include "opt_ddb.h"
 
@@ -108,7 +108,7 @@ struct ahb_softc {
 /*
  * Offset of an ECB from the beginning of the ECB DMA mapping.
  */
-#define	AHB_ECB_OFF(e)	(((u_long)(e)) - ((u_long)>sc_ecbs[0]))
+#define	AHB_ECB_OFF(e)	(((uintptr_t)(e)) - ((uintptr_t)>sc_ecbs[0]))
 
 struct ahb_probe_data {
 	int sc_irq;
@@ -121,7 +121,7 @@ static void	ahb_send_immed(struct ahb_so
 static int	ahbintr(void *);
 static void	ahb_free_ecb(struct ahb_softc *, struct ahb_ecb *);
 static struct	ahb_ecb *ahb_get_ecb(struct ahb_softc *);
-static struct	ahb_ecb *ahb_ecb_phys_kv(struct ahb_softc *, physaddr);
+static struct	ahb_ecb *ahb_ecb_phys_kv(struct ahb_softc *, uint32_t);
 static void	ahb_done(struct ahb_softc *, struct ahb_ecb *);
 static int	ahb_find(bus_space_tag_t, bus_space_handle_t,
 		struct ahb_probe_data *);
@@ -294,12 +294,7 @@ ahb_send_mbox(struct ahb_softc *sc, int 
 		Debugger();
 	}
 
-	/*
-	 * don't know if this will work.
-	 * XXX WHAT DOES THIS COMMENT MEAN?!  --thorpej
-	 */
-	bus_space_write_4(iot, ioh, MBOXOUT0,
-	sc->sc_dmamap_ecb->dm_segs[0].ds_addr + AHB_ECB_OFF(ecb));
+	bus_space_write_4(iot, ioh, MBOXOUT0, ecb->ecb_dma_addr);
 	bus_space_write_1(iot, ioh, ATTN, opcode |
 		ecb->xs->xs_periph->periph_target);
 
@@ -309,7 +304,7 @@ ahb_send_mbox(struct ahb_softc *sc, int 
 }
 
 /*
- * Function to  send an immediate type command to the adapter
+ * Function to send an immediate type command to the adapter
  */
 static void
 ahb_send_immed(struct ahb_softc *sc, u_int32_t cmd, struct ahb_ecb *ecb)
@@ -454,13 +449,14 @@ ahb_init_ecb(struct ahb_softc *sc, struc
 		return (error);
 	}
 
+	ecb->ecb_dma_addr = sc->sc_dmamap_ecb->dm_segs[0].ds_addr +
+	AHB_ECB_OFF(ecb);
+
 	/*
 	 * put in the phystokv hash table
 	 * Never gets taken out.
 	 */
-	ecb->hashkey = sc->sc_dmamap_ecb->dm_segs[0].ds_addr +
-	AHB_ECB_OFF(ecb);
-	hashnum = ECB_HASH(ecb->hashkey);
+	hashnum = ECB_HASH(ecb->ecb_dma_addr);
 	ecb->nexthash = sc->sc_ecbhash[hashnum];
 	sc->sc_ecbhash[hashnum] = ecb;
 	ahb_reset_ecb(sc, ecb);
@@ -513,13 +509,13 @@ ahb_get_ecb(struct ahb_softc *sc)
  * given a physical address, find the ecb that it corresponds to.
  */
 static struct ahb_ecb *
-ahb_ecb_phys_kv(struct ahb_softc *sc, physaddr ecb_phys)
+ahb_ecb_phys_kv(struct ahb_softc *sc, uint32_t ecb_phys)
 {
 	int hashnum = ECB_HASH(ecb_phys);
 	struct ahb_ecb *ecb = sc->sc_ecbhash[hashnum];
 
 	while (ecb) {
-		if (ecb->hashkey == ecb_phys)
+		if (ecb->ecb_dma_addr == ecb_phys)
 			break;
 		ecb = ecb->nexthash;
 	}
@@ -867,11 +863,11 @@ ahb_scsipi_request(struct scsipi_channel
 		ecb->opt2 = periph->periph_lun | ECB_NRB;
 		memcpy(>scsi_cmd, xs->cmd,
 		ecb->scsi_cmd_length = xs->cmdlen);
-		ecb->sense_ptr = sc->sc_dmamap_ecb->dm_segs[0].ds_addr +
-		AHB_ECB_OFF(ecb) + offsetof(struct ahb_ecb, ecb_sense);
+		ecb->sense_ptr = ecb->ecb_dma_addr +
+		offsetof(struct ahb_ecb, ecb_sense);
 		ecb->req_sense_length = sizeof(ecb->ecb_sense);
-		ecb->status = sc->sc_dmamap_ecb->dm_segs[0].ds_addr +
-		AHB_ECB_OFF(ecb) + offsetof(struct ahb_ecb, ecb_status);
+		ecb->status = ecb->ecb_dma_addr +
+		offsetof(struct ahb_ecb, ecb_status);
 		ecb->ecb_status.host_stat = 0x00;
 		ecb->ecb_status.target_stat = 0x00;
 
@@ -927,17 +923,16 @@ ahb_scsipi_request(struct scsipi_channel
 ecb->dmamap_xfer->dm_segs[seg].ds_len;
 			}
 
-			ecb->data_addr = sc->sc_dmamap_ecb->dm_segs[0].ds_addr +
-			AHB_ECB_OFF(ecb) +
+			ecb->data_addr = ecb->ecb_dma_addr +
 			offsetof(struct ahb_ecb, ahb_dma);
 			ecb->data_length = ecb->dmamap_xfer->dm_nsegs *
 			sizeof(struct ahb_dma_seg);
 			ecb->opt1 |= ECB_S_G;
 		} else {	/* No data xfer, use non S/G values */
-			ecb->data_addr = (physaddr)0;
+			ecb->data_addr = 0;
 			ecb->data_length = 0;
 		}
-		ecb->link_addr = (physaddr)0;
+		

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

2021-07-26 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Jul 26 16:22:24 UTC 2021

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

Log Message:
lint: make typeok_scalar_strict_bool simpler

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/xlint/lint1/ckbool.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/ckbool.c
diff -u src/usr.bin/xlint/lint1/ckbool.c:1.7 src/usr.bin/xlint/lint1/ckbool.c:1.8
--- src/usr.bin/xlint/lint1/ckbool.c:1.7	Sun Jul  4 09:13:59 2021
+++ src/usr.bin/xlint/lint1/ckbool.c	Mon Jul 26 16:22:24 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ckbool.c,v 1.7 2021/07/04 09:13:59 rillig Exp $ */
+/* $NetBSD: ckbool.c,v 1.8 2021/07/26 16:22:24 rillig Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #include 
 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: ckbool.c,v 1.7 2021/07/04 09:13:59 rillig Exp $");
+__RCSID("$NetBSD: ckbool.c,v 1.8 2021/07/26 16:22:24 rillig Exp $");
 #endif
 
 #include 
@@ -181,7 +181,7 @@ typeok_scalar_strict_bool(op_t op, const
 
 	if (!mp->m_takes_bool) {
 		bool binary = mp->m_binary;
-		bool lbool = ln->tn_type->t_tspec == BOOL;
+		bool lbool = lt == BOOL;
 		bool ok = true;
 
 		if (!binary && lbool) {
@@ -194,7 +194,7 @@ typeok_scalar_strict_bool(op_t op, const
 			error(336, op_name(op));
 			ok = false;
 		}
-		if (binary && rn->tn_type->t_tspec == BOOL) {
+		if (binary && rt == BOOL) {
 			/* right operand of '%s' must not be bool */
 			error(337, op_name(op));
 			ok = false;



CVS commit: src

2021-07-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul 26 12:49:13 UTC 2021

Modified Files:
src/lib/libc/arch/powerpc/string: Makefile.inc
src/sys/lib/libkern/arch/powerpc: Makefile.inc

Log Message:
Improve previous:

- Add suffix ``d'' for mkdep(1).
- Improve comment a little...


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/arch/powerpc/string/Makefile.inc
cvs rdiff -u -r1.32 -r1.33 src/sys/lib/libkern/arch/powerpc/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/powerpc/string/Makefile.inc
diff -u src/lib/libc/arch/powerpc/string/Makefile.inc:1.14 src/lib/libc/arch/powerpc/string/Makefile.inc:1.15
--- src/lib/libc/arch/powerpc/string/Makefile.inc:1.14	Sat Jul 24 05:27:25 2021
+++ src/lib/libc/arch/powerpc/string/Makefile.inc	Mon Jul 26 12:49:13 2021
@@ -1,14 +1,13 @@
-#	$NetBSD: Makefile.inc,v 1.14 2021/07/24 05:27:25 rin Exp $
+#	$NetBSD: Makefile.inc,v 1.15 2021/07/26 12:49:13 rin Exp $
 
 SRCS+=  bzero.S ffs.S strlen.S
 NO_SRCS+= memset.S
 
-# disable the asm versions of these because they break the explora.
-# the special rules here are to override the suffix rules which seem
-# to prefer .S files over .c
+# XXX
+# Disable asm versions that use unaligned memory access and thus break 403.
 .if ${MACHINE} == "evbppc"
 .  for name in bcopy memcmp memcpy memmove
-.for suffix in o po pico go
+.for suffix in o po pico go d
 ${name}.${suffix}: ${name}.c
 .endfor
 .  endfor

Index: src/sys/lib/libkern/arch/powerpc/Makefile.inc
diff -u src/sys/lib/libkern/arch/powerpc/Makefile.inc:1.32 src/sys/lib/libkern/arch/powerpc/Makefile.inc:1.33
--- src/sys/lib/libkern/arch/powerpc/Makefile.inc:1.32	Sat Jul 24 05:29:26 2021
+++ src/sys/lib/libkern/arch/powerpc/Makefile.inc	Mon Jul 26 12:49:13 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.32 2021/07/24 05:29:26 rin Exp $
+#	$NetBSD: Makefile.inc,v 1.33 2021/07/26 12:49:13 rin Exp $
 
 SRCS+=	bswap16.c bswap32.c
 SRCS+=	htonl.c htons.c ntohl.c ntohs.c
@@ -7,10 +7,11 @@ SRCS+=	syncicache.c
 SRCS+=	ffs.S memset.S strlen.S
 SRCS+=	gprsavrest.S
 
-# Disable the asm versions on evbppc because they break the Explora
+# XXX
+# Disable asm versions that use unaligned memory access and thus break 403.
 .if ${MACHINE} == "evbppc"
 .  for name in memcmp memcpy memmove
-.for suffix in o po pico go
+.for suffix in o po pico go d
 ${name}.${suffix}: ${name}.c
 .endfor
 .  endfor