CVS commit: src/external/public-domain/sqlite/lib
Module Name:src Committed By: rillig Date: Tue Sep 12 22:11:08 UTC 2023 Modified Files: src/external/public-domain/sqlite/lib: Makefile Log Message: sqlite: re-enable lint Since 1.26, the 'assert' macro expands to the same text, whether in lint mode or not. Defining the NDEBUG macro was redundant, as it is conditionally defined depending on SQLITE_DEBUG. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/external/public-domain/sqlite/lib/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/public-domain/sqlite/lib/Makefile diff -u src/external/public-domain/sqlite/lib/Makefile:1.18 src/external/public-domain/sqlite/lib/Makefile:1.19 --- src/external/public-domain/sqlite/lib/Makefile:1.18 Mon Sep 4 17:05:25 2023 +++ src/external/public-domain/sqlite/lib/Makefile Tue Sep 12 22:11:08 2023 @@ -1,14 +1,11 @@ -# $NetBSD: Makefile,v 1.18 2023/09/04 17:05:25 christos Exp $ +# $NetBSD: Makefile,v 1.19 2023/09/12 22:11:08 rillig Exp $ -NOLINT=yes # XXX: broken LIB= sqlite3 INCS= sqlite3.h sqlite3ext.h INCSDIR= /usr/include SRCS= sqlite3.c -CFLAGS+= -DNDEBUG - LDADD+= -lm DPADD+= ${LIBM}
CVS commit: src/external/public-domain/sqlite/lib
Module Name:src Committed By: rillig Date: Tue Sep 12 22:11:08 UTC 2023 Modified Files: src/external/public-domain/sqlite/lib: Makefile Log Message: sqlite: re-enable lint Since 1.26, the 'assert' macro expands to the same text, whether in lint mode or not. Defining the NDEBUG macro was redundant, as it is conditionally defined depending on SQLITE_DEBUG. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/external/public-domain/sqlite/lib/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/include
Module Name:src Committed By: rillig Date: Tue Sep 12 22:08:24 UTC 2023 Modified Files: src/include: assert.h Log Message: assert.h: remove custom macro definitions for lint mode In lint mode, 'assert(cond)' expanded to nothing. This broke code like sqlite that assumes 'assert(cond)' expands to an expression that can be used as operand of the comma operator, as in 'return assert(i > 0), i'. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/include/assert.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/assert.h diff -u src/include/assert.h:1.25 src/include/assert.h:1.26 --- src/include/assert.h:1.25 Fri Apr 17 15:22:34 2020 +++ src/include/assert.h Tue Sep 12 22:08:24 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: assert.h,v 1.25 2020/04/17 15:22:34 kamil Exp $ */ +/* $NetBSD: assert.h,v 1.26 2023/09/12 22:08:24 rillig Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -48,11 +48,7 @@ #undef assert #ifdef NDEBUG -# ifndef __lint__ -# define assert(e) (__static_cast(void,0)) -# else /* !__lint__ */ -# define assert(e) -# endif /* __lint__ */ +# define assert(e) (__static_cast(void,0)) #else /* !NDEBUG */ # if __STDC__ # define assert(e) \ @@ -67,11 +63,7 @@ #undef _DIAGASSERT #if !defined(_DIAGNOSTIC) -# if !defined(__lint__) -# define _DIAGASSERT(e) (__static_cast(void,0)) -# else /* !__lint__ */ -# define _DIAGASSERT(e) -# endif /* __lint__ */ +# define _DIAGASSERT(e) (__static_cast(void,0)) #else /* _DIAGNOSTIC */ # if __STDC__ # define _DIAGASSERT(e) \ @@ -85,9 +77,7 @@ #endif /* _DIAGNOSTIC */ -#if defined(__lint__) -#define __assert_function__ (__static_cast(const void *,0)) -#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __assert_function__ __func__ #elif __GNUC_PREREQ__(2, 6) #define __assert_function__ __PRETTY_FUNCTION__
CVS commit: src/include
Module Name:src Committed By: rillig Date: Tue Sep 12 22:08:24 UTC 2023 Modified Files: src/include: assert.h Log Message: assert.h: remove custom macro definitions for lint mode In lint mode, 'assert(cond)' expanded to nothing. This broke code like sqlite that assumes 'assert(cond)' expands to an expression that can be used as operand of the comma operator, as in 'return assert(i > 0), i'. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/include/assert.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch
Module Name:src Committed By: andvar Date: Tue Sep 12 22:07:33 UTC 2023 Modified Files: src/sys/arch/dreamcast/conf: G1IDE GENERIC src/sys/arch/hpcsh/conf: DEBUG HPW650PA Log Message: double quotes should be in front of value, not property name. fix KGDB enabled builds for dreamcast/hpcsh. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/dreamcast/conf/G1IDE cvs rdiff -u -r1.137 -r1.138 src/sys/arch/dreamcast/conf/GENERIC cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hpcsh/conf/DEBUG cvs rdiff -u -r1.32 -r1.33 src/sys/arch/hpcsh/conf/HPW650PA 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/dreamcast/conf/G1IDE diff -u src/sys/arch/dreamcast/conf/G1IDE:1.10 src/sys/arch/dreamcast/conf/G1IDE:1.11 --- src/sys/arch/dreamcast/conf/G1IDE:1.10 Sun Aug 7 02:52:24 2022 +++ src/sys/arch/dreamcast/conf/G1IDE Tue Sep 12 22:07:33 2023 @@ -1,4 +1,4 @@ -# $NetBSD: G1IDE,v 1.10 2022/08/07 02:52:24 simonb Exp $ +# $NetBSD: G1IDE,v 1.11 2023/09/12 22:07:33 andvar Exp $ include "arch/dreamcast/conf/std.dreamcast" @@ -36,7 +36,7 @@ options DIAGNOSTIC # cheap kernel consi #options DEBUG # expensive debugging checks/support options DDB # in-kernel debugger #options KGDB # remote debugger -#options "KGDB_DEVNAME=\"scif\"",KGDB_DEVRATE=57600 +#options KGDB_DEVNAME="\"scif\"",KGDB_DEVRATE=57600 #makeoptions DEBUG="-g" # compile full symbol table makeoptions COPY_SYMTAB=1 #options SYSCALL_DEBUG Index: src/sys/arch/dreamcast/conf/GENERIC diff -u src/sys/arch/dreamcast/conf/GENERIC:1.137 src/sys/arch/dreamcast/conf/GENERIC:1.138 --- src/sys/arch/dreamcast/conf/GENERIC:1.137 Sun Feb 12 14:50:38 2023 +++ src/sys/arch/dreamcast/conf/GENERIC Tue Sep 12 22:07:33 2023 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.137 2023/02/12 14:50:38 abs Exp $ +# $NetBSD: GENERIC,v 1.138 2023/09/12 22:07:33 andvar Exp $ # # GENERIC machine description file # @@ -49,7 +49,7 @@ options SYSVSHM # System V-like memory #options DEBUG # expensive debugging checks/support options DDB # in-kernel debugger #options KGDB # remote debugger -#options "KGDB_DEVNAME=\"scif\"",KGDB_DEVRATE=57600 +#options KGDB_DEVNAME="\"scif\"",KGDB_DEVRATE=57600 #makeoptions DEBUG="-g" # compile full symbol table makeoptions COPY_SYMTAB=1 #options SYSCALL_DEBUG Index: src/sys/arch/hpcsh/conf/DEBUG diff -u src/sys/arch/hpcsh/conf/DEBUG:1.7 src/sys/arch/hpcsh/conf/DEBUG:1.8 --- src/sys/arch/hpcsh/conf/DEBUG:1.7 Tue Sep 12 21:50:11 2023 +++ src/sys/arch/hpcsh/conf/DEBUG Tue Sep 12 22:07:33 2023 @@ -1,7 +1,7 @@ # # kernel config file for debugging. # -# $NetBSD: DEBUG,v 1.7 2023/09/12 21:50:11 andvar Exp $ +# $NetBSD: DEBUG,v 1.8 2023/09/12 22:07:33 andvar Exp $ # include "arch/hpcsh/conf/GENERIC" @@ -11,11 +11,11 @@ options DDB # in-kernel debugger #makeoptions DEBUG="-g" # compile full symbol table #options KGDB_DEVRATE=19200 # HP Jornada -#options "KGDB_DEVNAME=\"scif\"" +#options KGDB_DEVNAME="\"scif\"" # HITACHI PERSONA (SH3) -#options "KGDB_DEVNAME=\"hd64461uart\"" +#options KGDB_DEVNAME="\"hd64461uart\"" # HITACHI PERSONA (SH4) -#options "KGDB_DEVNAME=\"hd64465uart\"" +#options KGDB_DEVNAME="\"hd64465uart\"" #options HPC_DEBUG_INTERRUPT_MONITOR #options KSTACK_DEBUG Index: src/sys/arch/hpcsh/conf/HPW650PA diff -u src/sys/arch/hpcsh/conf/HPW650PA:1.32 src/sys/arch/hpcsh/conf/HPW650PA:1.33 --- src/sys/arch/hpcsh/conf/HPW650PA:1.32 Fri Aug 21 01:52:08 2015 +++ src/sys/arch/hpcsh/conf/HPW650PA Tue Sep 12 22:07:33 2023 @@ -1,4 +1,4 @@ -# $NetBSD: HPW650PA,v 1.32 2015/08/21 01:52:08 uebayasi Exp $ +# $NetBSD: HPW650PA,v 1.33 2023/09/12 22:07:33 andvar Exp $ # # HITACHI PERSONA HPW650PA # @@ -25,7 +25,7 @@ options HPC_DEBUG_LCD options DDB # in-kernel debugger pseudo-device ksyms #options KGDB # in-kernel debugger -#options "KGDB_DEVNAME=\"hd64465uart\"",KGDB_DEVRATE=19200 +#options KGDB_DEVNAME="\"hd64465uart\"",KGDB_DEVRATE=19200 #makeoptions DEBUG="-g" # compile full symbol table options DIAGNOSTIC # extra kernel debugging checks options DEBUG # extra kernel debugging support
CVS commit: src/sys/arch
Module Name:src Committed By: andvar Date: Tue Sep 12 22:07:33 UTC 2023 Modified Files: src/sys/arch/dreamcast/conf: G1IDE GENERIC src/sys/arch/hpcsh/conf: DEBUG HPW650PA Log Message: double quotes should be in front of value, not property name. fix KGDB enabled builds for dreamcast/hpcsh. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/dreamcast/conf/G1IDE cvs rdiff -u -r1.137 -r1.138 src/sys/arch/dreamcast/conf/GENERIC cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hpcsh/conf/DEBUG cvs rdiff -u -r1.32 -r1.33 src/sys/arch/hpcsh/conf/HPW650PA Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: rillig Date: Tue Sep 12 22:01:05 UTC 2023 Modified Files: src/tests/usr.bin/xlint/lint1: msg_192.c src/usr.bin/xlint/lint1: tree.c Log Message: lint: mark unreachable function call arguments as used as well Previously, in a '?:' expression with a constant condition, the branch that is not taken was skipped but any identifiers in there were intended to be marked as used. In function call expressions, this only worked for the last argument, as the PUSH operator is not a binary operator (see ops.def). Cover this case as well. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/msg_192.c cvs rdiff -u -r1.579 -r1.580 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: rillig Date: Tue Sep 12 22:01:05 UTC 2023 Modified Files: src/tests/usr.bin/xlint/lint1: msg_192.c src/usr.bin/xlint/lint1: tree.c Log Message: lint: mark unreachable function call arguments as used as well Previously, in a '?:' expression with a constant condition, the branch that is not taken was skipped but any identifiers in there were intended to be marked as used. In function call expressions, this only worked for the last argument, as the PUSH operator is not a binary operator (see ops.def). Cover this case as well. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/msg_192.c cvs rdiff -u -r1.579 -r1.580 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_192.c diff -u src/tests/usr.bin/xlint/lint1/msg_192.c:1.8 src/tests/usr.bin/xlint/lint1/msg_192.c:1.9 --- src/tests/usr.bin/xlint/lint1/msg_192.c:1.8 Tue Sep 12 07:23:27 2023 +++ src/tests/usr.bin/xlint/lint1/msg_192.c Tue Sep 12 22:01:05 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_192.c,v 1.8 2023/09/12 07:23:27 rillig Exp $ */ +/* $NetBSD: msg_192.c,v 1.9 2023/09/12 22:01:05 rillig Exp $ */ # 3 "msg_192.c" // Test for message: '%s' unused in function '%s' [192] @@ -14,7 +14,7 @@ example(int param) } -void assertion_failed(const char *); +void assertion_failed(const char *, int, const char *, const char *); /* * The symbol '__func__' only occurs in an unreachable branch. It is @@ -25,7 +25,7 @@ assert_true(void) { sizeof(char) == 1 ? (void)0 - : assertion_failed(__func__); + : assertion_failed("file", 26, __func__, "sizeof(char) == 1"); } void @@ -33,7 +33,7 @@ assert_false(void) { sizeof(char) == 0 ? (void)0 - : assertion_failed(__func__); + : assertion_failed("file", 34, __func__, "sizeof(char) == 0"); } void @@ -41,5 +41,5 @@ assert_unknown(_Bool cond) { cond ? (void)0 - : assertion_failed(__func__); + : assertion_failed("file", 42, __func__, "cond"); } Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.579 src/usr.bin/xlint/lint1/tree.c:1.580 --- src/usr.bin/xlint/lint1/tree.c:1.579 Tue Sep 12 07:23:27 2023 +++ src/usr.bin/xlint/lint1/tree.c Tue Sep 12 22:01:05 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.579 2023/09/12 07:23:27 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.580 2023/09/12 22:01:05 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: tree.c,v 1.579 2023/09/12 07:23:27 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.580 2023/09/12 22:01:05 rillig Exp $"); #endif #include @@ -1649,7 +1649,7 @@ use(const tnode_t *tn) break; default: use(tn->tn_left); - if (is_binary(tn)) + if (is_binary(tn) || tn->tn_op == PUSH) use(tn->tn_right); } }
CVS commit: src/lib/libc/time
Module Name:src Committed By: dholland Date: Tue Sep 12 21:56:05 UTC 2023 Modified Files: src/lib/libc/time: ctime.3 Log Message: ctime.3: fix merge mistake The paragraphs about the *_r and *_z/rz functions belong at the end of the section (or somewhere like that), not affixed to the description of difftime in the middle of the list of functions. To generate a diff of this commit: cvs rdiff -u -r1.69 -r1.70 src/lib/libc/time/ctime.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/time/ctime.3 diff -u src/lib/libc/time/ctime.3:1.69 src/lib/libc/time/ctime.3:1.70 --- src/lib/libc/time/ctime.3:1.69 Sun Dec 11 17:57:23 2022 +++ src/lib/libc/time/ctime.3 Tue Sep 12 21:56:05 2023 @@ -1,9 +1,9 @@ -.\" $NetBSD: ctime.3,v 1.69 2022/12/11 17:57:23 christos Exp $ +.\" $NetBSD: ctime.3,v 1.70 2023/09/12 21:56:05 dholland Exp $ .\" .\" This file is in the public domain, so clarified as of .\" 2009-05-17 by Arthur David Olson. .\" -.Dd October 22, 2022 +.Dd September 12, 2023 .Dt CTIME 3 .Os .Sh NAME @@ -139,40 +139,6 @@ The function returns the difference between two calendar times, .Fa ( time1 No - Fa time0 ) , expressed in seconds. -.Pp -The -.Fn ctime_r , -.Fn localtime_r , -.Fn gmtime_r , -and -.Fn asctime_r -functions -are like their unsuffixed counterparts, except that they accept an -additional argument specifying where to store the result if successful. -.Pp -The -.Fn ctime_rz , -.Fn localtime_rz , -and -.Fn mktime_z -functions -are like their unsuffixed counterparts, except that they accept an -extra initial -.Ar zone -argument specifying the timezone to be used for conversion. -If -.Fa zone -is -.Dv NULL , -UT is used; otherwise, -.Fa zone -should have been allocated by -.Fn tzalloc -and should not be freed until after all uses (e.g., by calls to -.Fn strftime ) -of the filled-in -.Fn tm_zone -fields. .It Fn gmtime "clock" The .Fn gmtime @@ -415,6 +381,40 @@ variable is optional; also, there is no .Dv tzname will continue to exist in this form in future releases of this code. +.Pp +The +.Fn ctime_r , +.Fn localtime_r , +.Fn gmtime_r , +and +.Fn asctime_r +functions +are like their unsuffixed counterparts, except that they accept an +additional argument specifying where to store the result if successful. +.Pp +The +.Fn ctime_rz , +.Fn localtime_rz , +and +.Fn mktime_z +functions +are like their unsuffixed counterparts, except that they accept an +extra initial +.Ar zone +argument specifying the timezone to be used for conversion. +If +.Fa zone +is +.Dv NULL , +UT is used; otherwise, +.Fa zone +should have been allocated by +.Fn tzalloc +and should not be freed until after all uses (e.g., by calls to +.Fn strftime ) +of the filled-in +.Fn tm_zone +fields. .Sh RETURN VALUES .Bl -bullet .It
CVS commit: src/lib/libc/time
Module Name:src Committed By: dholland Date: Tue Sep 12 21:56:05 UTC 2023 Modified Files: src/lib/libc/time: ctime.3 Log Message: ctime.3: fix merge mistake The paragraphs about the *_r and *_z/rz functions belong at the end of the section (or somewhere like that), not affixed to the description of difftime in the middle of the list of functions. To generate a diff of this commit: cvs rdiff -u -r1.69 -r1.70 src/lib/libc/time/ctime.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/hpcsh/conf
Module Name:src Committed By: andvar Date: Tue Sep 12 21:50:12 UTC 2023 Modified Files: src/sys/arch/hpcsh/conf: DEBUG Log Message: remove ksyms from hpcsh DEBUG kernel config. It is already defined in GENERAL. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hpcsh/conf/DEBUG Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/hpcsh/conf
Module Name:src Committed By: andvar Date: Tue Sep 12 21:50:12 UTC 2023 Modified Files: src/sys/arch/hpcsh/conf: DEBUG Log Message: remove ksyms from hpcsh DEBUG kernel config. It is already defined in GENERAL. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hpcsh/conf/DEBUG 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/hpcsh/conf/DEBUG diff -u src/sys/arch/hpcsh/conf/DEBUG:1.6 src/sys/arch/hpcsh/conf/DEBUG:1.7 --- src/sys/arch/hpcsh/conf/DEBUG:1.6 Fri Aug 21 01:52:08 2015 +++ src/sys/arch/hpcsh/conf/DEBUG Tue Sep 12 21:50:11 2023 @@ -1,13 +1,12 @@ # # kernel config file for debugging. # -# $NetBSD: DEBUG,v 1.6 2015/08/21 01:52:08 uebayasi Exp $ +# $NetBSD: DEBUG,v 1.7 2023/09/12 21:50:11 andvar Exp $ # include "arch/hpcsh/conf/GENERIC" options DDB # in-kernel debugger -pseudo-device ksyms #options KGDB # remote debugger #makeoptions DEBUG="-g" # compile full symbol table #options KGDB_DEVRATE=19200
CVS commit: src/external/apache2/mDNSResponder/dist/mDNSCore
Module Name:src Committed By: gutteridge Date: Tue Sep 12 21:19:53 UTC 2023 Modified Files: src/external/apache2/mDNSResponder/dist/mDNSCore: DNSCommon.c Log Message: DNSCommon.c: fix punctuation in a comment This has very little value in itself; it's intended to make a material change to this file to facilitate rebuilds. Otherwise, people running update builds on branches will run into mismatches and build failures after our switch to use arc4random(3). (That is, this change is intended to be pulled up.) To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 \ src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c diff -u src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c:1.10 src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c:1.11 --- src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c:1.10 Sun Aug 13 18:57:07 2023 +++ src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c Tue Sep 12 21:19:53 2023 @@ -3754,7 +3754,7 @@ mDNSexport mStatus mDNSSendDNSMessage(mD m->UnicastPacketsSent++; #endif // APPLE_OSX_mDNSResponder -// Zero-length message data is okay (e.g. for a DNS Update ack, where all we need is an ID and an error code +// Zero-length message data is okay (e.g. for a DNS Update ack, where all we need is an ID and an error code) if (end < msg->data || end - msg->data > AbsoluteMaxDNSMessageData) { LogMsg("mDNSSendDNSMessage: invalid message %p %p %d", msg->data, end, end - msg->data);
CVS commit: src/external/apache2/mDNSResponder/dist/mDNSCore
Module Name:src Committed By: gutteridge Date: Tue Sep 12 21:19:53 UTC 2023 Modified Files: src/external/apache2/mDNSResponder/dist/mDNSCore: DNSCommon.c Log Message: DNSCommon.c: fix punctuation in a comment This has very little value in itself; it's intended to make a material change to this file to facilitate rebuilds. Otherwise, people running update builds on branches will run into mismatches and build failures after our switch to use arc4random(3). (That is, this change is intended to be pulled up.) To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 \ src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/cpuctl
Module Name:src Committed By: wiz Date: Tue Sep 12 20:45:17 UTC 2023 Modified Files: src/usr.sbin/cpuctl: cpuctl.8 Log Message: cpuctl(8): note that AMD updates need to be applied on all CPUs at once Note that checking dmesg(8) after problems might be helpful. Sort commands. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/cpuctl/cpuctl.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/cpuctl/cpuctl.8 diff -u src/usr.sbin/cpuctl/cpuctl.8:1.21 src/usr.sbin/cpuctl/cpuctl.8:1.22 --- src/usr.sbin/cpuctl/cpuctl.8:1.21 Mon Mar 6 01:28:54 2023 +++ src/usr.sbin/cpuctl/cpuctl.8 Tue Sep 12 20:45:17 2023 @@ -1,4 +1,4 @@ -.\" $NetBSD: cpuctl.8,v 1.21 2023/03/06 01:28:54 kre Exp $ +.\" $NetBSD: cpuctl.8,v 1.22 2023/09/12 20:45:17 wiz Exp $ .\" .\" Copyright (c) 2007, 2008, 2012, 2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 17, 2019 +.Dd September 12, 2023 .Dt CPUCTL 8 .Os .Sh NAME @@ -51,9 +51,13 @@ Valid commands are: .It identify Ar cpu Op Ar cpu ... Output information on the specified CPU's features and capabilities. Not available on all architectures. +.It intr Ar cpu Op Ar cpu ... +Enable interrupts for the specified CPUs if supported. .It list For each CPU in the system, display the current state and time of the last state change. +.It nointr Ar cpu Op Ar cpu ... +Disable interrupts for the specified CPUs if supported. .It offline Ar cpu Op Ar cpu ... Set the specified CPUs off line. .Pp @@ -79,22 +83,28 @@ already exists on the CPU in question ar If .Ar cpu is not specified or \-1, all CPUs are updated. +(AMD CPU updates need to be update all CPUs at once.) If .Ar cpu is \-2, the current CPUs are updated. The default filename is used if no filename is specified. The +.Ar file +pathname containing the ucode updates are searched relative to the +default firmware path found in +.Xr sysctl 7 +.Pa hw.firmware.path . +The .Cm identify command prints the installed version on the specified CPUs. On success the .Cm identify command shows different ucode versions before and after this command. -The ucode updates are found in the default firmware path found in -sysctl hw.firmware.path. -.It intr Ar cpu Op Ar cpu ... -Enable interrupts for the specified CPUs if supported. -.It nointr Ar cpu Op Ar cpu ... -Disable interrupts for the specified CPUs if supported. +.Pp +Some problems will only be reported in the kernel message buffer, +so check +.Xr dmesg 8 +in case of errors. .El .Pp Valid flags are:
CVS commit: src/usr.sbin/cpuctl
Module Name:src Committed By: wiz Date: Tue Sep 12 20:45:17 UTC 2023 Modified Files: src/usr.sbin/cpuctl: cpuctl.8 Log Message: cpuctl(8): note that AMD updates need to be applied on all CPUs at once Note that checking dmesg(8) after problems might be helpful. Sort commands. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/cpuctl/cpuctl.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/cpuctl
Module Name:src Committed By: wiz Date: Tue Sep 12 20:43:38 UTC 2023 Modified Files: src/usr.sbin/cpuctl: cpuctl.c src/usr.sbin/cpuctl/arch: i386.c Log Message: cpuctl: be more verbose about problems and diagnosing them To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/cpuctl/cpuctl.c cvs rdiff -u -r1.139 -r1.140 src/usr.sbin/cpuctl/arch/i386.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/cpuctl/cpuctl.c diff -u src/usr.sbin/cpuctl/cpuctl.c:1.33 src/usr.sbin/cpuctl/cpuctl.c:1.34 --- src/usr.sbin/cpuctl/cpuctl.c:1.33 Mon Mar 6 01:28:54 2023 +++ src/usr.sbin/cpuctl/cpuctl.c Tue Sep 12 20:43:38 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: cpuctl.c,v 1.33 2023/03/06 01:28:54 kre Exp $ */ +/* $NetBSD: cpuctl.c,v 1.34 2023/09/12 20:43:38 wiz Exp $ */ /*- * Copyright (c) 2007, 2008, 2009, 2012, 2015 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #ifndef lint #include -__RCSID("$NetBSD: cpuctl.c,v 1.33 2023/03/06 01:28:54 kre Exp $"); +__RCSID("$NetBSD: cpuctl.c,v 1.34 2023/09/12 20:43:38 wiz Exp $"); #endif /* not lint */ #include @@ -247,7 +247,8 @@ cpu_ucode(char **argv) cpuset_destroy(cpuset); } error = ioctl(fd, IOC_CPU_UCODE_APPLY, ); - if (error < 0 && (verbose || errno != EEXIST)) { +if (error < 0 && (verbose || errno != EEXIST)) { +warnx("please also check dmesg(8) output for additional error information"); if (uc.fwname[0]) err(EXIT_FAILURE, "%s", uc.fwname); else Index: src/usr.sbin/cpuctl/arch/i386.c diff -u src/usr.sbin/cpuctl/arch/i386.c:1.139 src/usr.sbin/cpuctl/arch/i386.c:1.140 --- src/usr.sbin/cpuctl/arch/i386.c:1.139 Fri Jul 21 10:26:36 2023 +++ src/usr.sbin/cpuctl/arch/i386.c Tue Sep 12 20:43:38 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: i386.c,v 1.139 2023/07/21 10:26:36 msaitoh Exp $ */ +/* $NetBSD: i386.c,v 1.140 2023/09/12 20:43:38 wiz Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ #include #ifndef lint -__RCSID("$NetBSD: i386.c,v 1.139 2023/07/21 10:26:36 msaitoh Exp $"); +__RCSID("$NetBSD: i386.c,v 1.140 2023/09/12 20:43:38 wiz Exp $"); #endif /* not lint */ #include @@ -2584,8 +2584,8 @@ ucodeupdate_check(int fd, struct cpu_uco switch (loader_version) { case CPU_UCODE_LOADER_AMD: - if (uc->cpu_nr != -1) { - /* printf? */ +if (uc->cpu_nr != -1) { +warnx("ucode updates on AMD can only be done on all CPUs at once"); return -1; } uc->cpu_nr = CPU_UCODE_ALL_CPUS;
CVS commit: src/usr.sbin/cpuctl
Module Name:src Committed By: wiz Date: Tue Sep 12 20:43:38 UTC 2023 Modified Files: src/usr.sbin/cpuctl: cpuctl.c src/usr.sbin/cpuctl/arch: i386.c Log Message: cpuctl: be more verbose about problems and diagnosing them To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/cpuctl/cpuctl.c cvs rdiff -u -r1.139 -r1.140 src/usr.sbin/cpuctl/arch/i386.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/hpcmips/vr
Module Name:src Committed By: andvar Date: Tue Sep 12 19:32:00 UTC 2023 Modified Files: src/sys/arch/hpcmips/vr: flash_vrip.c Log Message: rename flash_cd to vrflash_cd, since device was renamed to vrflash. Fixes hpcmips LCARD config linking issue that flash_cd is undefined. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hpcmips/vr/flash_vrip.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/hpcmips/vr/flash_vrip.c diff -u src/sys/arch/hpcmips/vr/flash_vrip.c:1.14 src/sys/arch/hpcmips/vr/flash_vrip.c:1.15 --- src/sys/arch/hpcmips/vr/flash_vrip.c:1.14 Mon Sep 11 22:09:28 2023 +++ src/sys/arch/hpcmips/vr/flash_vrip.c Tue Sep 12 19:32:00 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: flash_vrip.c,v 1.14 2023/09/11 22:09:28 andvar Exp $ */ +/* $NetBSD: flash_vrip.c,v 1.15 2023/09/12 19:32:00 andvar Exp $ */ /* * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: flash_vrip.c,v 1.14 2023/09/11 22:09:28 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: flash_vrip.c,v 1.15 2023/09/12 19:32:00 andvar Exp $"); #include #include @@ -73,7 +73,7 @@ static int intel_write(struct flash_soft static int amd_erase(struct flash_softc *, bus_size_t); static int amd_write(struct flash_softc *, bus_size_t); -extern struct cfdriver flash_cd; +extern struct cfdriver vrflash_cd; CFATTACH_DECL_NEW(flash_vrip, sizeof(struct flash_softc), flash_probe, flash_attach, NULL, NULL); @@ -83,7 +83,7 @@ dev_type_close(flashclose); dev_type_read(flashread); dev_type_write(flashwrite); -const struct cdevsw flash_cdevsw = { +const struct cdevsw vrflash_cdevsw = { .d_open = flashopen, .d_close = flashclose, .d_read = flashread, @@ -318,7 +318,7 @@ flashopen(dev_t dev, int flag, int mode, { struct flash_softc *sc; - sc = device_lookup_private(_cd, minor(dev)); + sc = device_lookup_private(_cd, minor(dev)); if (sc == NULL) return ENXIO; if (sc->sc_status & FLASH_ST_BUSY) @@ -332,7 +332,7 @@ flashclose(dev_t dev, int flag, int mode { struct flash_softc *sc; - sc = device_lookup_private(_cd, minor(dev)); + sc = device_lookup_private(_cd, minor(dev)); sc->sc_status &= ~FLASH_ST_BUSY; return 0; } @@ -348,7 +348,7 @@ flashread(dev_t dev, struct uio *uio, in int count; int error; - sc = device_lookup_private(_cd, minor(dev)); + sc = device_lookup_private(_cd, minor(dev)); iot = sc->sc_iot; ioh = sc->sc_ioh; @@ -375,7 +375,7 @@ flashwrite(dev_t dev, struct uio *uio, i int stat; int error; - sc = device_lookup_private(_cd, minor(dev)); + sc = device_lookup_private(_cd, minor(dev)); if (sc->sc_size < uio->uio_offset + uio->uio_resid) return ENOSPC;
CVS commit: src/sys/arch/hpcmips/vr
Module Name:src Committed By: andvar Date: Tue Sep 12 19:32:00 UTC 2023 Modified Files: src/sys/arch/hpcmips/vr: flash_vrip.c Log Message: rename flash_cd to vrflash_cd, since device was renamed to vrflash. Fixes hpcmips LCARD config linking issue that flash_cd is undefined. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hpcmips/vr/flash_vrip.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: ad Date: Tue Sep 12 16:17:22 UTC 2023 Modified Files: src/common/lib/libc/gen: radixtree.c src/sys/kern: init_main.c kern_descrip.c kern_lwp.c kern_mutex_obj.c kern_resource.c kern_rwlock_obj.c kern_turnstile.c subr_kcpuset.c vfs_cwd.c vfs_init.c vfs_lockf.c src/sys/rump/include/rump: rump_namei.h src/sys/rump/librump/rumpkern: rump.c src/sys/rump/librump/rumpvfs: rump_vfs.c src/sys/sys: namei.h namei.src src/sys/uvm: uvm_init.c uvm_map.c uvm_readahead.c Log Message: Back out recent change to replace pool_cache with then general allocator. Will return to this when I have time again. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/common/lib/libc/gen/radixtree.c cvs rdiff -u -r1.544 -r1.545 src/sys/kern/init_main.c cvs rdiff -u -r1.259 -r1.260 src/sys/kern/kern_descrip.c cvs rdiff -u -r1.253 -r1.254 src/sys/kern/kern_lwp.c cvs rdiff -u -r1.12 -r1.13 src/sys/kern/kern_mutex_obj.c cvs rdiff -u -r1.192 -r1.193 src/sys/kern/kern_resource.c cvs rdiff -u -r1.10 -r1.11 src/sys/kern/kern_rwlock_obj.c cvs rdiff -u -r1.47 -r1.48 src/sys/kern/kern_turnstile.c cvs rdiff -u -r1.18 -r1.19 src/sys/kern/subr_kcpuset.c cvs rdiff -u -r1.9 -r1.10 src/sys/kern/vfs_cwd.c cvs rdiff -u -r1.62 -r1.63 src/sys/kern/vfs_init.c cvs rdiff -u -r1.79 -r1.80 src/sys/kern/vfs_lockf.c cvs rdiff -u -r1.50 -r1.51 src/sys/rump/include/rump/rump_namei.h cvs rdiff -u -r1.358 -r1.359 src/sys/rump/librump/rumpkern/rump.c cvs rdiff -u -r1.95 -r1.96 src/sys/rump/librump/rumpvfs/rump_vfs.c cvs rdiff -u -r1.117 -r1.118 src/sys/sys/namei.h cvs rdiff -u -r1.62 -r1.63 src/sys/sys/namei.src cvs rdiff -u -r1.57 -r1.58 src/sys/uvm/uvm_init.c cvs rdiff -u -r1.408 -r1.409 src/sys/uvm/uvm_map.c cvs rdiff -u -r1.14 -r1.15 src/sys/uvm/uvm_readahead.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: ad Date: Tue Sep 12 16:17:22 UTC 2023 Modified Files: src/common/lib/libc/gen: radixtree.c src/sys/kern: init_main.c kern_descrip.c kern_lwp.c kern_mutex_obj.c kern_resource.c kern_rwlock_obj.c kern_turnstile.c subr_kcpuset.c vfs_cwd.c vfs_init.c vfs_lockf.c src/sys/rump/include/rump: rump_namei.h src/sys/rump/librump/rumpkern: rump.c src/sys/rump/librump/rumpvfs: rump_vfs.c src/sys/sys: namei.h namei.src src/sys/uvm: uvm_init.c uvm_map.c uvm_readahead.c Log Message: Back out recent change to replace pool_cache with then general allocator. Will return to this when I have time again. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/common/lib/libc/gen/radixtree.c cvs rdiff -u -r1.544 -r1.545 src/sys/kern/init_main.c cvs rdiff -u -r1.259 -r1.260 src/sys/kern/kern_descrip.c cvs rdiff -u -r1.253 -r1.254 src/sys/kern/kern_lwp.c cvs rdiff -u -r1.12 -r1.13 src/sys/kern/kern_mutex_obj.c cvs rdiff -u -r1.192 -r1.193 src/sys/kern/kern_resource.c cvs rdiff -u -r1.10 -r1.11 src/sys/kern/kern_rwlock_obj.c cvs rdiff -u -r1.47 -r1.48 src/sys/kern/kern_turnstile.c cvs rdiff -u -r1.18 -r1.19 src/sys/kern/subr_kcpuset.c cvs rdiff -u -r1.9 -r1.10 src/sys/kern/vfs_cwd.c cvs rdiff -u -r1.62 -r1.63 src/sys/kern/vfs_init.c cvs rdiff -u -r1.79 -r1.80 src/sys/kern/vfs_lockf.c cvs rdiff -u -r1.50 -r1.51 src/sys/rump/include/rump/rump_namei.h cvs rdiff -u -r1.358 -r1.359 src/sys/rump/librump/rumpkern/rump.c cvs rdiff -u -r1.95 -r1.96 src/sys/rump/librump/rumpvfs/rump_vfs.c cvs rdiff -u -r1.117 -r1.118 src/sys/sys/namei.h cvs rdiff -u -r1.62 -r1.63 src/sys/sys/namei.src cvs rdiff -u -r1.57 -r1.58 src/sys/uvm/uvm_init.c cvs rdiff -u -r1.408 -r1.409 src/sys/uvm/uvm_map.c cvs rdiff -u -r1.14 -r1.15 src/sys/uvm/uvm_readahead.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/gen/radixtree.c diff -u src/common/lib/libc/gen/radixtree.c:1.30 src/common/lib/libc/gen/radixtree.c:1.31 --- src/common/lib/libc/gen/radixtree.c:1.30 Sun Sep 10 14:45:52 2023 +++ src/common/lib/libc/gen/radixtree.c Tue Sep 12 16:17:21 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: radixtree.c,v 1.30 2023/09/10 14:45:52 ad Exp $ */ +/* $NetBSD: radixtree.c,v 1.31 2023/09/12 16:17:21 ad Exp $ */ /*- * Copyright (c)2011,2012,2013 YAMAMOTO Takashi, @@ -43,7 +43,7 @@ * * Intermediate nodes are automatically allocated and freed internally and * basically users don't need to care about them. The allocation is done via - * kmem_zalloc(9) for _KERNEL, malloc(3) for userland, and alloc() for + * pool_cache_get(9) for _KERNEL, malloc(3) for userland, and alloc() for * _STANDALONE environment. Only radix_tree_insert_node function can allocate * memory for intermediate nodes and thus can fail for ENOMEM. * @@ -112,17 +112,17 @@ #include #if defined(_KERNEL) || defined(_STANDALONE) -__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.30 2023/09/10 14:45:52 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: radixtree.c,v 1.31 2023/09/12 16:17:21 ad Exp $"); #include #include -#include +#include #include #include #if defined(_STANDALONE) #include #endif /* defined(_STANDALONE) */ #else /* defined(_KERNEL) || defined(_STANDALONE) */ -__RCSID("$NetBSD: radixtree.c,v 1.30 2023/09/10 14:45:52 ad Exp $"); +__RCSID("$NetBSD: radixtree.c,v 1.31 2023/09/12 16:17:21 ad Exp $"); #include #include #include @@ -303,6 +303,18 @@ radix_tree_node_init(struct radix_tree_n } #if defined(_KERNEL) +pool_cache_t radix_tree_node_cache __read_mostly; + +static int +radix_tree_node_ctor(void *dummy, void *item, int flags) +{ + struct radix_tree_node *n = item; + + KASSERT(dummy == NULL); + radix_tree_node_init(n); + return 0; +} + /* * radix_tree_init: * @@ -313,7 +325,10 @@ void radix_tree_init(void) { - /* nothing right now */ + radix_tree_node_cache = pool_cache_init(sizeof(struct radix_tree_node), + coherency_unit, 0, PR_LARGECACHE, "radixnode", NULL, IPL_NONE, + radix_tree_node_ctor, NULL, NULL); + KASSERT(radix_tree_node_cache != NULL); } /* @@ -331,10 +346,10 @@ radix_tree_await_memory(void) int i; for (i = 0; i < __arraycount(nodes); i++) { - nodes[i] = kmem_alloc(sizeof(struct radix_tree_node), KM_SLEEP); + nodes[i] = pool_cache_get(radix_tree_node_cache, PR_WAITOK); } while (--i >= 0) { - kmem_free(nodes[i], sizeof(struct radix_tree_node)); + pool_cache_put(radix_tree_node_cache, nodes[i]); } } @@ -409,10 +424,11 @@ radix_tree_alloc_node(void) #if defined(_KERNEL) /* - * note that kmem_alloc can block. + * note that pool_cache_get can block. */ - n = kmem_alloc(sizeof(struct radix_tree_node), KM_SLEEP); -#elif defined(_STANDALONE) + n = pool_cache_get(radix_tree_node_cache, PR_NOWAIT); +#else /* defined(_KERNEL) */ +#if defined(_STANDALONE) n = alloc(sizeof(*n)); #else /*
CVS commit: src/sys/arch/arm/dts
Module Name:src Committed By: bouyer Date: Tue Sep 12 12:56:21 UTC 2023 Modified Files: src/sys/arch/arm/dts: sun8i-h3-orangepi-plus2e.dts Removed Files: src/sys/arch/arm/dts: sun8i-h3-orangepi-one.dts Log Message: Remove now-unneeded and brocken (probably since dts-5.15 import) sun8i-h3-orangepi-one.dts, and let the build use the one from sys/external. Problem reported and fix tested by Dave Tyson as reported on port-arm@ While there remove #include "sun8i-h3.dtsi" from sun8i-h3-orangepi-plus2e.dts, this file has been removed with the dts-5.15 import. To generate a diff of this commit: cvs rdiff -u -r1.3 -r0 src/sys/arch/arm/dts/sun8i-h3-orangepi-one.dts cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts 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/dts/sun8i-h3-orangepi-plus2e.dts diff -u src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts:1.4 src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts:1.5 --- src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts:1.4 Tue May 21 22:31:39 2019 +++ src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts Tue Sep 12 12:56:21 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i-h3-orangepi-plus2e.dts,v 1.4 2019/05/21 22:31:39 jmcneill Exp $ */ +/* $NetBSD: sun8i-h3-orangepi-plus2e.dts,v 1.5 2023/09/12 12:56:21 bouyer Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,6 @@ */ #include "../../../external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts" -#include "sun8i-h3.dtsi" / { cpus {
CVS commit: src/sys/arch/arm/dts
Module Name:src Committed By: bouyer Date: Tue Sep 12 12:56:21 UTC 2023 Modified Files: src/sys/arch/arm/dts: sun8i-h3-orangepi-plus2e.dts Removed Files: src/sys/arch/arm/dts: sun8i-h3-orangepi-one.dts Log Message: Remove now-unneeded and brocken (probably since dts-5.15 import) sun8i-h3-orangepi-one.dts, and let the build use the one from sys/external. Problem reported and fix tested by Dave Tyson as reported on port-arm@ While there remove #include "sun8i-h3.dtsi" from sun8i-h3-orangepi-plus2e.dts, this file has been removed with the dts-5.15 import. To generate a diff of this commit: cvs rdiff -u -r1.3 -r0 src/sys/arch/arm/dts/sun8i-h3-orangepi-one.dts cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: rillig Date: Tue Sep 12 07:23:27 UTC 2023 Modified Files: src/tests/usr.bin/xlint/lint1: msg_192.c src/usr.bin/xlint/lint1: tree.c Log Message: lint: mark symbols that are only used in untaken '?:' branch as used To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_192.c cvs rdiff -u -r1.578 -r1.579 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_192.c diff -u src/tests/usr.bin/xlint/lint1/msg_192.c:1.7 src/tests/usr.bin/xlint/lint1/msg_192.c:1.8 --- src/tests/usr.bin/xlint/lint1/msg_192.c:1.7 Tue Sep 12 06:51:02 2023 +++ src/tests/usr.bin/xlint/lint1/msg_192.c Tue Sep 12 07:23:27 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_192.c,v 1.7 2023/09/12 06:51:02 rillig Exp $ */ +/* $NetBSD: msg_192.c,v 1.8 2023/09/12 07:23:27 rillig Exp $ */ # 3 "msg_192.c" // Test for message: '%s' unused in function '%s' [192] @@ -16,13 +16,15 @@ example(int param) void assertion_failed(const char *); +/* + * The symbol '__func__' only occurs in an unreachable branch. It is + * nevertheless marked as used. + */ void assert_true(void) { sizeof(char) == 1 ? (void)0 -/* FIXME: '__func__' is used, the code is just not reachable. */ -/* expect+1: warning: '__func__' unused in function 'assert_true' [192] */ : assertion_failed(__func__); } Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.578 src/usr.bin/xlint/lint1/tree.c:1.579 --- src/usr.bin/xlint/lint1/tree.c:1.578 Sat Aug 26 10:43:53 2023 +++ src/usr.bin/xlint/lint1/tree.c Tue Sep 12 07:23:27 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.578 2023/08/26 10:43:53 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.579 2023/09/12 07:23:27 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: tree.c,v 1.578 2023/08/26 10:43:53 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.579 2023/09/12 07:23:27 rillig Exp $"); #endif #include @@ -1635,6 +1635,25 @@ fold_float(tnode_t *tn) return build_constant(tn->tn_type, v); } +static void +use(const tnode_t *tn) +{ + if (tn == NULL) + return; + switch (tn->tn_op) { + case NAME: + mark_as_used(tn->tn_sym, false /* XXX */, false /* XXX */); + break; + case CON: + case STRING: + break; + default: + use(tn->tn_left); + if (is_binary(tn)) + use(tn->tn_right); + } +} + /* * Create a tree node for a binary operator and its two operands. Also called * for unary operators; in that case rn is NULL. @@ -1809,6 +1828,8 @@ build_binary(tnode_t *ln, op_t op, bool ntn = fold(ntn); } } else if (op == QUEST && ln->tn_op == CON) { + use(ln->tn_val.u.integer != 0 + ? rn->tn_right : rn->tn_left); ntn = ln->tn_val.u.integer != 0 ? rn->tn_left : rn->tn_right; }
CVS commit: src
Module Name:src Committed By: rillig Date: Tue Sep 12 07:23:27 UTC 2023 Modified Files: src/tests/usr.bin/xlint/lint1: msg_192.c src/usr.bin/xlint/lint1: tree.c Log Message: lint: mark symbols that are only used in untaken '?:' branch as used To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_192.c cvs rdiff -u -r1.578 -r1.579 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Tue Sep 12 06:51:02 UTC 2023 Modified Files: src/tests/usr.bin/xlint/lint1: msg_192.c Log Message: tests/lint: show that '?:' skips untaken branches early This is probably done to avoid wrong warnings from branches that are only taken on other platforms, but it also generates a wrong 'unused' warning. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_192.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_192.c diff -u src/tests/usr.bin/xlint/lint1/msg_192.c:1.6 src/tests/usr.bin/xlint/lint1/msg_192.c:1.7 --- src/tests/usr.bin/xlint/lint1/msg_192.c:1.6 Sun Jul 9 11:18:55 2023 +++ src/tests/usr.bin/xlint/lint1/msg_192.c Tue Sep 12 06:51:02 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_192.c,v 1.6 2023/07/09 11:18:55 rillig Exp $ */ +/* $NetBSD: msg_192.c,v 1.7 2023/09/12 06:51:02 rillig Exp $ */ # 3 "msg_192.c" // Test for message: '%s' unused in function '%s' [192] @@ -12,3 +12,32 @@ example(int param) /* expect+1: warning: 'local' unused in function 'example' [192] */ int local; } + + +void assertion_failed(const char *); + +void +assert_true(void) +{ + sizeof(char) == 1 + ? (void)0 +/* FIXME: '__func__' is used, the code is just not reachable. */ +/* expect+1: warning: '__func__' unused in function 'assert_true' [192] */ + : assertion_failed(__func__); +} + +void +assert_false(void) +{ + sizeof(char) == 0 + ? (void)0 + : assertion_failed(__func__); +} + +void +assert_unknown(_Bool cond) +{ + cond + ? (void)0 + : assertion_failed(__func__); +}
CVS commit: src/tests/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Tue Sep 12 06:51:02 UTC 2023 Modified Files: src/tests/usr.bin/xlint/lint1: msg_192.c Log Message: tests/lint: show that '?:' skips untaken branches early This is probably done to avoid wrong warnings from branches that are only taken on other platforms, but it also generates a wrong 'unused' warning. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_192.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.