CVS commit: src/usr.bin/make

2021-01-30 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sun Jan 31 07:07:53 UTC 2021

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

Log Message:
Reduce unnecessary calls to waitpid

Set a flag when we catch SIGCHLD and
don't call waitpid if it is not set.
Clear it when we call waitpid.


To generate a diff of this commit:
cvs rdiff -u -r1.404 -r1.405 src/usr.bin/make/job.c

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

Modified files:

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.404 src/usr.bin/make/job.c:1.405
--- src/usr.bin/make/job.c:1.404	Sat Jan 30 13:12:00 2021
+++ src/usr.bin/make/job.c	Sun Jan 31 07:07:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.404 2021/01/30 13:12:00 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.405 2021/01/31 07:07:53 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.404 2021/01/30 13:12:00 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.405 2021/01/31 07:07:53 sjg Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -439,6 +439,7 @@ enum {
 };
 
 static sigset_t caught_signals;	/* Set of signals we handle */
+static volatile int caught_sigchld;
 
 static void JobDoOutput(Job *, Boolean);
 static void JobInterrupt(Boolean, int) MAKE_ATTR_DEAD;
@@ -603,6 +604,7 @@ JobCondPassSig(int signo)
 static void
 JobChildSig(int signo MAKE_ATTR_UNUSED)
 {
+	caught_sigchld = 1;
 	while (write(childExitJob.outPipe, CHILD_EXIT, 1) == -1 &&
 	   errno == EAGAIN)
 		continue;
@@ -1972,6 +1974,11 @@ Job_CatchChildren(void)
 	if (jobTokensRunning == 0)
 		return;
 
+	/* Have we received SIGCHLD since last call? */
+	if (caught_sigchld == 0)
+		return;
+	caught_sigchld = 0;
+
 	while ((pid = waitpid((pid_t)-1, , WNOHANG | WUNTRACED)) > 0) {
 		DEBUG2(JOB, "Process %d exited/stopped status %x.\n",
 		pid, status);
@@ -2206,6 +2213,7 @@ Job_Init(void)
 	memset(job_table, 0, (size_t)opts.maxJobs * sizeof *job_table);
 	job_table_end = job_table + opts.maxJobs;
 	wantToken = 0;
+	caught_sigchld = 0;
 
 	aborting = ABORT_NONE;
 	job_errors = 0;



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

2021-01-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 31 06:24:40 UTC 2021

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

Log Message:
Remove duplicate EARLYCONS=imx entry (both are commented out)


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/evbarm/conf/GENERIC

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

Modified files:

Index: src/sys/arch/evbarm/conf/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.91 src/sys/arch/evbarm/conf/GENERIC:1.92
--- src/sys/arch/evbarm/conf/GENERIC:1.91	Wed Jan 27 15:52:46 2021
+++ src/sys/arch/evbarm/conf/GENERIC	Sun Jan 31 06:24:40 2021
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.91 2021/01/27 15:52:46 skrll Exp $
+#	$NetBSD: GENERIC,v 1.92 2021/01/31 06:24:40 skrll Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -47,7 +47,6 @@ options 	MSGBUFSIZE=32768
 # EARLYCONS is required for early init messages from VERBOSE_INIT_ARM.
 
 #options 	EARLYCONS=am33xx, CONSADDR=0x44e09000
-#options 	EARLYCONS=imx, CONSADDR=0x0202
 #options 	EARLYCONS=omap3, CONSADDR=0x4902
 
 # ODROID-C1



CVS commit: src/sys/arch/arm/include

2021-01-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 31 06:18:50 UTC 2021

Modified Files:
src/sys/arch/arm/include: armreg.h

Log Message:
Fix (unused) PRRR_NOSn #define


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/arm/include/armreg.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/arch/arm/include/armreg.h
diff -u src/sys/arch/arm/include/armreg.h:1.129 src/sys/arch/arm/include/armreg.h:1.130
--- src/sys/arch/arm/include/armreg.h:1.129	Tue Oct 29 16:18:23 2019
+++ src/sys/arch/arm/include/armreg.h	Sun Jan 31 06:18:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: armreg.h,v 1.129 2019/10/29 16:18:23 joerg Exp $	*/
+/*	$NetBSD: armreg.h,v 1.130 2021/01/31 06:18:50 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -529,7 +529,7 @@
 #define NMRR_WBWA	1		// write-back write-allocate
 #define NMRR_WT		2		// write-through
 #define NMRR_WB		3		// write-back
-#define PRRR_NOSn(n)	__BITS(24+2*(n))// Memory region is Inner Shareable
+#define PRRR_NOSn(n)	__BITS(24+(n))	// Memory region is Inner Shareable only
 #define PRRR_NS1	__BIT(19)	// Normal Shareable S=1 is Shareable
 #define PRRR_NS0	__BIT(18)	// Normal Shareable S=0 is Shareable
 #define PRRR_DS1	__BIT(17)	// Device Shareable S=1 is Shareable



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

2021-01-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 31 05:59:55 UTC 2021

Modified Files:
src/sys/arch/arm/arm: cpufunc.c

Log Message:
One #include "opt_cputypes.h" is enough for anyone


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/arch/arm/arm/cpufunc.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/arm/cpufunc.c
diff -u src/sys/arch/arm/arm/cpufunc.c:1.179 src/sys/arch/arm/arm/cpufunc.c:1.180
--- src/sys/arch/arm/arm/cpufunc.c:1.179	Tue Dec  1 02:46:19 2020
+++ src/sys/arch/arm/arm/cpufunc.c	Sun Jan 31 05:59:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.179 2020/12/01 02:46:19 rin Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.180 2021/01/31 05:59:55 skrll Exp $	*/
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.179 2020/12/01 02:46:19 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.180 2021/01/31 05:59:55 skrll Exp $");
 
 #include "opt_arm_start.h"
 #include "opt_compat_netbsd.h"
@@ -90,7 +90,6 @@ __KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 
 #endif
 
 #if defined(CPU_PJ4B)
-#include "opt_cputypes.h"
 #include "opt_mvsoc.h"
 #include 
 #if defined(ARMADAXP)



CVS commit: src/sys/arch/aarch64

2021-01-30 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sun Jan 31 04:51:29 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c
src/sys/arch/aarch64/include: pmap.h

Log Message:
implement pmap_remove_all().

The size of struct pv_entry has increased, but speed of kernel build has 
improved by about 1%
exec and exit should have been improved.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/aarch64/include/pmap.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/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.99 src/sys/arch/aarch64/aarch64/pmap.c:1.100
--- src/sys/arch/aarch64/aarch64/pmap.c:1.99	Sun Dec 20 08:26:32 2020
+++ src/sys/arch/aarch64/aarch64/pmap.c	Sun Jan 31 04:51:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.99 2020/12/20 08:26:32 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.100 2021/01/31 04:51:29 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.99 2020/12/20 08:26:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.100 2021/01/31 04:51:29 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -485,6 +485,7 @@ pmap_bootstrap(vaddr_t vstart, vaddr_t v
 	kpm->pm_l0table_pa = l0pa;
 	kpm->pm_activated = true;
 	LIST_INIT(>pm_vmlist);
+	LIST_INIT(>pm_pvlist);	/* not used for kernel pmap */
 	mutex_init(>pm_lock, MUTEX_DEFAULT, IPL_NONE);
 
 	CTASSERT(sizeof(kpm->pm_stats.wired_count) == sizeof(long));
@@ -719,11 +720,14 @@ _pmap_sweep_pdp(struct pmap *pm)
 }
 
 static void
-_pmap_free_pdp_all(struct pmap *pm)
+_pmap_free_pdp_all(struct pmap *pm, bool free_l0)
 {
-	struct vm_page *pg;
+	struct vm_page *pg, *pgtmp, *pg_reserve;
 
-	while ((pg = LIST_FIRST(>pm_vmlist)) != NULL) {
+	pg_reserve = free_l0 ? NULL : PHYS_TO_VM_PAGE(pm->pm_l0table_pa);
+	LIST_FOREACH_SAFE(pg, >pm_vmlist, pageq.list, pgtmp) {
+		if (pg == pg_reserve)
+			continue;
 		pmap_free_pdp(pm, pg);
 	}
 }
@@ -1101,6 +1105,7 @@ _pmap_remove_pv(struct pmap_page *pp, st
 	UVMHIST_LOG(pmaphist, "pp=%p, pm=%p, va=%llx, pte=%llx",
 	pp, pm, va, pte);
 
+	KASSERT(mutex_owned(>pm_lock));	/* for pv_proc */
 	KASSERT(mutex_owned(>pp_pvlock));
 
 	for (ppv = NULL, pv = >pp_pv; pv != NULL; pv = pv->pv_next) {
@@ -1109,6 +1114,10 @@ _pmap_remove_pv(struct pmap_page *pp, st
 		}
 		ppv = pv;
 	}
+
+	if (pm != pmap_kernel() && pv != NULL)
+		LIST_REMOVE(pv, pv_proc);
+
 	if (ppv == NULL) {
 		/* embedded in pmap_page */
 		pv->pv_pmap = NULL;
@@ -1234,6 +1243,9 @@ _pmap_enter_pv(struct pmap_page *pp, str
 	pv->pv_ptep = ptep;
 	PMAP_COUNT(pv_enter);
 
+	if (pm != pmap_kernel())
+		LIST_INSERT_HEAD(>pm_pvlist, pv, pv_proc);
+
 #ifdef PMAP_PV_DEBUG
 	printf("pv %p alias added va=%016lx -> pa=%016lx\n", pv, va, pa);
 	pv_dump(pp, printf);
@@ -1499,6 +1511,7 @@ pmap_create(void)
 	pm->pm_idlepdp = 0;
 	pm->pm_asid = -1;
 	LIST_INIT(>pm_vmlist);
+	LIST_INIT(>pm_pvlist);
 	mutex_init(>pm_lock, MUTEX_DEFAULT, IPL_NONE);
 
 	pm->pm_l0table_pa = pmap_alloc_pdp(pm, NULL, 0, true);
@@ -1535,9 +1548,13 @@ pmap_destroy(struct pmap *pm)
 	if (refcnt > 0)
 		return;
 
-	aarch64_tlbi_by_asid(pm->pm_asid);
+	KASSERT(LIST_EMPTY(>pm_pvlist));
 
-	_pmap_free_pdp_all(pm);
+	/*
+	 * no need to call aarch64_tlbi_by_asid(pm->pm_asid).
+	 * TLB should already be invalidated in pmap_remove_all()
+	 */
+	_pmap_free_pdp_all(pm, true);
 	mutex_destroy(>pm_lock);
 
 	pool_cache_put(&_pmap_cache, pm);
@@ -2034,8 +2051,64 @@ pmap_enter(struct pmap *pm, vaddr_t va, 
 bool
 pmap_remove_all(struct pmap *pm)
 {
-	/* nothing to do */
-	return false;
+	struct pmap_page *pp;
+	struct pv_entry *pv, *pvtmp, *opv, *pvtofree = NULL;
+	pt_entry_t pte, *ptep;
+	paddr_t pa;
+
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLED(pmaphist);
+
+	UVMHIST_LOG(pmaphist, "pm=%p", pm, 0, 0, 0);
+
+	if (pm == pmap_kernel())
+		return false;
+
+	pm_lock(pm);
+
+	LIST_FOREACH_SAFE(pv, >pm_pvlist, pv_proc, pvtmp) {
+		ptep = pv->pv_ptep;
+		pte = *ptep;
+
+		KASSERTMSG(lxpde_valid(pte),
+		"pte is not valid: pmap=%p, asid=%d, va=%016lx\n",
+		pm, pm->pm_asid, pv->pv_va);
+
+		pa = lxpde_pa(pte);
+		pp = phys_to_pp(pa);
+
+		KASSERTMSG(pp != NULL,
+		"no pmap_page of physical address:%016lx, "
+		"pmap=%p, asid=%d, va=%016lx\n",
+		pa, pm, pm->pm_asid, pv->pv_va);
+
+		pmap_pv_lock(pp);
+		opv = _pmap_remove_pv(pp, pm, trunc_page(pv->pv_va), pte);
+		pmap_pv_unlock(pp);
+		if (opv != NULL) {
+			opv->pv_next = pvtofree;
+			pvtofree = opv;
+		}
+	}
+	/* all PTE should now be cleared */
+	pm->pm_stats.wired_count = 0;
+	pm->pm_stats.resident_count = 0;
+
+	/* clear L0 page table page */
+	pmap_zero_page(pm->pm_l0table_pa);
+	aarch64_tlbi_by_asid(pm->pm_asid);
+
+	/* free L1-L3 page table pages, but not L0 */
+	_pmap_free_pdp_all(pm, false);
+
+	

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

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 23:15:32 UTC 2021

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

Log Message:
lint: flatten has_side_effect

Since GCC performs tail call optimization, the generated code is
practically the same.

Replace redundant comments with open questions.

No functional change.


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

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

Modified files:

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.198 src/usr.bin/xlint/lint1/tree.c:1.199
--- src/usr.bin/xlint/lint1/tree.c:1.198	Sat Jan 30 23:05:08 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jan 30 23:15:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.198 2021/01/30 23:05:08 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.199 2021/01/30 23:15:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.198 2021/01/30 23:05:08 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.199 2021/01/30 23:15:32 rillig Exp $");
 #endif
 
 #include 
@@ -3771,32 +3771,30 @@ expr(tnode_t *tn, bool vctx, bool tctx, 
 }
 
 static bool
-has_side_effect(const tnode_t *tn)
+has_side_effect(const tnode_t *tn) // NOLINT(misc-no-recursion)
 {
-	while (!modtab[tn->tn_op].m_has_side_effect) {
-		if (tn->tn_op == CVT && tn->tn_type->t_tspec == VOID) {
-			tn = tn->tn_left;
-		} else if (tn->tn_op == LOGAND || tn->tn_op == LOGOR) {
-			/*
-			 * && and || have a side effect if the right operand
-			 * has a side effect.
-			 */
-			tn = tn->tn_right;
-		} else if (tn->tn_op == QUEST) {
-			/*
-			 * ? has a side effect if at least one of its right
-			 * operands has a side effect
-			 */
-			tn = tn->tn_right;
-		} else if (tn->tn_op == COLON || tn->tn_op == COMMA) {
-			return has_side_effect(tn->tn_left) ||
-			   has_side_effect(tn->tn_right);
-		} else {
-			return false;
-		}
+	op_t op = tn->tn_op;
+
+	if (modtab[op].m_has_side_effect)
+		return true;
+
+	if (op == CVT && tn->tn_type->t_tspec == VOID)
+		return has_side_effect(tn->tn_left);
+
+	/* XXX: Why not has_side_effect(tn->tn_left) as well? */
+	if (op == LOGAND || op == LOGOR)
+		return has_side_effect(tn->tn_right);
+
+	/* XXX: Why not has_side_effect(tn->tn_left) as well? */
+	if (op == QUEST)
+		return has_side_effect(tn->tn_right);
+
+	if (op == COLON || op == COMMA) {
+		return has_side_effect(tn->tn_left) ||
+		   has_side_effect(tn->tn_right);
 	}
 
-	return modtab[tn->tn_op].m_has_side_effect;
+	return false;
 }
 
 static void



CVS commit: src

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 23:05:08 UTC 2021

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

Log Message:
lint: fix wrong 'expression has null effect'


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_129.c \
src/tests/usr.bin/xlint/lint1/msg_129.exp
cvs rdiff -u -r1.197 -r1.198 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/tests/usr.bin/xlint/lint1/msg_129.c
diff -u src/tests/usr.bin/xlint/lint1/msg_129.c:1.2 src/tests/usr.bin/xlint/lint1/msg_129.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_129.c:1.2	Sat Jan 30 22:38:54 2021
+++ src/tests/usr.bin/xlint/lint1/msg_129.c	Sat Jan 30 23:05:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_129.c,v 1.2 2021/01/30 22:38:54 rillig Exp $	*/
+/*	$NetBSD: msg_129.c,v 1.3 2021/01/30 23:05:08 rillig Exp $	*/
 # 3 "msg_129.c"
 
 // Test for message: expression has null effect [129]
@@ -8,13 +8,18 @@
 typedef unsigned char uint8_t;
 typedef unsigned int uint32_t;
 
+_Bool side_effect(void);
+
 /*
- * XXX: The message 129 looks wrong in this case.  There are several comma
- * operators, each of them has an assignment as operand, and an assignment
- * has side effects.
+ * Before tree.c 1.198 from 2021-01-30, the nested comma operators were
+ * wrongly reported as having no side effect.
  *
- * Nevertheless, when stepping through check_null_effect, the operator ','
- * in line 17 says it has no side effect, which is strange.
+ * The bug was that has_side_effect did not properly examine the sub-nodes.
+ * The ',' operator has m_has_side_effect == false since it depends on its
+ * operands whether the ',' actually has side effects.  For nested ','
+ * operators, the function did not evaluate the operands deeply but only did
+ * a quick shallow test on the m_has_side_effect property.  Since that is
+ * false, lint thought that the whole expression would have no side effect.
  */
 void
 uint8_buffer_write_uint32(uint8_t *c, uint32_t l)
@@ -22,5 +27,17 @@ uint8_buffer_write_uint32(uint8_t *c, ui
 	(*(c++) = (uint8_t)(l & 0xff),
 	*(c++) = (uint8_t)((l >> 8L) & 0xff),
 	*(c++) = (uint8_t)((l >> 16L) & 0xff),
-	*(c++) = (uint8_t)((l >> 24L) & 0xff));	/* expect: 129 */
+	*(c++) = (uint8_t)((l >> 24L) & 0xff));
+}
+
+void
+operator_comma(void)
+{
+	side_effect(), 0;		/* the 0 is redundant */
+	0, side_effect();		/* expect: 129 */
+
+	if (side_effect(), 0)		/* the 0 controls the 'if' */
+		return;
+	if (0, side_effect())		/* expect: 129 */
+		return;
 }
Index: src/tests/usr.bin/xlint/lint1/msg_129.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_129.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_129.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_129.exp:1.2	Sat Jan 30 22:38:54 2021
+++ src/tests/usr.bin/xlint/lint1/msg_129.exp	Sat Jan 30 23:05:08 2021
@@ -1 +1,2 @@
-msg_129.c(25): warning: expression has null effect [129]
+msg_129.c(37): warning: expression has null effect [129]
+msg_129.c(41): warning: expression has null effect [129]

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.197 src/usr.bin/xlint/lint1/tree.c:1.198
--- src/usr.bin/xlint/lint1/tree.c:1.197	Sat Jan 30 22:48:50 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jan 30 23:05:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.197 2021/01/30 22:48:50 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.198 2021/01/30 23:05:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.197 2021/01/30 22:48:50 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.198 2021/01/30 23:05:08 rillig Exp $");
 #endif
 
 #include 
@@ -3789,19 +3789,10 @@ has_side_effect(const tnode_t *tn)
 			 */
 			tn = tn->tn_right;
 		} else if (tn->tn_op == COLON || tn->tn_op == COMMA) {
-			/*
-			 * : has a side effect if at least one of its operands
-			 * has a side effect
-			 */
-			if (modtab[tn->tn_left->tn_op].m_has_side_effect) {
-tn = tn->tn_left;
-			} else if (modtab[tn->tn_right->tn_op].m_has_side_effect) {
-tn = tn->tn_right;
-			} else {
-break;
-			}
+			return has_side_effect(tn->tn_left) ||
+			   has_side_effect(tn->tn_right);
 		} else {
-			break;
+			return false;
 		}
 	}
 



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

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 22:48:50 UTC 2021

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

Log Message:
lint: extract has_side_effect from check_null_effect

No functional change.


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

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

Modified files:

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.196 src/usr.bin/xlint/lint1/tree.c:1.197
--- src/usr.bin/xlint/lint1/tree.c:1.196	Sat Jan 30 21:58:04 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jan 30 22:48:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.196 2021/01/30 21:58:04 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.197 2021/01/30 22:48:50 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.196 2021/01/30 21:58:04 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.197 2021/01/30 22:48:50 rillig Exp $");
 #endif
 
 #include 
@@ -3770,13 +3770,9 @@ expr(tnode_t *tn, bool vctx, bool tctx, 
 		tfreeblk();
 }
 
-static void
-check_null_effect(const tnode_t *tn)
+static bool
+has_side_effect(const tnode_t *tn)
 {
-
-	if (!hflag)
-		return;
-
 	while (!modtab[tn->tn_op].m_has_side_effect) {
 		if (tn->tn_op == CVT && tn->tn_type->t_tspec == VOID) {
 			tn = tn->tn_left;
@@ -3808,9 +3804,18 @@ check_null_effect(const tnode_t *tn)
 			break;
 		}
 	}
-	if (!modtab[tn->tn_op].m_has_side_effect)
+
+	return modtab[tn->tn_op].m_has_side_effect;
+}
+
+static void
+check_null_effect(const tnode_t *tn)
+{
+
+	if (hflag && !has_side_effect(tn)) {
 		/* expression has null effect */
 		warning(129);
+	}
 }
 
 /*



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

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 22:38:54 UTC 2021

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

Log Message:
lint: add test for 129, possibly demonstrating a bug in lint


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_129.c \
src/tests/usr.bin/xlint/lint1/msg_129.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/msg_129.c
diff -u src/tests/usr.bin/xlint/lint1/msg_129.c:1.1 src/tests/usr.bin/xlint/lint1/msg_129.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_129.c:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_129.c	Sat Jan 30 22:38:54 2021
@@ -1,7 +1,26 @@
-/*	$NetBSD: msg_129.c,v 1.1 2021/01/02 10:22:43 rillig Exp $	*/
+/*	$NetBSD: msg_129.c,v 1.2 2021/01/30 22:38:54 rillig Exp $	*/
 # 3 "msg_129.c"
 
 // Test for message: expression has null effect [129]
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+/* lint1-extra-flags: -h */
+
+typedef unsigned char uint8_t;
+typedef unsigned int uint32_t;
+
+/*
+ * XXX: The message 129 looks wrong in this case.  There are several comma
+ * operators, each of them has an assignment as operand, and an assignment
+ * has side effects.
+ *
+ * Nevertheless, when stepping through check_null_effect, the operator ','
+ * in line 17 says it has no side effect, which is strange.
+ */
+void
+uint8_buffer_write_uint32(uint8_t *c, uint32_t l)
+{
+	(*(c++) = (uint8_t)(l & 0xff),
+	*(c++) = (uint8_t)((l >> 8L) & 0xff),
+	*(c++) = (uint8_t)((l >> 16L) & 0xff),
+	*(c++) = (uint8_t)((l >> 24L) & 0xff));	/* expect: 129 */
+}
Index: src/tests/usr.bin/xlint/lint1/msg_129.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_129.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_129.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_129.exp:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_129.exp	Sat Jan 30 22:38:54 2021
@@ -1 +1 @@
-msg_129.c(6): syntax error ':' [249]
+msg_129.c(25): warning: expression has null effect [129]



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

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 22:07:31 UTC 2021

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

Log Message:
lint: add test for message 259 about implicit conversions


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_259.c \
src/tests/usr.bin/xlint/lint1/msg_259.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/msg_259.c
diff -u src/tests/usr.bin/xlint/lint1/msg_259.c:1.1 src/tests/usr.bin/xlint/lint1/msg_259.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_259.c:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_259.c	Sat Jan 30 22:07:31 2021
@@ -1,7 +1,24 @@
-/*	$NetBSD: msg_259.c,v 1.1 2021/01/02 10:22:44 rillig Exp $	*/
+/*	$NetBSD: msg_259.c,v 1.2 2021/01/30 22:07:31 rillig Exp $	*/
 # 3 "msg_259.c"
 
 // Test for message: conversion to '%s' due to prototype, arg #%d [259]
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+/* lint1-extra-flags: -h */
+
+void farg_char(char);
+void farg_int(int);
+void farg_long(long);
+
+void
+example(char c, int i, long l)
+{
+	farg_char(c);
+	farg_int(c);
+	farg_long(c);
+	farg_char(i);		/* XXX: why no warning? */
+	farg_int(i);
+	farg_long(i);
+	farg_char(l);		/* XXX: why no warning? */
+	farg_int(l);		/* expect: 259 */
+	farg_long(l);
+}
Index: src/tests/usr.bin/xlint/lint1/msg_259.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_259.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_259.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_259.exp:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_259.exp	Sat Jan 30 22:07:31 2021
@@ -1 +1 @@
-msg_259.c(6): syntax error ':' [249]
+msg_259.c(22): warning: conversion to 'int' due to prototype, arg #1 [259]



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

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 21:58:04 UTC 2021

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

Log Message:
lint: add type information to message 275

Before: cast discards 'const' from pointer target type
After:  cast discards 'const' from type 'pointer to const char'

Seen in sqlite3.c.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.195 -r1.196 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/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.71 src/usr.bin/xlint/lint1/err.c:1.72
--- src/usr.bin/xlint/lint1/err.c:1.71	Sat Jan 30 21:49:08 2021
+++ src/usr.bin/xlint/lint1/err.c	Sat Jan 30 21:58:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.71 2021/01/30 21:49:08 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.72 2021/01/30 21:58:04 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.71 2021/01/30 21:49:08 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.72 2021/01/30 21:58:04 rillig Exp $");
 #endif
 
 #include 
@@ -334,7 +334,7 @@ const	char *msgs[] = {
 	"empty translation unit",  /* 272 */
 	"bit-field type '%s' invalid in ANSI C",		  /* 273 */
 	"ANSI C forbids comparison of %s with %s",		  /* 274 */
-	"cast discards 'const' from pointer target type",	  /* 275 */
+	"cast discards 'const' from type '%s'",			  /* 275 */
 	"__%s__ is illegal for type %s",			  /* 276 */
 	"initialisation of '%s' with '%s'",			  /* 277 */
 	"combination of '%s' and '%s', arg #%d",		  /* 278 */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.195 src/usr.bin/xlint/lint1/tree.c:1.196
--- src/usr.bin/xlint/lint1/tree.c:1.195	Sat Jan 30 21:49:08 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jan 30 21:58:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.195 2021/01/30 21:49:08 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.196 2021/01/30 21:58:04 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.195 2021/01/30 21:49:08 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.196 2021/01/30 21:58:04 rillig Exp $");
 #endif
 
 #include 
@@ -3489,8 +3489,8 @@ cast(tnode_t *tn, type_t *tp)
 	} else if (nt == PTR && ot == PTR) {
 		if (!tp->t_subt->t_const && tn->tn_type->t_subt->t_const) {
 			if (hflag)
-/* cast discards 'const' from pointer tar... */
-warning(275);
+/* cast discards 'const' from type '%s' */
+warning(275, type_name(tn->tn_type));
 		}
 	} else {
 		/* invalid cast expression */



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

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 21:49:08 UTC 2021

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

Log Message:
lint: add type information to warning about troublesome casts

The previous warning text did not mention the actual types that are
involved in the type conversion.  These types can be hard to see from
the source code as soon as macros are involved, and even in plain code,
one would have to follow the declarations, which is an unnecessary
burden.  Lint already has all information about the involved types, so
there is no reason for omitting this crucial information.

Seen in external/mit/lua/dist/src/lvm.c and several other files.
Including the type information in the message immediately makes the
message scarier.

Before: pointer casts may be troublesome
After:  pointer cast from 'pointer to struct TString' to 'pointer to
union GCUnion' may be troublesome


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.194 -r1.195 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/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.70 src/usr.bin/xlint/lint1/err.c:1.71
--- src/usr.bin/xlint/lint1/err.c:1.70	Sat Jan 30 17:56:29 2021
+++ src/usr.bin/xlint/lint1/err.c	Sat Jan 30 21:49:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.70 2021/01/30 17:56:29 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.71 2021/01/30 21:49:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.70 2021/01/30 17:56:29 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.71 2021/01/30 21:49:08 rillig Exp $");
 #endif
 
 #include 
@@ -306,7 +306,7 @@ const	char *msgs[] = {
 	"illegal structure pointer combination",		  /* 244 */
 	"illegal structure pointer combination, op %s",		  /* 245 */
 	"dubious conversion of enum to '%s'",			  /* 246 */
-	"pointer casts may be troublesome",			  /* 247 */
+	"pointer cast from '%s' to '%s' may be troublesome",	  /* 247 */
 	"floating-point constant out of range",			  /* 248 */
 	"syntax error '%s'",	  /* 249 */
 	"unknown character \\%o",  /* 250 */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.194 src/usr.bin/xlint/lint1/tree.c:1.195
--- src/usr.bin/xlint/lint1/tree.c:1.194	Sat Jan 30 18:16:45 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jan 30 21:49:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.194 2021/01/30 18:16:45 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.195 2021/01/30 21:49:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.194 2021/01/30 18:16:45 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.195 2021/01/30 21:49:08 rillig Exp $");
 #endif
 
 #include 
@@ -2253,8 +2253,8 @@ check_pointer_conversion(op_t op, tnode_
 	 tp->t_subt->t_str != tn->tn_type->t_subt->t_str) ||
 	psize(nt) != psize(ot)) {
 		if (cflag) {
-			/* pointer casts may be troublesome */
-			warning(247);
+			/* pointer cast from '%s' to '%s' may be troublesome */
+			warning(247, type_name(tn->tn_type), type_name(tp));
 		}
 	}
 }



CVS commit: src/usr.bin/make

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 21:25:10 UTC 2021

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

Log Message:
make(1): inline Buf_Len


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/make/buf.h
cvs rdiff -u -r1.519 -r1.520 src/usr.bin/make/main.c
cvs rdiff -u -r1.785 -r1.786 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/buf.h
diff -u src/usr.bin/make/buf.h:1.41 src/usr.bin/make/buf.h:1.42
--- src/usr.bin/make/buf.h:1.41	Sat Jan 30 21:18:14 2021
+++ src/usr.bin/make/buf.h	Sat Jan 30 21:25:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.h,v 1.41 2021/01/30 21:18:14 rillig Exp $	*/
+/*	$NetBSD: buf.h,v 1.42 2021/01/30 21:25:10 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -81,8 +81,8 @@
 
 /* An automatically growing null-terminated buffer of characters. */
 typedef struct Buffer {
-	size_t cap;	/* Allocated size of the buffer, including the null */
-	size_t len;	/* Number of bytes in buffer, excluding the null */
+	size_t cap;	/* Allocated size of the buffer, including the '\0' */
+	size_t len;	/* Number of bytes in buffer, excluding the '\0' */
 	char *data;	/* The buffer itself (always null-terminated) */
 } Buffer;
 
@@ -101,12 +101,6 @@ Buf_AddByte(Buffer *buf, char byte)
 	end[1] = '\0';
 }
 
-MAKE_INLINE size_t
-Buf_Len(const Buffer *buf)
-{
-	return buf->len;
-}
-
 MAKE_INLINE Boolean
 Buf_EndsWith(const Buffer *buf, char ch)
 {

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.519 src/usr.bin/make/main.c:1.520
--- src/usr.bin/make/main.c:1.519	Sat Jan 30 21:03:32 2021
+++ src/usr.bin/make/main.c	Sat Jan 30 21:25:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.519 2021/01/30 21:03:32 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.520 2021/01/30 21:25:10 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -110,7 +110,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.519 2021/01/30 21:03:32 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.520 2021/01/30 21:25:10 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -1840,7 +1840,7 @@ Cmd_Exec(const char *cmd, const char **e
 		while ((pid = waitpid(cpid, , 0)) != cpid && pid >= 0)
 			JobReapChild(pid, status, FALSE);
 
-		res_len = Buf_Len();
+		res_len = buf.len;
 		res = Buf_DoneData();
 
 		if (savederr != 0)
@@ -2025,7 +2025,7 @@ execDie(const char *af, const char *av)
 	Buf_AddStr(, strerror(errno));
 	Buf_AddStr(, ")\n");
 
-	write_all(STDERR_FILENO, buf.data, Buf_Len());
+	write_all(STDERR_FILENO, buf.data, buf.len);
 
 	Buf_Done();
 	_exit(1);

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.785 src/usr.bin/make/var.c:1.786
--- src/usr.bin/make/var.c:1.785	Sat Jan 30 21:03:32 2021
+++ src/usr.bin/make/var.c	Sat Jan 30 21:25:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.785 2021/01/30 21:03:32 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.786 2021/01/30 21:25:10 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.785 2021/01/30 21:03:32 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.786 2021/01/30 21:25:10 rillig Exp $");
 
 typedef enum VarFlags {
 	VAR_NONE	= 0,
@@ -1745,7 +1745,7 @@ ModifyWords(const char *str,
 
 	for (i = 0; i < words.len; i++) {
 		modifyWord(words.words[i], , modifyWord_args);
-		if (Buf_Len() > 0)
+		if (result.buf.len > 0)
 			SepBuf_Sep();
 	}
 
@@ -2164,7 +2164,7 @@ ParseModifierPartSubst(
 
 	*pp = ++p;
 	if (out_length != NULL)
-		*out_length = Buf_Len();
+		*out_length = buf.len;
 
 	*out_part = Buf_DoneData();
 	DEBUG1(VAR, "Modifier part: \"%s\"\n", *out_part);
@@ -3804,7 +3804,7 @@ ParseVarname(const char **pp, char start
 		}
 	}
 	*pp = p;
-	*out_varname_len = Buf_Len();
+	*out_varname_len = buf.len;
 	return Buf_DoneData();
 }
 



CVS commit: src/sys/dev/pci

2021-01-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 30 21:24:30 UTC 2021

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add some more product IDs for mcx(4)


To generate a diff of this commit:
cvs rdiff -u -r1.1423 -r1.1424 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1423 src/sys/dev/pci/pcidevs:1.1424
--- src/sys/dev/pci/pcidevs:1.1423	Tue Dec 29 11:05:56 2020
+++ src/sys/dev/pci/pcidevs	Sat Jan 30 21:24:30 2021
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1423 2020/12/29 11:05:56 skrll Exp $
+$NetBSD: pcidevs,v 1.1424 2021/01/30 21:24:30 jmcneill Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -6298,9 +6298,16 @@ product MEDIAQ MQ200		0x0200	MQ200
 
 /* Mellanox Technologies */
 product MELLANOX MT27700	0x1013	ConnectX-4
+product MELLANOX MT27700VF	0x1014	ConnectX-4 VF
 product MELLANOX MT27710	0x1015	ConnectX-4 Lx
+product MELLANOX MT27710VF	0x1016	ConnectX-4 Lx VF
 product MELLANOX MT27800	0x1017	ConnectX-5
+product MELLANOX MT27800VF	0x1018	ConnectX-5 VF
 product MELLANOX MT28800	0x1019	ConnectX-5 Ex
+product MELLANOX MT28800VF	0x101a	ConnectX-5 Ex VF
+product MELLANOX MT28908	0x101b	ConnectX-6
+product MELLANOX MT28908VF	0x101c	ConnectX-6 VF
+product MELLANOX MT2892		0x101d	ConnectX-6 Dx
 product MELLANOX MT23108	0x5a44	InfiniHost (Tavor)
 product MELLANOX MT23108_PCI	0x5a46	InfiniHost PCI Bridge (Tavor)
 product MELLANOX MT25204_OLD	0x5e8c	InfiniHost III Lx (old Sinai)



CVS commit: src/sys/net

2021-01-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 30 21:23:08 UTC 2021

Modified Files:
src/sys/net: files.net
Added Files:
src/sys/net: toeplitz.c toeplitz.h

Log Message:
Add symmetric toeplitz implementation with integration for NICs, from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/net/files.net
cvs rdiff -u -r0 -r1.1 src/sys/net/toeplitz.c src/sys/net/toeplitz.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/net/files.net
diff -u src/sys/net/files.net:1.29 src/sys/net/files.net:1.30
--- src/sys/net/files.net:1.29	Sun Sep 27 13:31:04 2020
+++ src/sys/net/files.net	Sat Jan 30 21:23:08 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: files.net,v 1.29 2020/09/27 13:31:04 roy Exp $
+#	$NetBSD: files.net,v 1.30 2021/01/30 21:23:08 jmcneill Exp $
 
 # XXX CLEANUP
 define	net
@@ -49,6 +49,7 @@ file	net/rss_config.c		net
 file	net/rtbl.c			net
 file	net/rtsock.c			net
 file	net/slcompress.c		sl | ppp | (irip & irip_vj)
+file	net/toeplitz.c			toeplitz
 file	net/zlib.c			(ppp & ppp_deflate) | swcrypto | vnd_compression
 file	netinet/accf_data.c		accf_data
 file	netinet/accf_http.c		accf_http

Added files:

Index: src/sys/net/toeplitz.c
diff -u /dev/null src/sys/net/toeplitz.c:1.1
--- /dev/null	Sat Jan 30 21:23:08 2021
+++ src/sys/net/toeplitz.c	Sat Jan 30 21:23:08 2021
@@ -0,0 +1,204 @@
+/* $OpenBSD: toeplitz.c,v 1.9 2020/09/01 19:18:26 tb Exp $ */
+
+/*
+ * Copyright (c) 2009 The DragonFly Project.  All rights reserved.
+ *
+ * This code is derived from software contributed to The DragonFly Project
+ * by Sepherosa Ziehau 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in
+ *the documentation and/or other materials provided with the
+ *distribution.
+ * 3. Neither the name of The DragonFly Project nor the names of its
+ *contributors may be used to endorse or promote products derived
+ *from this software without specific, prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2019 David Gwynne 
+ * Copyright (c) 2020 Theo Buehler 
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+/*
+ * symmetric toeplitz
+ */
+
+static stoeplitz_key		stoeplitz_keyseed = STOEPLITZ_KEYSEED;
+static struct stoeplitz_cache	stoeplitz_syskey_cache;
+const struct stoeplitz_cache *const
+stoeplitz_cache = _syskey_cache;
+
+/* parity of n16: count (mod 2) of ones in the binary representation. */
+static int
+parity(uint16_t n16)
+{
+	n16 = ((n16 & 0x) >> 1) ^ (n16 & 0x);
+	n16 = ((n16 & 0x) >> 2) ^ (n16 & 0x);
+	n16 = ((n16 & 0xf0f0) >> 4) ^ (n16 & 0x0f0f);
+	n16 = ((n16 & 0xff00) >> 8) ^ (n16 & 0x00ff);
+
+	return (n16);
+}
+
+/*
+ * The Toeplitz matrix obtained from a seed is invertible if and only if the
+ * parity of the seed is 1. Generate such a seed uniformly at random.
+ */
+static stoeplitz_key
+stoeplitz_random_seed(void)
+{
+	stoeplitz_key seed;
+
+	seed = cprng_strong32() & UINT16_MAX;

CVS commit: src/usr.bin/make

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 21:18:14 UTC 2021

Modified Files:
src/usr.bin/make: buf.c buf.h

Log Message:
make(1): remove __predict_false

The effect (at least on x86_64) is so minimal that it is not worth
cluttering the code.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/make/buf.c
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/make/buf.h

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

Modified files:

Index: src/usr.bin/make/buf.c
diff -u src/usr.bin/make/buf.c:1.50 src/usr.bin/make/buf.c:1.51
--- src/usr.bin/make/buf.c:1.50	Sat Jan 30 21:03:32 2021
+++ src/usr.bin/make/buf.c	Sat Jan 30 21:18:14 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.c,v 1.50 2021/01/30 21:03:32 rillig Exp $	*/
+/*	$NetBSD: buf.c,v 1.51 2021/01/30 21:18:14 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -75,7 +75,7 @@
 #include "make.h"
 
 /*	"@(#)buf.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: buf.c,v 1.50 2021/01/30 21:03:32 rillig Exp $");
+MAKE_RCSID("$NetBSD: buf.c,v 1.51 2021/01/30 21:18:14 rillig Exp $");
 
 /* Make space in the buffer for adding at least 16 more bytes. */
 void
@@ -92,7 +92,7 @@ Buf_AddBytes(Buffer *buf, const char *by
 	size_t old_len = buf->len;
 	char *end;
 
-	if (__predict_false(old_len + bytes_len >= buf->cap)) {
+	if (old_len + bytes_len >= buf->cap) {
 		size_t minIncr = bytes_len + 16;
 		buf->cap += buf->cap > minIncr ? buf->cap : minIncr;
 		buf->data = bmake_realloc(buf->data, buf->cap);

Index: src/usr.bin/make/buf.h
diff -u src/usr.bin/make/buf.h:1.40 src/usr.bin/make/buf.h:1.41
--- src/usr.bin/make/buf.h:1.40	Sat Jan 30 21:03:32 2021
+++ src/usr.bin/make/buf.h	Sat Jan 30 21:18:14 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.h,v 1.40 2021/01/30 21:03:32 rillig Exp $	*/
+/*	$NetBSD: buf.h,v 1.41 2021/01/30 21:18:14 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -86,11 +86,6 @@ typedef struct Buffer {
 	char *data;	/* The buffer itself (always null-terminated) */
 } Buffer;
 
-/* If we aren't on NetBSD, __predict_false() might not be defined. */
-#ifndef __predict_false
-#define __predict_false(x) (x)
-#endif
-
 void Buf_Expand(Buffer *);
 
 /* Buf_AddByte adds a single byte to a buffer. */
@@ -99,7 +94,7 @@ Buf_AddByte(Buffer *buf, char byte)
 {
 	size_t old_len = buf->len++;
 	char *end;
-	if (__predict_false(old_len + 1 >= buf->cap))
+	if (old_len + 1 >= buf->cap)
 		Buf_Expand(buf);
 	end = buf->data + old_len;
 	end[0] = byte;



CVS commit: src/usr.bin/make

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 21:03:32 UTC 2021

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

Log Message:
make(1): inline Buf_GetAll


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/make/buf.c
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/make/buf.h
cvs rdiff -u -r1.518 -r1.519 src/usr.bin/make/main.c
cvs rdiff -u -r1.784 -r1.785 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/buf.c
diff -u src/usr.bin/make/buf.c:1.49 src/usr.bin/make/buf.c:1.50
--- src/usr.bin/make/buf.c:1.49	Sat Jan 30 20:59:29 2021
+++ src/usr.bin/make/buf.c	Sat Jan 30 21:03:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.c,v 1.49 2021/01/30 20:59:29 rillig Exp $	*/
+/*	$NetBSD: buf.c,v 1.50 2021/01/30 21:03:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -75,7 +75,7 @@
 #include "make.h"
 
 /*	"@(#)buf.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: buf.c,v 1.49 2021/01/30 20:59:29 rillig Exp $");
+MAKE_RCSID("$NetBSD: buf.c,v 1.50 2021/01/30 21:03:32 rillig Exp $");
 
 /* Make space in the buffer for adding at least 16 more bytes. */
 void
@@ -135,21 +135,6 @@ Buf_AddInt(Buffer *buf, int n)
 	Buf_AddBytes(buf, str, len);
 }
 
-/*
- * Get the data (usually a string) from the buffer.
- * The returned data is valid until the next modifying operation
- * on the buffer.
- *
- * Returns the data and optionally the length of the data.
- */
-char *
-Buf_GetAll(Buffer *buf, size_t *out_len)
-{
-	if (out_len != NULL)
-		*out_len = buf->len;
-	return buf->data;
-}
-
 /* Mark the buffer as empty, so it can be filled with data again. */
 void
 Buf_Empty(Buffer *buf)

Index: src/usr.bin/make/buf.h
diff -u src/usr.bin/make/buf.h:1.39 src/usr.bin/make/buf.h:1.40
--- src/usr.bin/make/buf.h:1.39	Sat Jan 30 20:53:29 2021
+++ src/usr.bin/make/buf.h	Sat Jan 30 21:03:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.h,v 1.39 2021/01/30 20:53:29 rillig Exp $	*/
+/*	$NetBSD: buf.h,v 1.40 2021/01/30 21:03:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -122,7 +122,6 @@ void Buf_AddBytes(Buffer *, const char *
 void Buf_AddBytesBetween(Buffer *, const char *, const char *);
 void Buf_AddStr(Buffer *, const char *);
 void Buf_AddInt(Buffer *, int);
-char *Buf_GetAll(Buffer *, size_t *);
 void Buf_Empty(Buffer *);
 void Buf_Init(Buffer *);
 void Buf_InitSize(Buffer *, size_t);

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.518 src/usr.bin/make/main.c:1.519
--- src/usr.bin/make/main.c:1.518	Sat Jan 30 20:53:29 2021
+++ src/usr.bin/make/main.c	Sat Jan 30 21:03:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.518 2021/01/30 20:53:29 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.519 2021/01/30 21:03:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -110,7 +110,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.518 2021/01/30 20:53:29 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.519 2021/01/30 21:03:32 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -2025,7 +2025,7 @@ execDie(const char *af, const char *av)
 	Buf_AddStr(, strerror(errno));
 	Buf_AddStr(, ")\n");
 
-	write_all(STDERR_FILENO, Buf_GetAll(, NULL), Buf_Len());
+	write_all(STDERR_FILENO, buf.data, Buf_Len());
 
 	Buf_Done();
 	_exit(1);

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.784 src/usr.bin/make/var.c:1.785
--- src/usr.bin/make/var.c:1.784	Sat Jan 30 20:53:29 2021
+++ src/usr.bin/make/var.c	Sat Jan 30 21:03:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.784 2021/01/30 20:53:29 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.785 2021/01/30 21:03:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.784 2021/01/30 20:53:29 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.785 2021/01/30 21:03:32 rillig Exp $");
 
 typedef enum VarFlags {
 	VAR_NONE	= 0,
@@ -1086,8 +1086,7 @@ Var_Append(const char *name, const char 
 		Buf_AddByte(>val, ' ');
 		Buf_AddStr(>val, val);
 
-		DEBUG3(VAR, "%s:%s = %s\n",
-		ctxt->name, name, Buf_GetAll(>val, NULL));
+		DEBUG3(VAR, "%s:%s = %s\n", ctxt->name, name, v->val.data);
 
 		if (v->flags & VAR_FROM_ENV) {
 			/*
@@ -1160,7 +1159,7 @@ Var_Value(const char *name, GNode *ctxt)
 	if (v == NULL)
 		return FStr_InitRefer(NULL);
 
-	value = Buf_GetAll(>val, NULL);
+	value = v->val.data;
 	return VarFreeEnv(v, FALSE)
 	? FStr_InitOwn(value)
 	: FStr_InitRefer(value);
@@ -1174,7 +1173,7 @@ const char *
 Var_ValueDirect(const char *name, GNode *ctxt)
 {
 	Var *v = VarFind(name, ctxt, FALSE);
-	return v 

CVS commit: src/usr.bin/make

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 20:59:29 UTC 2021

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

Log Message:
make(1): only clean up the Buffer data in CLEANUP mode

Cleaning up the members is only useful during debugging but not during
use in production.


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

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

Modified files:

Index: src/usr.bin/make/buf.c
diff -u src/usr.bin/make/buf.c:1.48 src/usr.bin/make/buf.c:1.49
--- src/usr.bin/make/buf.c:1.48	Sat Jan 30 20:53:29 2021
+++ src/usr.bin/make/buf.c	Sat Jan 30 20:59:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.c,v 1.48 2021/01/30 20:53:29 rillig Exp $	*/
+/*	$NetBSD: buf.c,v 1.49 2021/01/30 20:59:29 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -75,7 +75,7 @@
 #include "make.h"
 
 /*	"@(#)buf.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: buf.c,v 1.48 2021/01/30 20:53:29 rillig Exp $");
+MAKE_RCSID("$NetBSD: buf.c,v 1.49 2021/01/30 20:59:29 rillig Exp $");
 
 /* Make space in the buffer for adding at least 16 more bytes. */
 void
@@ -176,30 +176,34 @@ Buf_Init(Buffer *buf)
 
 /*
  * Free the data from the buffer.
- * The buffer is left in an indeterminate state.
+ * Leave the buffer itself in an indeterminate state.
  */
 void
 Buf_Done(Buffer *buf)
 {
 	free(buf->data);
 
+#ifdef CLEANUP
 	buf->cap = 0;
 	buf->len = 0;
 	buf->data = NULL;
+#endif
 }
 
 /*
  * Return the data from the buffer.
- * The buffer is left in an indeterminate state.
+ * Leave the buffer itself in an indeterminate state.
  */
 char *
 Buf_DoneData(Buffer *buf)
 {
 	char *data = buf->data;
 
+#ifdef CLEANUP
 	buf->cap = 0;
 	buf->len = 0;
 	buf->data = NULL;
+#endif
 
 	return data;
 }
@@ -209,7 +213,8 @@ Buf_DoneData(Buffer *buf)
 #endif
 
 /*
- * Reset the buffer and return its data.
+ * Return the data from the buffer.
+ * Leave the buffer itself in an indeterminate state.
  *
  * If the buffer size is much greater than its content,
  * a new buffer will be allocated and the old one freed.



CVS commit: src/usr.bin/make

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 20:53:29 UTC 2021

Modified Files:
src/usr.bin/make: buf.c buf.h cond.c dir.c for.c main.c parse.c var.c

Log Message:
make(1): split Buf_Destroy into Buf_Done and Buf_DoneData

In all cases except one, the boolean argument to Buf_Destroy was
constant.  Removing that argument by splitting the function into two
separate functions makes the intention clearer on the call site.  It
also removes the possibility for using the return value of Buf_Done,
which would have made no sense.

The function Buf_Done now pairs with Buf_Init, just as in HashTable and
Lst.

Even though Buf_Done is essentially a no-op, it is kept as a function,
both for symmetry with Buf_Init and for clearing the Buffer members
after use (this will be done only in CLEANUP mode, in a follow-up
commit).


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/make/buf.c
cvs rdiff -u -r1.38 -r1.39 src/usr.bin/make/buf.h
cvs rdiff -u -r1.253 -r1.254 src/usr.bin/make/cond.c
cvs rdiff -u -r1.264 -r1.265 src/usr.bin/make/dir.c
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/make/for.c
cvs rdiff -u -r1.517 -r1.518 src/usr.bin/make/main.c
cvs rdiff -u -r1.533 -r1.534 src/usr.bin/make/parse.c
cvs rdiff -u -r1.783 -r1.784 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/buf.c
diff -u src/usr.bin/make/buf.c:1.47 src/usr.bin/make/buf.c:1.48
--- src/usr.bin/make/buf.c:1.47	Wed Dec 30 10:03:16 2020
+++ src/usr.bin/make/buf.c	Sat Jan 30 20:53:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.c,v 1.47 2020/12/30 10:03:16 rillig Exp $	*/
+/*	$NetBSD: buf.c,v 1.48 2021/01/30 20:53:29 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -75,7 +75,7 @@
 #include "make.h"
 
 /*	"@(#)buf.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: buf.c,v 1.47 2020/12/30 10:03:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: buf.c,v 1.48 2021/01/30 20:53:29 rillig Exp $");
 
 /* Make space in the buffer for adding at least 16 more bytes. */
 void
@@ -175,18 +175,27 @@ Buf_Init(Buffer *buf)
 }
 
 /*
- * Reset the buffer.
- * If freeData is TRUE, the data from the buffer is freed as well.
- * Otherwise it is kept and returned.
+ * Free the data from the buffer.
+ * The buffer is left in an indeterminate state.
+ */
+void
+Buf_Done(Buffer *buf)
+{
+	free(buf->data);
+
+	buf->cap = 0;
+	buf->len = 0;
+	buf->data = NULL;
+}
+
+/*
+ * Return the data from the buffer.
+ * The buffer is left in an indeterminate state.
  */
 char *
-Buf_Destroy(Buffer *buf, Boolean freeData)
+Buf_DoneData(Buffer *buf)
 {
 	char *data = buf->data;
-	if (freeData) {
-		free(data);
-		data = NULL;
-	}
 
 	buf->cap = 0;
 	buf->len = 0;
@@ -206,16 +215,16 @@ Buf_Destroy(Buffer *buf, Boolean freeDat
  * a new buffer will be allocated and the old one freed.
  */
 char *
-Buf_DestroyCompact(Buffer *buf)
+Buf_DoneDataCompact(Buffer *buf)
 {
 #if BUF_COMPACT_LIMIT > 0
 	if (buf->cap - buf->len >= BUF_COMPACT_LIMIT) {
 		/* We trust realloc to be smart */
 		char *data = bmake_realloc(buf->data, buf->len + 1);
 		data[buf->len] = '\0';	/* XXX: unnecessary */
-		Buf_Destroy(buf, FALSE);
+		Buf_DoneData(buf);
 		return data;
 	}
 #endif
-	return Buf_Destroy(buf, FALSE);
+	return Buf_DoneData(buf);
 }

Index: src/usr.bin/make/buf.h
diff -u src/usr.bin/make/buf.h:1.38 src/usr.bin/make/buf.h:1.39
--- src/usr.bin/make/buf.h:1.38	Mon Dec 28 15:42:53 2020
+++ src/usr.bin/make/buf.h	Sat Jan 30 20:53:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.h,v 1.38 2020/12/28 15:42:53 rillig Exp $	*/
+/*	$NetBSD: buf.h,v 1.39 2021/01/30 20:53:29 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -126,7 +126,8 @@ char *Buf_GetAll(Buffer *, size_t *);
 void Buf_Empty(Buffer *);
 void Buf_Init(Buffer *);
 void Buf_InitSize(Buffer *, size_t);
-char *Buf_Destroy(Buffer *, Boolean);
-char *Buf_DestroyCompact(Buffer *);
+void Buf_Done(Buffer *);
+char *Buf_DoneData(Buffer *);
+char *Buf_DoneDataCompact(Buffer *);
 
 #endif /* MAKE_BUF_H */

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.253 src/usr.bin/make/cond.c:1.254
--- src/usr.bin/make/cond.c:1.253	Fri Jan 22 00:12:01 2021
+++ src/usr.bin/make/cond.c	Sat Jan 30 20:53:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.253 2021/01/22 00:12:01 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.254 2021/01/30 20:53:29 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.253 2021/01/22 00:12:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.254 2021/01/30 20:53:29 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -282,8 +282,8 @@ ParseFuncArg(CondParser *par, const char
 		p++;
 	}
 
-	

CVS commit: src/share/misc

2021-01-30 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Jan 30 19:20:44 UTC 2021

Modified Files:
src/share/misc: acronyms.comp

Log Message:
Add a few network interface offload feature initialisms


To generate a diff of this commit:
cvs rdiff -u -r1.319 -r1.320 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.319 src/share/misc/acronyms.comp:1.320
--- src/share/misc/acronyms.comp:1.319	Thu Jan 21 18:09:10 2021
+++ src/share/misc/acronyms.comp	Sat Jan 30 19:20:44 2021
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.319 2021/01/21 18:09:10 kamil Exp $
+$NetBSD: acronyms.comp,v 1.320 2021/01/30 19:20:44 jakllsch Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -651,7 +651,9 @@ GPT	GUID partition table
 GPU	graphics processing unit
 GR	golden ratio
 GRE	generic routing encapsulation
+GRO	generic receive offload
 GSI	global system interrupt
+GSO	generic send offload
 GUI	graphical user interface
 GUID	globally unique identifier
 GVFSgit virtual file system
@@ -1375,6 +1377,7 @@ RSA	Rivest, Shamir, [and] Adleman
 RSIP	Realm Specific IP
 RSN	Robust Secure Network
 RSS	really simple syndication
+RSS	Receive Side Scaling
 RSS	residual sum of squares
 RSTP	Rapid Spanning Tree Protocol
 RT	real time
@@ -1630,6 +1633,7 @@ TMG	transmogrifier
 TMDS	transition minimized differential signaling
 TMO	timeout
 TOD	time of day
+TOE	TCP offload engine
 TOFU	trust on first use
 TOS	terms of service
 TOS	trusted operating system
@@ -1655,6 +1659,7 @@ TSD	time stamp disable
 TSDB	time series database
 TSL	test, set, lock
 TSO	time sharing option
+TSO	TCP segmentation offload
 TSO	Total Store Ordering
 TSP	Time-Stamp Protocol
 TSP	Tunnel Setup Protocol
@@ -1685,6 +1690,7 @@ UDMA	ultra DMA
 UDO	ultra density optical
 UDP	User Datagram Protocol
 UEFI	unified extensible firmware interface
+UFO	UDP fragmentation offload
 UFS	Unix File System
 UGA	universal graphics adapter
 UI	unit interval



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

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 18:16:45 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: decl.c externs1.h func.c init.c tree.c

Log Message:
lint: rename incompl to is_incomplete

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.65 -r1.66 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.193 -r1.194 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.131 src/usr.bin/xlint/lint1/decl.c:1.132
--- src/usr.bin/xlint/lint1/decl.c:1.131	Sun Jan 24 00:15:20 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sat Jan 30 18:16:45 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.131 2021/01/24 00:15:20 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.132 2021/01/30 18:16:45 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.131 2021/01/24 00:15:20 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.132 2021/01/30 18:16:45 rillig Exp $");
 #endif
 
 #include 
@@ -172,7 +172,7 @@ tduptyp(const type_t *tp)
  * struct, union or enum type.
  */
 bool
-incompl(const type_t *tp)
+is_incomplete(const type_t *tp)
 {
 	tspec_t	t;
 
@@ -903,14 +903,14 @@ length(const type_t *tp, const char *nam
 		/* NOTREACHED */
 	case STRUCT:
 	case UNION:
-		if (incompl(tp) && name != NULL) {
+		if (is_incomplete(tp) && name != NULL) {
 			/* incomplete structure or union %s: %s */
 			error(31, tp->t_str->stag->s_name, name);
 		}
 		elsz = tp->t_str->size;
 		break;
 	case ENUM:
-		if (incompl(tp) && name != NULL) {
+		if (is_incomplete(tp) && name != NULL) {
 			/* incomplete enum type: %s */
 			warning(13, name);
 		}
@@ -1034,7 +1034,7 @@ check_type(sym_t *sym)
 error(18);
 *tpp = gettyp(INT);
 #if 0	/* errors are produced by length() */
-			} else if (incompl(tp)) {
+			} else if (is_incomplete(tp)) {
 /* array of incomplete type */
 if (sflag) {
 	/* array of incomplete type */
@@ -1724,7 +1724,7 @@ newtag(sym_t *tag, scl_t scl, bool decl,
 			print_previous_declaration(-1, tag);
 			tag = pushdown(tag);
 			dcs->d_next->d_nedecl = true;
-		} else if (decl && !incompl(tag->s_type)) {
+		} else if (decl && !is_incomplete(tag->s_type)) {
 			/* (%s) tag redeclared */
 			error(46, storage_class_name(tag->s_scl));
 			print_previous_declaration(-1, tag);
@@ -3071,7 +3071,7 @@ static void
 check_tag_usage(sym_t *sym)
 {
 
-	if (!incompl(sym->s_type))
+	if (!is_incomplete(sym->s_type))
 		return;
 
 	/* always complain about incomplete tags declared inside blocks */

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.63 src/usr.bin/xlint/lint1/externs1.h:1.64
--- src/usr.bin/xlint/lint1/externs1.h:1.63	Sun Jan 24 09:25:16 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Jan 30 18:16:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.63 2021/01/24 09:25:16 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.64 2021/01/30 18:16:45 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -141,7 +141,7 @@ extern	void	initdecl(void);
 extern	type_t	*gettyp(tspec_t);
 extern	type_t	*duptyp(const type_t *);
 extern	type_t	*tduptyp(const type_t *);
-extern	bool	incompl(const type_t *);
+extern	bool	is_incomplete(const type_t *);
 extern	void	setcomplete(type_t *, bool);
 extern	void	add_storage_class(scl_t);
 extern	void	add_type(type_t *);

Index: src/usr.bin/xlint/lint1/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.65 src/usr.bin/xlint/lint1/func.c:1.66
--- src/usr.bin/xlint/lint1/func.c:1.65	Sat Jan 23 22:20:17 2021
+++ src/usr.bin/xlint/lint1/func.c	Sat Jan 30 18:16:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: func.c,v 1.65 2021/01/23 22:20:17 rillig Exp $	*/
+/*	$NetBSD: func.c,v 1.66 2021/01/30 18:16:45 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.65 2021/01/23 22:20:17 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.66 2021/01/30 18:16:45 rillig Exp $");
 #endif
 
 #include 
@@ -245,7 +245,7 @@ funcdef(sym_t *fsym)
 	 * incomplete return values (these are allowed in declarations)
 	 */
 	if (fsym->s_type->t_subt->t_tspec != VOID &&
-	incompl(fsym->s_type->t_subt)) {
+	is_incomplete(fsym->s_type->t_subt)) {
 		/* cannot return incomplete type */
 		error(67);
 	}

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.64 src/usr.bin/xlint/lint1/init.c:1.65
--- src/usr.bin/xlint/lint1/init.c:1.64	Sun Jan 17 15:40:27 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Jan 30 18:16:45 2021
@@ -1,4 +1,4 @@

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

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 18:14:25 UTC 2021

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

Log Message:
lint: fix type conversion for very large data types

Data types that are 4 GB or larger are an edge case.  Nevertheless,
compute their size correctly.


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

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

Modified files:

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.192 src/usr.bin/xlint/lint1/tree.c:1.193
--- src/usr.bin/xlint/lint1/tree.c:1.192	Sat Jan 30 18:12:07 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jan 30 18:14:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.192 2021/01/30 18:12:07 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.193 2021/01/30 18:14:25 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.192 2021/01/30 18:12:07 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.193 2021/01/30 18:14:25 rillig Exp $");
 #endif
 
 #include 
@@ -3381,8 +3381,7 @@ tsize(type_t *tp)
 		break;
 	}
 
-	/* XXX: type conversion is too late */
-	return (int64_t)(elem * elsz);
+	return (int64_t)elem * elsz;
 }
 
 tnode_t *



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

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 18:12:07 UTC 2021

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

Log Message:
lint: remove redundant parentheses

No functional change.


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

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

Modified files:

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.191 src/usr.bin/xlint/lint1/tree.c:1.192
--- src/usr.bin/xlint/lint1/tree.c:1.191	Sun Jan 24 14:47:43 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jan 30 18:12:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.191 2021/01/24 14:47:43 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.192 2021/01/30 18:12:07 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.191 2021/01/24 14:47:43 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.192 2021/01/30 18:12:07 rillig Exp $");
 #endif
 
 #include 
@@ -3256,22 +3256,22 @@ fold_float(tnode_t *tn)
 		v->v_ldbl = l - r;
 		break;
 	case LT:
-		v->v_quad = (l < r) ? 1 : 0;
+		v->v_quad = l < r ? 1 : 0;
 		break;
 	case LE:
-		v->v_quad = (l <= r) ? 1 : 0;
+		v->v_quad = l <= r ? 1 : 0;
 		break;
 	case GE:
-		v->v_quad = (l >= r) ? 1 : 0;
+		v->v_quad = l >= r ? 1 : 0;
 		break;
 	case GT:
-		v->v_quad = (l > r) ? 1 : 0;
+		v->v_quad = l > r ? 1 : 0;
 		break;
 	case EQ:
-		v->v_quad = (l == r) ? 1 : 0;
+		v->v_quad = l == r ? 1 : 0;
 		break;
 	case NE:
-		v->v_quad = (l != r) ? 1 : 0;
+		v->v_quad = l != r ? 1 : 0;
 		break;
 	default:
 		lint_assert(/*CONSTCOND*/false);



CVS commit: src

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 17:56:29 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_189.c msg_189.exp msg_191.c
msg_191.exp msg_192.c msg_192.exp msg_193.c msg_193.exp msg_194.c
msg_194.exp msg_231.c msg_231.exp
src/usr.bin/xlint/lint1: err.c

Log Message:
lint: remove message 189, add tests for a few other messages

Message 189 would have applied to traditional C and was supposed to
detect assignments between struct and union types.  The corresponding
check had never been implemented though.

Traditional C has been superseded for 30 years now, therefore there is no
point in adding this check retroactively.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_189.c \
src/tests/usr.bin/xlint/lint1/msg_189.exp \
src/tests/usr.bin/xlint/lint1/msg_191.c \
src/tests/usr.bin/xlint/lint1/msg_191.exp \
src/tests/usr.bin/xlint/lint1/msg_192.c \
src/tests/usr.bin/xlint/lint1/msg_192.exp \
src/tests/usr.bin/xlint/lint1/msg_193.c \
src/tests/usr.bin/xlint/lint1/msg_193.exp \
src/tests/usr.bin/xlint/lint1/msg_194.c \
src/tests/usr.bin/xlint/lint1/msg_194.exp \
src/tests/usr.bin/xlint/lint1/msg_231.c \
src/tests/usr.bin/xlint/lint1/msg_231.exp
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/xlint/lint1/err.c

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/msg_189.c
diff -u src/tests/usr.bin/xlint/lint1/msg_189.c:1.1 src/tests/usr.bin/xlint/lint1/msg_189.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_189.c:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_189.c	Sat Jan 30 17:56:29 2021
@@ -1,7 +1,19 @@
-/*	$NetBSD: msg_189.c,v 1.1 2021/01/02 10:22:43 rillig Exp $	*/
+/*	$NetBSD: msg_189.c,v 1.2 2021/01/30 17:56:29 rillig Exp $	*/
 # 3 "msg_189.c"
 
-// Test for message: assignment of struct/union illegal in traditional C [189]
+/* Test for message: assignment of struct/union illegal in traditional C [189] */
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+/* lint1-flags: -tw */
+
+struct s {
+	int member;
+};
+
+void
+example()
+{
+	struct s a, b;
+
+	a.member = 3;
+	b = a;			/* message 189 is not triggered anymore */
+}
Index: src/tests/usr.bin/xlint/lint1/msg_189.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_189.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_189.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_189.exp:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_189.exp	Sat Jan 30 17:56:29 2021
@@ -1 +1,7 @@
-msg_189.c(6): syntax error ':' [249]
+(1): warning: 'long double' is illegal in traditional C [266]
+(1): warning: function prototypes are illegal in traditional C [270]
+(2): warning: 'long double' is illegal in traditional C [266]
+(2): warning: function prototypes are illegal in traditional C [270]
+(3): warning: 'long double' is illegal in traditional C [266]
+(3): warning: 'long double' is illegal in traditional C [266]
+(3): warning: function prototypes are illegal in traditional C [270]
Index: src/tests/usr.bin/xlint/lint1/msg_191.c
diff -u src/tests/usr.bin/xlint/lint1/msg_191.c:1.1 src/tests/usr.bin/xlint/lint1/msg_191.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_191.c:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_191.c	Sat Jan 30 17:56:29 2021
@@ -1,7 +1,14 @@
-/*	$NetBSD: msg_191.c,v 1.1 2021/01/02 10:22:43 rillig Exp $	*/
+/*	$NetBSD: msg_191.c,v 1.2 2021/01/30 17:56:29 rillig Exp $	*/
 # 3 "msg_191.c"
 
 // Test for message: %s set but not used in function %s [191]
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+void
+example(void)
+{
+	int local;
+
+	local = 3;		/* expect: 191 */
+
+	local = 5;
+}
Index: src/tests/usr.bin/xlint/lint1/msg_191.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_191.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_191.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_191.exp:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_191.exp	Sat Jan 30 17:56:29 2021
@@ -1 +1 @@
-msg_191.c(6): syntax error ':' [249]
+msg_191.c(11): warning: local set but not used in function example [191]
Index: src/tests/usr.bin/xlint/lint1/msg_192.c
diff -u src/tests/usr.bin/xlint/lint1/msg_192.c:1.1 src/tests/usr.bin/xlint/lint1/msg_192.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_192.c:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_192.c	Sat Jan 30 17:56:29 2021
@@ -1,7 +1,10 @@
-/*	$NetBSD: msg_192.c,v 1.1 2021/01/02 10:22:43 rillig Exp $	*/
+/*	$NetBSD: msg_192.c,v 1.2 2021/01/30 17:56:29 rillig Exp $	*/
 # 3 "msg_192.c"
 
 // Test for message: %s unused in function %s [192]
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers 

CVS commit: src/sys/dev/i2c

2021-01-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 30 17:38:57 UTC 2021

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

Log Message:
Add the standard compat string from the Device Tree bindings.


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

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

Modified files:

Index: src/sys/dev/i2c/s390.c
diff -u src/sys/dev/i2c/s390.c:1.6 src/sys/dev/i2c/s390.c:1.7
--- src/sys/dev/i2c/s390.c:1.6	Thu Jan  2 19:00:34 2020
+++ src/sys/dev/i2c/s390.c	Sat Jan 30 17:38:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: s390.c,v 1.6 2020/01/02 19:00:34 thorpej Exp $	*/
+/*	$NetBSD: s390.c,v 1.7 2021/01/30 17:38:57 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2011 Frank Wille.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: s390.c,v 1.6 2020/01/02 19:00:34 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: s390.c,v 1.7 2021/01/30 17:38:57 thorpej Exp $");
 
 #include 
 #include 
@@ -62,13 +62,18 @@ static int s390rtc_read(struct s390rtc_s
 static int s390rtc_write(struct s390rtc_softc *, int, uint8_t *, size_t);
 static uint8_t bitreverse(uint8_t);
 
+static const struct device_compatible_entry compat_data[] = {
+	{ .compat = "sii,s35390a" },
+	DEVICE_COMPAT_EOL
+};
+
 static int
 s390rtc_match(device_t parent, cfdata_t cf, void *arg)
 {
 	struct i2c_attach_args *ia = arg;
 	int match_result;
 
-	if (iic_use_direct_match(ia, cf, NULL, _result))
+	if (iic_use_direct_match(ia, cf, compat_data, _result))
 		return match_result;
 	
 	/* indirect config - check typical address */



CVS commit: src/sys/dev/i2c

2021-01-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 30 17:38:28 UTC 2021

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

Log Message:
Add standard compat strings from the Device Tree bindings.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/i2c/rs5c372.c

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

Modified files:

Index: src/sys/dev/i2c/rs5c372.c
diff -u src/sys/dev/i2c/rs5c372.c:1.16 src/sys/dev/i2c/rs5c372.c:1.17
--- src/sys/dev/i2c/rs5c372.c:1.16	Thu Jan  2 17:17:36 2020
+++ src/sys/dev/i2c/rs5c372.c	Sat Jan 30 17:38:27 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rs5c372.c,v 1.16 2020/01/02 17:17:36 thorpej Exp $	*/
+/*	$NetBSD: rs5c372.c,v 1.17 2021/01/30 17:38:27 thorpej Exp $	*/
 
 /*-
  * Copyright (C) 2005 NONAKA Kimihiro 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rs5c372.c,v 1.16 2020/01/02 17:17:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rs5c372.c,v 1.17 2021/01/30 17:38:27 thorpej Exp $");
 
 #include 
 #include 
@@ -61,13 +61,19 @@ static int rs5c372rtc_clock_write(struct
 static int rs5c372rtc_gettime_ymdhms(todr_chip_handle_t, struct clock_ymdhms *);
 static int rs5c372rtc_settime_ymdhms(todr_chip_handle_t, struct clock_ymdhms *);
 
+static const struct device_compatible_entry compat_data[] = {
+	{ .compat = "ricoh,rs5c372a" },
+	{ .compat = "ricoh,rs5c372b" },
+	DEVICE_COMPAT_EOL
+};
+
 static int
 rs5c372rtc_match(device_t parent, cfdata_t cf, void *arg)
 {
 	struct i2c_attach_args *ia = arg;
 	int match_result;
 
-	if (iic_use_direct_match(ia, cf, NULL, _result))
+	if (iic_use_direct_match(ia, cf, compat_data, _result))
 		return match_result;
 
 	/* indirect config - check typical address */



CVS commit: src/sys/dev/i2c

2021-01-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 30 17:37:25 UTC 2021

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

Log Message:
Add the standard compat string from the Device Tree bindings.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/dstemp.c

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

Modified files:

Index: src/sys/dev/i2c/dstemp.c
diff -u src/sys/dev/i2c/dstemp.c:1.10 src/sys/dev/i2c/dstemp.c:1.11
--- src/sys/dev/i2c/dstemp.c:1.10	Sat Jan 30 01:22:06 2021
+++ src/sys/dev/i2c/dstemp.c	Sat Jan 30 17:37:25 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: dstemp.c,v 1.10 2021/01/30 01:22:06 thorpej Exp $ */
+/* $NetBSD: dstemp.c,v 1.11 2021/01/30 17:37:25 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2018 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dstemp.c,v 1.10 2021/01/30 01:22:06 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dstemp.c,v 1.11 2021/01/30 17:37:25 thorpej Exp $");
 
 #include 
 #include 
@@ -78,6 +78,7 @@ CFATTACH_DECL_NEW(dstemp, sizeof(struct 
 dstemp_match, dstemp_attach, NULL, NULL);
 
 static const struct device_compatible_entry compat_data[] = {
+	{ .compat = "dallas,ds1631" },
 	{ .compat = "ds1631" },
 	DEVICE_COMPAT_EOL
 };



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

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 17:02:58 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_216.c msg_216.exp msg_217.c
msg_217.exp msg_220.c msg_220.exp msg_223.c msg_223.exp msg_224.c
msg_224.exp

Log Message:
lint: add tests that trigger a few more messages


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_216.c \
src/tests/usr.bin/xlint/lint1/msg_216.exp \
src/tests/usr.bin/xlint/lint1/msg_217.c \
src/tests/usr.bin/xlint/lint1/msg_217.exp \
src/tests/usr.bin/xlint/lint1/msg_220.c \
src/tests/usr.bin/xlint/lint1/msg_220.exp \
src/tests/usr.bin/xlint/lint1/msg_223.c \
src/tests/usr.bin/xlint/lint1/msg_223.exp \
src/tests/usr.bin/xlint/lint1/msg_224.c \
src/tests/usr.bin/xlint/lint1/msg_224.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/msg_216.c
diff -u src/tests/usr.bin/xlint/lint1/msg_216.c:1.1 src/tests/usr.bin/xlint/lint1/msg_216.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_216.c:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_216.c	Sat Jan 30 17:02:58 2021
@@ -1,7 +1,13 @@
-/*	$NetBSD: msg_216.c,v 1.1 2021/01/02 10:22:44 rillig Exp $	*/
+/*	$NetBSD: msg_216.c,v 1.2 2021/01/30 17:02:58 rillig Exp $	*/
 # 3 "msg_216.c"
 
 // Test for message: function %s has return (e); and return; [216]
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+/* implicit int */
+random(int n)
+{
+	if (n < 0)
+		return -3;
+	if (n < 2)
+		return;
+}/* expect: 216 */
Index: src/tests/usr.bin/xlint/lint1/msg_216.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_216.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_216.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_216.exp:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_216.exp	Sat Jan 30 17:02:58 2021
@@ -1 +1 @@
-msg_216.c(6): syntax error ':' [249]
+msg_216.c(13): warning: function random has return (e); and return; [216]
Index: src/tests/usr.bin/xlint/lint1/msg_217.c
diff -u src/tests/usr.bin/xlint/lint1/msg_217.c:1.1 src/tests/usr.bin/xlint/lint1/msg_217.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_217.c:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_217.c	Sat Jan 30 17:02:58 2021
@@ -1,7 +1,11 @@
-/*	$NetBSD: msg_217.c,v 1.1 2021/01/02 10:22:44 rillig Exp $	*/
+/*	$NetBSD: msg_217.c,v 1.2 2021/01/30 17:02:58 rillig Exp $	*/
 # 3 "msg_217.c"
 
 // Test for message: function %s falls off bottom without returning value [217]
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+int
+random(int n)
+{
+	if (n < 0)
+		return -3;
+}/* expect: 217 */
Index: src/tests/usr.bin/xlint/lint1/msg_217.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_217.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_217.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_217.exp:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_217.exp	Sat Jan 30 17:02:58 2021
@@ -1 +1 @@
-msg_217.c(6): syntax error ':' [249]
+msg_217.c(11): warning: function random falls off bottom without returning value [217]
Index: src/tests/usr.bin/xlint/lint1/msg_220.c
diff -u src/tests/usr.bin/xlint/lint1/msg_220.c:1.1 src/tests/usr.bin/xlint/lint1/msg_220.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_220.c:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_220.c	Sat Jan 30 17:02:58 2021
@@ -1,7 +1,25 @@
-/*	$NetBSD: msg_220.c,v 1.1 2021/01/02 10:22:44 rillig Exp $	*/
+/*	$NetBSD: msg_220.c,v 1.2 2021/01/30 17:02:58 rillig Exp $	*/
 # 3 "msg_220.c"
 
 // Test for message: fallthrough on case statement [220]
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+/* lint1-extra-flags: -h */
+
+extern void
+println(const char *);
+
+void
+example(int n)
+{
+	switch (n) {
+	case 1:
+	case 3:
+	case 5:
+		println("odd");
+	case 2:			/* expect: 220 */
+	case 7:
+		println("prime");
+	default:		/* expect: 284 */
+		println("number");
+	}
+}
Index: src/tests/usr.bin/xlint/lint1/msg_220.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_220.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_220.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_220.exp:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_220.exp	Sat Jan 30 17:02:58 2021
@@ -1 +1,2 @@
-msg_220.c(6): syntax error ':' [249]
+msg_220.c(19): warning: fallthrough on case statement [220]
+msg_220.c(22): warning: fallthrough on default statement [284]
Index: src/tests/usr.bin/xlint/lint1/msg_223.c
diff -u src/tests/usr.bin/xlint/lint1/msg_223.c:1.1 src/tests/usr.bin/xlint/lint1/msg_223.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_223.c:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_223.c	Sat Jan 

CVS commit: src/usr.bin/make

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 16:05:45 UTC 2021

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

Log Message:
make(1): run lint with strict bool mode

The make code is not supposed to use constructs such as "if (strcmp(s1,
s2))" or "if (p && *p)", instead all boolean expressions have a form
that would be accepted by a C#, Go or Java compiler as well.  This also
ensures that pre-C99 compilers generate equivalent code as C99
compilers, at least regarding boolean expressions.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/usr.bin/make/Makefile

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

Modified files:

Index: src/usr.bin/make/Makefile
diff -u src/usr.bin/make/Makefile:1.111 src/usr.bin/make/Makefile:1.112
--- src/usr.bin/make/Makefile:1.111	Sat Dec 12 16:54:20 2020
+++ src/usr.bin/make/Makefile	Sat Jan 30 16:05:45 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.111 2020/12/12 16:54:20 rillig Exp $
+#	$NetBSD: Makefile,v 1.112 2021/01/30 16:05:45 rillig Exp $
 #	@(#)Makefile	5.2 (Berkeley) 12/28/90
 
 PROG=	make
@@ -127,6 +127,8 @@ SUBDIR.roff+=	PSD.doc
 SUBDIR+=	unit-tests
 .endif
 
+LINTFLAGS+=	-T	# strict bool mode, available since 2021-01-11
+
 ${SRCS:M*.c:.c=.o}: ${HDRS}
 CLEANFILES+=	*.o
 



CVS commit: src/usr.bin/make

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 15:53:55 UTC 2021

Modified Files:
src/usr.bin/make: enum.h

Log Message:
make(1): fix lint warning about empty declarations


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/make/enum.h

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

Modified files:

Index: src/usr.bin/make/enum.h
diff -u src/usr.bin/make/enum.h:1.15 src/usr.bin/make/enum.h:1.16
--- src/usr.bin/make/enum.h:1.15	Sat Jan 30 15:48:42 2021
+++ src/usr.bin/make/enum.h	Sat Jan 30 15:53:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: enum.h,v 1.15 2021/01/30 15:48:42 rillig Exp $	*/
+/*	$NetBSD: enum.h,v 1.16 2021/01/30 15:53:55 rillig Exp $	*/
 
 /*
  Copyright (c) 2020 Roland Illig 
@@ -104,7 +104,7 @@ const char *Enum_ValueToString(int, cons
 #define ENUM__VALUE_RTTI(typnam, specs) \
 	static const EnumToStringSpec typnam ## _ ## ToStringSpecs[] = specs; \
 	MAKE_INLINE const char *typnam ## _ToString(typnam value) \
-	{ return Enum_ValueToString(value, typnam ## _ ## ToStringSpecs); }; \
+	{ return Enum_ValueToString(value, typnam ## _ ## ToStringSpecs); } \
 	extern void enum_value_rtti_dummy(void)
 
 
@@ -115,7 +115,7 @@ const char *Enum_ValueToString(int, cons
 	MAKE_INLINE const char *typnam ## _ToString(char *buf, typnam value) \
 	{ return Enum_FlagsToString(buf, typnam ## _ ## ToStringSize, \
 	value, typnam ## _ ## ToStringSpecs); \
-	}; \
+	} \
 	extern void enum_flags_rtti_dummy(void)
 
 /*



CVS commit: src/usr.bin/make

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 15:48:42 UTC 2021

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

Log Message:
make(1): reduce boilerplate for printing bit sets in debug mode

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/enum.h
cvs rdiff -u -r1.235 -r1.236 src/usr.bin/make/make.c
cvs rdiff -u -r1.340 -r1.341 src/usr.bin/make/suff.c
cvs rdiff -u -r1.782 -r1.783 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/enum.h
diff -u src/usr.bin/make/enum.h:1.14 src/usr.bin/make/enum.h:1.15
--- src/usr.bin/make/enum.h:1.14	Wed Dec 30 10:03:16 2020
+++ src/usr.bin/make/enum.h	Sat Jan 30 15:48:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: enum.h,v 1.14 2020/12/30 10:03:16 rillig Exp $	*/
+/*	$NetBSD: enum.h,v 1.15 2021/01/30 15:48:42 rillig Exp $	*/
 
 /*
  Copyright (c) 2020 Roland Illig 
@@ -102,12 +102,21 @@ const char *Enum_ValueToString(int, cons
 
 /* Declare the necessary data structures for calling Enum_ValueToString. */
 #define ENUM__VALUE_RTTI(typnam, specs) \
-	static const EnumToStringSpec typnam ## _ ## ToStringSpecs[] = specs
+	static const EnumToStringSpec typnam ## _ ## ToStringSpecs[] = specs; \
+	MAKE_INLINE const char *typnam ## _ToString(typnam value) \
+	{ return Enum_ValueToString(value, typnam ## _ ## ToStringSpecs); }; \
+	extern void enum_value_rtti_dummy(void)
+
 
 /* Declare the necessary data structures for calling Enum_FlagsToString. */
 #define ENUM__FLAGS_RTTI(typnam, specs, joined) \
 	static const EnumToStringSpec typnam ## _ ## ToStringSpecs[] = specs; \
-	enum { typnam ## _ ## ToStringSize = sizeof joined }
+	enum { typnam ## _ ## ToStringSize = sizeof (joined) }; \
+	MAKE_INLINE const char *typnam ## _ToString(char *buf, typnam value) \
+	{ return Enum_FlagsToString(buf, typnam ## _ ## ToStringSize, \
+	value, typnam ## _ ## ToStringSpecs); \
+	}; \
+	extern void enum_flags_rtti_dummy(void)
 
 /*
  * Declare the necessary data structures for calling Enum_FlagsToString

Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.235 src/usr.bin/make/make.c:1.236
--- src/usr.bin/make/make.c:1.235	Sat Jan 16 20:49:31 2021
+++ src/usr.bin/make/make.c	Sat Jan 30 15:48:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.235 2021/01/16 20:49:31 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.236 2021/01/30 15:48:42 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -103,7 +103,7 @@
 #include "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.235 2021/01/16 20:49:31 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.236 2021/01/30 15:48:42 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -166,11 +166,9 @@ GNode_FprintDetails(FILE *f, const char 
 
 	fprintf(f, "%smade %s, type %s, flags %s%s",
 	prefix,
-	Enum_ValueToString(gn->made, GNodeMade_ToStringSpecs),
-	Enum_FlagsToString(type_buf, sizeof type_buf,
-		gn->type, GNodeType_ToStringSpecs),
-	Enum_FlagsToString(flags_buf, sizeof flags_buf,
-		gn->flags, GNodeFlags_ToStringSpecs),
+	GNodeMade_ToString(gn->made),
+	GNodeType_ToString(type_buf, gn->type),
+	GNodeFlags_ToString(flags_buf, gn->flags),
 	suffix);
 }
 

Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.340 src/usr.bin/make/suff.c:1.341
--- src/usr.bin/make/suff.c:1.340	Sun Jan 24 20:11:55 2021
+++ src/usr.bin/make/suff.c	Sat Jan 30 15:48:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.340 2021/01/24 20:11:55 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.341 2021/01/30 15:48:42 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.340 2021/01/24 20:11:55 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.341 2021/01/30 15:48:42 rillig Exp $");
 
 typedef List SuffixList;
 typedef ListNode SuffixListNode;
@@ -2137,9 +2137,7 @@ Suffix_Print(Suffix *suff)
 		char flags_buf[SuffixFlags_ToStringSize];
 
 		debug_printf(" (%s)",
-		Enum_FlagsToString(flags_buf, sizeof flags_buf,
-			suff->flags,
-			SuffixFlags_ToStringSpecs));
+		SuffixFlags_ToString(flags_buf, suff->flags));
 	}
 	debug_printf("\n");
 

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.782 src/usr.bin/make/var.c:1.783
--- src/usr.bin/make/var.c:1.782	Sat Jan 16 20:49:31 2021
+++ src/usr.bin/make/var.c	Sat Jan 30 15:48:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.782 2021/01/16 20:49:31 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.783 2021/01/30 15:48:42 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.782 2021/01/16 20:49:31 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.783 

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

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 13:50:18 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: lint.mk

Log Message:
make(1): update documentation of test lint.mk


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/lint.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/lint.mk
diff -u src/usr.bin/make/unit-tests/lint.mk:1.3 src/usr.bin/make/unit-tests/lint.mk:1.4
--- src/usr.bin/make/unit-tests/lint.mk:1.3	Tue Sep 15 16:22:04 2020
+++ src/usr.bin/make/unit-tests/lint.mk	Sat Jan 30 13:50:18 2021
@@ -1,10 +1,13 @@
-# $NetBSD: lint.mk,v 1.3 2020/09/15 16:22:04 rillig Exp $
+# $NetBSD: lint.mk,v 1.4 2021/01/30 13:50:18 rillig Exp $
 #
-# Demonstrates stricter checks that are only enabled in the lint mode,
-# using the -dL option.
+# Demonstrates stricter checks that are only enabled in lint mode, using the
+# option -dL.
 
-# Ouch: as of 2020-08-03, make exits successfully even though the error
-# message has been issued as PARSE_FATAL.
+# Before main.c 1.421 from 2020-11-01, make exited successfully even though
+# the error message had been issued as PARSE_FATAL.  This was because back
+# then, make checked for parse errors only after parsing each top-level
+# makefile, in Parse_File.  After that, when expanding variable expressions
+# in shell commands, the parse errors were not checked again.
 
 # Ouch: as of 2020-08-03, the variable is malformed and parsing stops
 # for a moment, but is continued after the wrongly-guessed end of the



CVS commit: src/usr.bin/make

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 13:12:00 UTC 2021

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

Log Message:
make(1): clean up JobWriteShellCommands


To generate a diff of this commit:
cvs rdiff -u -r1.403 -r1.404 src/usr.bin/make/job.c

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

Modified files:

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.403 src/usr.bin/make/job.c:1.404
--- src/usr.bin/make/job.c:1.403	Sat Jan 30 13:02:54 2021
+++ src/usr.bin/make/job.c	Sat Jan 30 13:12:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.403 2021/01/30 13:02:54 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.404 2021/01/30 13:12:00 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.403 2021/01/30 13:02:54 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.404 2021/01/30 13:12:00 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -1593,11 +1593,6 @@ JobWriteShellCommands(Job *job, GNode *g
 		Punt("Could not fdopen %s", tfile);
 
 	(void)fcntl(fileno(job->cmdFILE), F_SETFD, FD_CLOEXEC);
-	/*
-	 * Send the commands to the command file, flush all its
-	 * buffers then rewind and remove the thing.
-	 */
-	*out_run = TRUE;
 
 #ifdef USE_META
 	if (useMeta) {
@@ -1607,9 +1602,7 @@ JobWriteShellCommands(Job *job, GNode *g
 	}
 #endif
 
-	/* We can do all the commands at once. hooray for sanity */
-	if (!JobPrintCommands(job))
-		*out_run = FALSE;
+	*out_run = JobPrintCommands(job);
 
 	free(tfile);
 }



CVS commit: src/usr.bin/make

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 13:02:54 UTC 2021

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

Log Message:
make(1): clean up comments in JobSaveCommands and JobStart


To generate a diff of this commit:
cvs rdiff -u -r1.402 -r1.403 src/usr.bin/make/job.c

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

Modified files:

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.402 src/usr.bin/make/job.c:1.403
--- src/usr.bin/make/job.c:1.402	Fri Jan 29 23:45:35 2021
+++ src/usr.bin/make/job.c	Sat Jan 30 13:02:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.402 2021/01/29 23:45:35 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.403 2021/01/30 13:02:54 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.402 2021/01/29 23:45:35 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.403 2021/01/30 13:02:54 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -1016,7 +1016,10 @@ JobPrintCommands(Job *job)
 	return seen;
 }
 
-/* Save the delayed commands, to be executed when everything else is done. */
+/*
+ * Save the delayed commands (those after '...'), to be executed later in
+ * the '.END' node, when everything else is done.
+ */
 static void
 JobSaveCommands(Job *job)
 {
@@ -1025,9 +1028,11 @@ JobSaveCommands(Job *job)
 	for (ln = job->tailCmds; ln != NULL; ln = ln->next) {
 		const char *cmd = ln->datum;
 		char *expanded_cmd;
-		/* XXX: This Var_Subst is only intended to expand the dynamic
+		/*
+		 * XXX: This Var_Subst is only intended to expand the dynamic
 		 * variables such as .TARGET, .IMPSRC.  It is not intended to
-		 * expand the other variables as well; see deptgt-end.mk. */
+		 * expand the other variables as well; see deptgt-end.mk.
+		 */
 		(void)Var_Subst(cmd, job->node, VARE_WANTRES, _cmd);
 		/* TODO: handle errors */
 		Lst_Append(_GetEndNode()->commands, expanded_cmd);
@@ -1660,21 +1665,16 @@ JobStart(GNode *gn, Boolean special)
 	cmdsOK = Job_CheckCommands(gn, Error);
 
 	job->inPollfd = NULL;
-	/*
-	 * If the -n flag wasn't given, we open up OUR (not the child's)
-	 * temporary file to stuff commands in it. The thing is rd/wr so
-	 * we don't need to reopen it to feed it to the shell. If the -n
-	 * flag *was* given, we just set the file to be stdout. Cute, huh?
-	 */
+
 	if (Lst_IsEmpty(>commands)) {
 		job->cmdFILE = stdout;
 		run = FALSE;
 	} else if (((gn->type & OP_MAKE) && !opts.noRecursiveExecute) ||
 	(!opts.noExecute && !opts.touchFlag)) {
 		/*
-		 * The above conditions look very similar to
-		 * GNode_ShouldExecute but are subtly different.
-		 * They prevent that .MAKE targets are touched.
+		 * The above condition looks very similar to
+		 * GNode_ShouldExecute but is subtly different.
+		 * It prevents that .MAKE targets are touched.
 		 */
 
 		JobWriteShellCommands(job, gn, cmdsOK, );
@@ -1687,12 +1687,6 @@ JobStart(GNode *gn, Boolean special)
 		 */
 		SwitchOutputTo(gn);
 		job->cmdFILE = stdout;
-		/*
-		 * Only print the commands if they're ok, but don't die if
-		 * they're not -- just let the user know they're bad and
-		 * keep going. It doesn't do any harm in this case and may
-		 * do some good.
-		 */
 		if (cmdsOK)
 			JobPrintCommands(job);
 		/* Don't execute the shell, thank you. */



CVS commit: src

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 12:46:38 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile jobs-empty-commands.mk
Added Files:
src/usr.bin/make/unit-tests: opt-no-action-touch.exp
opt-no-action-touch.mk

Log Message:
make(1): add test for combining the options -j, -n, -t

This is a preparation for refactoring the complicated condition in
JobStart.


To generate a diff of this commit:
cvs rdiff -u -r1.1013 -r1.1014 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.263 -r1.264 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/jobs-empty-commands.mk
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/opt-no-action-touch.exp \
src/usr.bin/make/unit-tests/opt-no-action-touch.mk

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1013 src/distrib/sets/lists/tests/mi:1.1014
--- src/distrib/sets/lists/tests/mi:1.1013	Fri Jan 29 22:38:17 2021
+++ src/distrib/sets/lists/tests/mi	Sat Jan 30 12:46:38 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1013 2021/01/29 22:38:17 rillig Exp $
+# $NetBSD: mi,v 1.1014 2021/01/30 12:46:38 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5258,6 +5258,8 @@
 ./usr/tests/usr.bin/make/unit-tests/opt-no-action-at-all.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-no-action-runflags.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-no-action-runflags.mk			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-no-action-touch.exp			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/opt-no-action-touch.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-no-action.exptests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-no-action.mktests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/opt-query.exptests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.263 src/usr.bin/make/unit-tests/Makefile:1.264
--- src/usr.bin/make/unit-tests/Makefile:1.263	Fri Jan 29 22:38:17 2021
+++ src/usr.bin/make/unit-tests/Makefile	Sat Jan 30 12:46:38 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.263 2021/01/29 22:38:17 rillig Exp $
+# $NetBSD: Makefile,v 1.264 2021/01/30 12:46:38 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -258,6 +258,7 @@ TESTS+=		opt-m-include-dir
 TESTS+=		opt-no-action
 TESTS+=		opt-no-action-at-all
 TESTS+=		opt-no-action-runflags
+TESTS+=		opt-no-action-touch
 TESTS+=		opt-query
 TESTS+=		opt-raw
 TESTS+=		opt-silent

Index: src/usr.bin/make/unit-tests/jobs-empty-commands.mk
diff -u src/usr.bin/make/unit-tests/jobs-empty-commands.mk:1.1 src/usr.bin/make/unit-tests/jobs-empty-commands.mk:1.2
--- src/usr.bin/make/unit-tests/jobs-empty-commands.mk:1.1	Fri Jan 29 22:38:17 2021
+++ src/usr.bin/make/unit-tests/jobs-empty-commands.mk	Sat Jan 30 12:46:38 2021
@@ -1,8 +1,9 @@
-# $NetBSD: jobs-empty-commands.mk,v 1.1 2021/01/29 22:38:17 rillig Exp $
+# $NetBSD: jobs-empty-commands.mk,v 1.2 2021/01/30 12:46:38 rillig Exp $
 #
 # In jobs mode, the shell commands for creating a target are written to a
 # temporary file first, which is then run by the shell.  In chains of
-# dependencies, these files would end up empty.  This can be avoided easily.
+# dependencies, these files would end up empty.  Since job.c 1.399 from
+# 2021-01-29, these empty files are no longer created.
 #
 # https://mail-index.netbsd.org/current-users/2021/01/26/msg040215.html
 

Added files:

Index: src/usr.bin/make/unit-tests/opt-no-action-touch.exp
diff -u /dev/null src/usr.bin/make/unit-tests/opt-no-action-touch.exp:1.1
--- /dev/null	Sat Jan 30 12:46:38 2021
+++ src/usr.bin/make/unit-tests/opt-no-action-touch.exp	Sat Jan 30 12:46:38 2021
@@ -0,0 +1,11 @@
+echo ": Making opt-touch-phony."
+{ : Making opt-touch-phony. 
+} || exit $?
+echo 'Making opt-touch-make.'
+Making opt-touch-make.
+echo ": Making opt-touch-regular."
+{ : Making opt-touch-regular. 
+} || exit $?
+`opt-touch-join' is up to date.
+`opt-touch-use' is up to date.
+exit status 0
Index: src/usr.bin/make/unit-tests/opt-no-action-touch.mk
diff -u /dev/null src/usr.bin/make/unit-tests/opt-no-action-touch.mk:1.1
--- /dev/null	Sat Jan 30 12:46:38 2021
+++ src/usr.bin/make/unit-tests/opt-no-action-touch.mk	Sat Jan 30 12:46:38 2021
@@ -0,0 +1,48 @@
+# $NetBSD: opt-no-action-touch.mk,v 1.1 2021/01/30 12:46:38 rillig Exp $
+#
+# Tests for combining the command line options -n (no action) and -t (touch).
+# This combination is unusual and probably doesn't ever happen in practice,
+# but still make needs to behave as 

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

2021-01-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 30 12:14:08 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: opt-touch-jobs.mk

Log Message:
make(1): explain test opt-touch-jobs


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/opt-touch-jobs.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/opt-touch-jobs.mk
diff -u src/usr.bin/make/unit-tests/opt-touch-jobs.mk:1.1 src/usr.bin/make/unit-tests/opt-touch-jobs.mk:1.2
--- src/usr.bin/make/unit-tests/opt-touch-jobs.mk:1.1	Sat Nov 14 15:35:20 2020
+++ src/usr.bin/make/unit-tests/opt-touch-jobs.mk	Sat Jan 30 12:14:08 2021
@@ -1,4 +1,4 @@
-# $NetBSD: opt-touch-jobs.mk,v 1.1 2020/11/14 15:35:20 rillig Exp $
+# $NetBSD: opt-touch-jobs.mk,v 1.2 2021/01/30 12:14:08 rillig Exp $
 #
 # Tests for the -t command line option in jobs mode.
 
@@ -9,12 +9,18 @@
 .MAKEFLAGS: opt-touch-use
 .MAKEFLAGS: opt-touch-make
 
+# .PHONY targets are not touched since they do not represent actual files.
+# See Job_Touch.
 opt-touch-phony: .PHONY
 	: Making $@.
 
+# .JOIN targets are not touched since they do not represent actual files.
+# See Job_Touch.
 opt-touch-join: .JOIN
 	: Making $@.
 
+# .USE targets are not touched since they do not represent actual files.
+# See Job_Touch.
 opt-touch-use: .USE
 	: Making use of $@.
 



CVS commit: src/usr.sbin/tprof

2021-01-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 30 11:46:25 UTC 2021

Modified Files:
src/usr.sbin/tprof: tprof_analyze.c

Log Message:
Print the path that we failed to open on error


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

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

Modified files:

Index: src/usr.sbin/tprof/tprof_analyze.c
diff -u src/usr.sbin/tprof/tprof_analyze.c:1.3 src/usr.sbin/tprof/tprof_analyze.c:1.4
--- src/usr.sbin/tprof/tprof_analyze.c:1.3	Sat Jul 14 07:54:04 2018
+++ src/usr.sbin/tprof/tprof_analyze.c	Sat Jan 30 11:46:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_analyze.c,v 1.3 2018/07/14 07:54:04 maxv Exp $	*/
+/*	$NetBSD: tprof_analyze.c,v 1.4 2021/01/30 11:46:25 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2010,2011,2012 YAMAMOTO Takashi,
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: tprof_analyze.c,v 1.3 2018/07/14 07:54:04 maxv Exp $");
+__RCSID("$NetBSD: tprof_analyze.c,v 1.4 2021/01/30 11:46:25 jmcneill Exp $");
 #endif /* not lint */
 
 #include 
@@ -112,7 +112,7 @@ ksymload(void)
 
 	fd = open(_PATH_KSYMS, O_RDONLY);
 	if (fd == -1) {
-		err(EXIT_FAILURE, "open");
+		err(EXIT_FAILURE, "open " _PATH_KSYMS);
 	}
 	if (elf_version(EV_CURRENT) == EV_NONE) {
 		goto elffail;



CVS commit: src/usr.sbin/isibootd

2021-01-30 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jan 30 11:34:28 UTC 2021

Modified Files:
src/usr.sbin/isibootd: isibootd.c

Log Message:
Fix "Cannot allocate memory" failure on amd64.

BIOCGBLEN ioctl of bpf(4) requires u_int, not size_t.
The problem is reported by Kenji Aoyama.

Should be pulled up to netbsd-9 and netbsd-8.


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

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

Modified files:

Index: src/usr.sbin/isibootd/isibootd.c
diff -u src/usr.sbin/isibootd/isibootd.c:1.3 src/usr.sbin/isibootd/isibootd.c:1.4
--- src/usr.sbin/isibootd/isibootd.c:1.3	Mon Apr  2 09:01:30 2012
+++ src/usr.sbin/isibootd/isibootd.c	Sat Jan 30 11:34:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: isibootd.c,v 1.3 2012/04/02 09:01:30 nisimura Exp $	*/
+/*	$NetBSD: isibootd.c,v 1.4 2021/01/30 11:34:28 tsutsui Exp $	*/
 /*	Id: isiboot.c,v 1.2 1999/12/26 14:33:33 nisimura Exp 	*/
 
 /*-
@@ -364,7 +364,7 @@ createbpfport(char *ifname, uint8_t **io
 	struct ifreq ifr;
 	int fd;
 	u_int type;
-	size_t buflen;
+	u_int buflen;
 	uint8_t dladdr[ETHER_ADDR_LEN], *buf;
 #ifdef BIOCIMMEDIATE
 	u_int flag;



CVS commit: src/sys/arch/arm/nxp

2021-01-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 30 09:48:59 UTC 2021

Modified Files:
src/sys/arch/arm/nxp: imx6_usb.c

Log Message:
Don't print undefined interrupt value


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nxp/imx6_usb.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/nxp/imx6_usb.c
diff -u src/sys/arch/arm/nxp/imx6_usb.c:1.3 src/sys/arch/arm/nxp/imx6_usb.c:1.4
--- src/sys/arch/arm/nxp/imx6_usb.c:1.3	Wed Jan 27 03:10:20 2021
+++ src/sys/arch/arm/nxp/imx6_usb.c	Sat Jan 30 09:48:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_usb.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $	*/
+/*	$NetBSD: imx6_usb.c,v 1.4 2021/01/30 09:48:59 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_usb.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_usb.c,v 1.4 2021/01/30 09:48:59 skrll Exp $");
 
 #include "opt_fdt.h"
 
@@ -176,7 +176,7 @@ imxusbc_print(void *aux, const char *nam
 
 	iaa = (struct imxusbc_attach_args *)aux;
 
-	aprint_normal(" unit %d intr %d", iaa->aa_unit, iaa->aa_irq);
+	aprint_normal(" unit %d", iaa->aa_unit);
 	return UNCONF;
 }
 



CVS commit: src/sys/arch/arm/nxp

2021-01-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 30 09:36:46 UTC 2021

Modified Files:
src/sys/arch/arm/nxp: imx6_clk.c

Log Message:
Pretty print


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6_clk.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/nxp/imx6_clk.c
diff -u src/sys/arch/arm/nxp/imx6_clk.c:1.2 src/sys/arch/arm/nxp/imx6_clk.c:1.3
--- src/sys/arch/arm/nxp/imx6_clk.c:1.2	Wed Jan 27 03:10:20 2021
+++ src/sys/arch/arm/nxp/imx6_clk.c	Sat Jan 30 09:36:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_clk.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $	*/
+/*	$NetBSD: imx6_clk.c,v 1.3 2021/01/30 09:36:46 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_clk.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_clk.c,v 1.3 2021/01/30 09:36:46 skrll Exp $");
 
 #include "opt_fdt.h"
 
@@ -133,11 +133,11 @@ imx6ccm_attach(device_t parent, device_t
 		return;
 	}
 
-	imx6ccm_attach_common(self);
-
 	aprint_naive("\n");
 	aprint_normal(": Clock Control Module\n");
 
+	imx6ccm_attach_common(self);
+
 	imx6_clk_fixed_from_fdt("ckil");
 	imx6_clk_fixed_from_fdt("ckih");
 	imx6_clk_fixed_from_fdt("osc");