]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
23 months agoAdjust function definitions in kern_dtrace.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 14:11:05 +0000 (16:11 +0200)]
Adjust function definitions in kern_dtrace.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/kern/kern_dtrace.c:64:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    kdtrace_proc_size()
                     ^
                      void
    sys/kern/kern_dtrace.c:87:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    kdtrace_thread_size()
                       ^
                        void

This is because kdtrace_proc_size() and kdtrace_thread_size() are
declared with (void) argument lists, but defined with empty argument
lists. Make the definitions match the declarations.

MFC after: 3 days

23 months agoAdjust function definitions in kern_cons.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 14:03:35 +0000 (16:03 +0200)]
Adjust function definitions in kern_cons.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/kern/kern_cons.c:201:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cninit_finish()
                 ^
                  void
    sys/kern/kern_cons.c:376:7: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cngrab()
          ^
           void
    sys/kern/kern_cons.c:389:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cnungrab()
            ^
             void
    sys/kern/kern_cons.c:402:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cnresume()
            ^
             void

This is because cninit_finish(), cngrab(), cnungrab(), and cnresume()
are declared with (void) argument lists, but defined with empty argument
lists. Make the definitions match the declarations.

MFC after: 3 days

23 months agoAdjust function definition in geom_subr.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 14:01:04 +0000 (16:01 +0200)]
Adjust function definition in geom_subr.c to avoid clang 15 warnings

With clang 15, the following -Werror warning is produced:

    sys/geom/geom_subr.c:484:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    g_wither_washer()
                   ^
                    void

This is because g_wither_washer() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust function definition in geom_io.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 14:00:08 +0000 (16:00 +0200)]
Adjust function definition in geom_io.c to avoid clang 15 warnings

With clang 15, the following -Werror warning is produced:

    sys/geom/geom_io.c:272:10: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    g_io_init()
             ^
              void

This is because g_io_init() is declared with a (void) argument list, but
defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoAdjust function definitions in geom_event.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 13:58:31 +0000 (15:58 +0200)]
Adjust function definitions in geom_event.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/geom/geom_event.c:261:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    g_run_events()
                ^
                 void
    sys/geom/geom_event.c:405:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    g_do_wither()
               ^
                void
    sys/geom/geom_event.c:449:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    g_event_init()
                ^
                 void

This is because g_run_events(), g_do_wither(), and g_event_init() are
declared with (void) argument lists, but defined with empty argument
lists. Make the definitions match the declarations.

MFC after: 3 days

23 months agoFix unused variable warning in sfxge's ef10_tx.c
Dimitry Andric [Tue, 26 Jul 2022 13:17:05 +0000 (15:17 +0200)]
Fix unused variable warning in sfxge's ef10_tx.c

With clang 15, the following -Werror warning is produced:

    sys/dev/sfxge/common/ef10_tx.c:345:15: error: variable 'eqp' set but not used [-Werror,-Wunused-but-set-variable]
            efx_qword_t *eqp;
                         ^

The 'eqp' variable is passed as an argument to the EFSYS_BAR_WC_WRITEQ()
macro, but currently this macro ignores the argument, similar to its
other _esbp argument. Silence the warning by casting the _eqp argument
to void in the macro.

MFC after: 3 days

23 months agoAdjust function definitions in xen's control.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 12:11:09 +0000 (14:11 +0200)]
Adjust function definitions in xen's control.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/dev/xen/control/control.c:188:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    xctrl_poweroff()
                  ^
                   void
    sys/dev/xen/control/control.c:194:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    xctrl_reboot()
                ^
                 void
    sys/dev/xen/control/control.c:207:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    xctrl_suspend()
                 ^
                  void
    sys/dev/xen/control/control.c:344:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    xctrl_crash()
               ^
                void

This is because xctrl_poweroff(), xctrl_reboot(), xctrl_suspend(), and
xctrl_crash() are declared with (void) argument lists, but defined with
empty argument lists. Make the definitions match the declarations.

MFC after: 3 days

23 months agoFix unused variable warning in xen's blkback.c
Dimitry Andric [Tue, 26 Jul 2022 12:02:36 +0000 (14:02 +0200)]
Fix unused variable warning in xen's blkback.c

With clang 15, the following -Werror warning is produced:

    sys/dev/xen/blkback/blkback.c:1561:12: error: variable 'req_seg_idx' set but not used [-Werror,-Wunused-but-set-variable]
                    u_int                    req_seg_idx;
                                             ^

The 'req_seg_idx' variable was used in the for loop later in the
xbb_dispatch_io() function, but refactoring in 112cacaee408 got rid of
it. Remove the variable since it no longer serves any purpose.

MFC after: 3 days

23 months agoFix unused variable warning in xen's blkfront.c
Dimitry Andric [Tue, 26 Jul 2022 12:01:26 +0000 (14:01 +0200)]
Fix unused variable warning in xen's blkfront.c

With clang 15, the following -Werror warning is produced:

    sys/dev/xen/blkfront/blkfront.c:602:6: error: variable 'sbp' set but not used [-Werror,-Wunused-but-set-variable]
            int sbp;
                ^

The 'sbp' variable was used in the for loop later in the xb_dump()
function, but refactoring in e4808c4b2dba got rid of it. Remove the
variable since it no longer serves any purpose.

MFC after:      3 days

23 months agoAdjust playinit() definition to avoid clang 15 warning
Dimitry Andric [Tue, 26 Jul 2022 11:43:46 +0000 (13:43 +0200)]
Adjust playinit() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/dev/speaker/spkr.c:182:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    playinit()
            ^
             void

This is because playinit() is declared with a (void) argument list, but
defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoAdjust check_struct_sizes() definition to avoid clang 15 warning
Dimitry Andric [Tue, 26 Jul 2022 11:20:58 +0000 (13:20 +0200)]
Adjust check_struct_sizes() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/dev/smartpqi/smartpqi_helper.c:374:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    check_struct_sizes()
                      ^
                       void

This is because check_struct_sizes() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust sctp_drain() definition to avoid clang 15 warning
Dimitry Andric [Tue, 26 Jul 2022 11:19:39 +0000 (13:19 +0200)]
Adjust sctp_drain() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/netinet/sctp_pcb.c:6946:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    sctp_drain()
              ^
               void

This is because sctp_drain() is declared with a (void) argument list,
but defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoUpdate to bmake-20220724
Simon J. Gerraty [Tue, 26 Jul 2022 16:07:25 +0000 (09:07 -0700)]
Update to bmake-20220724

Merge commit '308a28d6cd2e87028e535eabccb89a9dc2fd9515'

23 months agoImport bmake-20220724
Simon J. Gerraty [Tue, 26 Jul 2022 15:52:53 +0000 (08:52 -0700)]
Import bmake-20220724

Relevant/interesting changes:

o parse.c: fix out-of-bounds read when parsing an invalid line
        https://bugs.freebsd.org/265119
fix memory leak in wildcard targets and sources
fix off-by-one error in buffer for .WAIT nodes
o allow to randomize build order of targets
.MAKE.MODE += randomize-targets can help uncover dependency bugs

23 months agorc: Start testing the rc(8) framework (beginning with *_oomprotect)
Mateusz Piotrowski [Thu, 7 Jul 2022 18:24:27 +0000 (20:24 +0200)]
rc: Start testing the rc(8) framework (beginning with *_oomprotect)

This change adds 2 tests to make sure that the *_oomprotect variable
sets the protection against OOM killer properly within rc(8) scripts.

This is also adding the first tests for the rc(8) framework. More tests
will be added as we go.

PR: 256148
Approved by: des
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35745

23 months agoAdd pmc.dmc-620(3) man page.
Aleksandr Rybalko [Wed, 16 Feb 2022 00:19:46 +0000 (00:19 +0000)]
Add pmc.dmc-620(3) man page.

Reviewed by: pauamma
Sponsored By: Ampere Computing
Differential Revision: https://reviews.freebsd.org/D32669

23 months agox86/iommu: Correct a recent change to iommu_domain_unload_entry()
Alan Cox [Tue, 26 Jul 2022 04:53:15 +0000 (23:53 -0500)]
x86/iommu: Correct a recent change to iommu_domain_unload_entry()

Correct 8bc367384745.  When iommu_domain_unload_entry() performs a
synchronous IOTLB invalidation, it must call dmar_domain_free_entry()
to remove the entry from the domain's RB_TREE.

Push down the acquisition and release of the DMAR lock into the
recently introduced function dmar_qi_invalidate_sync_locked() and
remove the _locked suffix.

MFC with: 8bc367384745

23 months agostand: Fix set but unused warning
Warner Losh [Tue, 26 Jul 2022 04:48:31 +0000 (22:48 -0600)]
stand: Fix set but unused warning

Make interp_identifier global to avoid a set but not used warning. For a
global, llvm can't optimize it out (yet?)

Sponsored by: Netflix

23 months agocdefs: Add some notes about the different versions of POSIX
Warner Losh [Mon, 25 Jul 2022 22:19:28 +0000 (16:19 -0600)]
cdefs: Add some notes about the different versions of POSIX

POSIX versions are a bit weird, so add some notes here.

Sponsored by: Netflix

23 months agoatomic: Add some type checking to plain atomic_load/store helpers
Mark Johnston [Mon, 25 Jul 2022 21:48:46 +0000 (17:48 -0400)]
atomic: Add some type checking to plain atomic_load/store helpers

Reviewed by: rpokala, mjg, imp, kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35828

23 months agoAdjust sctp_init_sysctls() definition to avoid clang 15 warning
Dimitry Andric [Mon, 25 Jul 2022 20:07:49 +0000 (22:07 +0200)]
Adjust sctp_init_sysctls() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/netinet/sctp_sysctl.c:55:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    sctp_init_sysctls()
                     ^
                      void

This is because sctp_init_sysctls() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoFix unused variable warning in sctp_timer.c
Dimitry Andric [Mon, 25 Jul 2022 20:06:28 +0000 (22:06 +0200)]
Fix unused variable warning in sctp_timer.c

With clang 15, the following -Werror warning is produced:

    sys/netinet/sctp_timer.c:510:6: error: variable 'recovery_cnt' set but not used [-Werror,-Wunused-but-set-variable]
            int recovery_cnt = 0;
                ^

The 'recovery_cnt' variable is only used when INVARIANTS is undefined.
Ensure it is only declared and set in that case.

MFC after: 3 days

23 months agoFix unused variable warning in sctp_output.c
Dimitry Andric [Mon, 25 Jul 2022 19:50:40 +0000 (21:50 +0200)]
Fix unused variable warning in sctp_output.c

With clang 15, the following -Werror warning is produced:

    sys/netinet/sctp_output.c:9367:33: error: variable 'cnt_thru' set but not used [-Werror,-Wunused-but-set-variable]
            int no_fragmentflg, bundle_at, cnt_thru;
                                           ^

The 'cnt_thru' variable was in sctp_output.c when it was first added,
but appears to have been a debugging aid that has never been used, so
remove it.

MFC after: 3 days

23 months agoFix unused variable warnings in sctp_indata.c
Dimitry Andric [Mon, 25 Jul 2022 19:15:52 +0000 (21:15 +0200)]
Fix unused variable warnings in sctp_indata.c

With clang 15, the following -Werror warnings are produced:

    sys/netinet/sctp_indata.c:3309:6: error: variable 'tot_retrans' set but not used [-Werror,-Wunused-but-set-variable]
            int tot_retrans = 0;
                ^
    sys/netinet/sctp_indata.c:3842:20: error: variable 'resend' set but not used [-Werror,-Wunused-but-set-variable]
            int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0;
                              ^
    sys/netinet/sctp_indata.c:3842:47: error: variable 'acked' set but not used [-Werror,-Wunused-but-set-variable]
            int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0;
                                                         ^
    sys/netinet/sctp_indata.c:3842:58: error: variable 'above' set but not used [-Werror,-Wunused-but-set-variable]
            int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0;
                                                                    ^

The 'tot_retrans' variable was used in sctp_strike_gap_ack_chunks(), but
refactoring in 493d8e5a830e got rid of it. Remove the variable since it
no longer serves any purpose.

The 'resend', 'acked', and 'above' variables are only used when
INVARIANTS is undefined. Ensure they are only declared and set in that
case.

MFC after: 3 days

23 months agoAdjust function definitions in if_pfsync.c to avoid clang 15 warnings
Dimitry Andric [Mon, 25 Jul 2022 18:53:32 +0000 (20:53 +0200)]
Adjust function definitions in if_pfsync.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/netpfil/pf/if_pfsync.c:2439:21: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pfsync_pointers_init()
                        ^
                         void
    sys/netpfil/pf/if_pfsync.c:2453:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pfsync_pointers_uninit()
                          ^
                           void
    sys/netpfil/pf/if_pfsync.c:2503:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pfsync_init()
               ^
                void
    sys/netpfil/pf/if_pfsync.c:2524:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pfsync_uninit()
                 ^
                  void

This is because pfsync_pointers_init(), pfsync_pointers_uninit(),
pfsync_init(), and pfsync_uninit() are declared with (void) argument
lists, but defined with empty argument lists. Make the definitions match
the declarations.

MFC after: 3 days

23 months agoFix unused variable warning in if_pfsync.c
Dimitry Andric [Mon, 25 Jul 2022 18:15:51 +0000 (20:15 +0200)]
Fix unused variable warning in if_pfsync.c

With clang 15, the following -Werror warning is produced:

    sys/netpfil/pf/if_pfsync.c:2153:9: error: variable 'sent' set but not used [-Werror,-Wunused-but-set-variable]
            int i, sent = 0;
                   ^

The 'sent' variable was used in the for loop later in the
pfsync_bulk_update() function, but refactoring in 4fc65bcbe3fb7 got rid
of it. Remove the variable since it no longer serves any purpose.

MFC after: 3 days

23 months agoAdjust function definitions in pf.c to avoid clang 15 warnings
Dimitry Andric [Mon, 25 Jul 2022 17:59:59 +0000 (19:59 +0200)]
Adjust function definitions in pf.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/netpfil/pf/pf.c:985:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pf_mtag_initialize()
                      ^
                       void
    sys/netpfil/pf/pf.c:995:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pf_initialize()
                 ^
                  void
    sys/netpfil/pf/pf.c:1089:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pf_mtag_cleanup()
                   ^
                    void
    sys/netpfil/pf/pf.c:1096:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pf_cleanup()
              ^
               void
    sys/netpfil/pf/pf.c:1989:27: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pf_purge_expired_src_nodes()
                              ^
                               void
    sys/netpfil/pf/pf.c:2174:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pf_purge_unlinked_rules()
                           ^
                            void

This is because pf_mtag_initialize(), pf_initialize(),
pf_mtag_cleanup(), pf_cleanup(), pf_purge_expired_src_nodes(), and
pf_purge_unlinked_rules() are declared with (void) argument lists, but
defined with empty argument lists. Make the definitions match the
declarations.

MFC after: 3 days

23 months agoAdjust ng_{name,ID}_rehash() definitions to avoid clang 15 warnings
Dimitry Andric [Mon, 25 Jul 2022 11:04:29 +0000 (13:04 +0200)]
Adjust ng_{name,ID}_rehash() definitions to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/netgraph/ng_base.c:981:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ng_name_rehash()
                  ^
                   void
    sys/netgraph/ng_base.c:1012:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ng_ID_rehash()
                ^
                 void

This is because ng_name_rehash() and ng_ID_rehash() are declared with
(void) argument lists, but defined with empty argument lists. Make the
definitions match the declarations.

MFC after: 3 days

23 months agolibcrypto: Work around strict aliasing violations in bn_nist.c
Jessica Clarke [Mon, 25 Jul 2022 17:17:50 +0000 (18:17 +0100)]
libcrypto: Work around strict aliasing violations in bn_nist.c

This file is full of strict aliasing violations. Previously it was only
optimised in ways that broke the code by CHERI LLVM, but now it appears
that the in-tree LLVM also breaks it for RISC-V, resulting in broken
ECDSA signature validation with error messages like the following:

  root@unmatched:/usr/src # ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key
  /etc/ssh/ssh_host_ecdsa_key is not a key file.
  root@unmatched:/usr/src # git fetch
  fatal: unable to access 'https://git.FreeBSD.org/src.git/': error:1012606B:elliptic curve routines:EC_POINT_set_affine_coordinates:point is not on curve

Reviewed by: dim, jkim
Obtained from: CheriBSD
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35885

23 months agoiommu_gas: Eliminate a possible case of use-after-free
Alan Cox [Fri, 22 Jul 2022 17:00:26 +0000 (12:00 -0500)]
iommu_gas: Eliminate a possible case of use-after-free

Eliminate a possible case of use-after-free in an error handling path
after a mapping failure.  Specifically, eliminate IOMMU_MAP_ENTRY_QI_NF
and instead perform the IOTLB invalidation synchronously.  Otherwise,
when iommu_domain_unload_entry() is called and told not to free the
IOMMU map entry, the caller could free the entry before dmar_qi_task()
is finished with it.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35878

23 months agoasmc: Add support for MacBookPro6,2
ed crowe [Mon, 25 Jul 2022 15:35:46 +0000 (11:35 -0400)]
asmc: Add support for MacBookPro6,2

Modify asmc_sms_printintr() to be silent when the ambient light sensor
interrupt fires on this model, since the messages can otherwise fill up
the dmesg.

PR: 265005
Reviewed by: markj
MFC after: 2 weeks

23 months agoAdd ELFCOMPRESS_ZSTD ELF compression constant
Ed Maste [Tue, 28 Jun 2022 13:06:12 +0000 (09:06 -0400)]
Add ELFCOMPRESS_ZSTD ELF compression constant

ELFCOMPRESS_ZSTD indicates that an ELF section is compressed with zstd.
It is the second compression type, after the existing ELFCOMPRESS_ZLIB.
Zstd generally provides a compelling tradeoff of speed and compression
(other algorithms may compress slightly better but take a lot longer,
or run faster but do not compress nearly as well).

See https://groups.google.com/g/generic-abi/c/satyPkuMisk for details.
ELFCOMPRESS_ZSTD will be supported in a future Clang/LLVM update.  ELF
Tool Chain tools also need updating.

Reviewed by: Fangrui Song
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

23 months agostand/disk: Trivial formatting nit
Warner Losh [Mon, 25 Jul 2022 13:32:15 +0000 (07:32 -0600)]
stand/disk: Trivial formatting nit

style(9) wants a space here.

Sponsored by: Netflix

23 months agohier(7): document libdata/pkgconfig
Baptiste Daroussin [Mon, 25 Jul 2022 09:14:50 +0000 (11:14 +0200)]
hier(7): document libdata/pkgconfig

23 months agoAdd d_sblockloc to libufs(3) disk structure to allow options to be added.
Kirk McKusick [Mon, 25 Jul 2022 01:10:39 +0000 (18:10 -0700)]
Add d_sblockloc to libufs(3) disk structure to allow options to be added.

By making the disk block parameter used by the libufs(3) sbread(3)
function visible, applications using sbread(3) can set their own
addition options such as using the STDSB_NOHASHFAIL request to
say that they want the superblock read to succeed even when
the superblock checkhash is incorrect.

While here also add an error message when a check-hash failure
is detected.

23 months agoHave dumpfs(8) ignore superblock check-hash failures.
Kirk McKusick [Mon, 25 Jul 2022 01:01:43 +0000 (18:01 -0700)]
Have dumpfs(8) ignore superblock check-hash failures.

Set the STDSB_NOHASHFAIL request so that dumpfs(8) can print out
filesystem details even when the superblock checksum is incorrect.

23 months agoOutput fs_csaddr rather than fs_old_csaddr for UFS1 filesystems.
Kirk McKusick [Mon, 25 Jul 2022 00:33:19 +0000 (17:33 -0700)]
Output fs_csaddr rather than fs_old_csaddr for UFS1 filesystems.

Since fs_csaddr is what will actually be used, show that value rather
than the historic and possibly incorrect value for UFS1 filesystems.

23 months agostand/zfs: Update comment about blake3_impl_hack.c
Warner Losh [Sun, 24 Jul 2022 21:55:49 +0000 (15:55 -0600)]
stand/zfs: Update comment about blake3_impl_hack.c

Fix a typo by reworking the comment for blake3_impl_hack.c and amplify
the nature of the hack and its temporary reason for existing.

Sponsored by: Netflix
Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D35895

23 months agostand/libsa: zfs use standard ZFS_EARLY stuff
Warner Losh [Sun, 24 Jul 2022 21:53:56 +0000 (15:53 -0600)]
stand/libsa: zfs use standard ZFS_EARLY stuff

Now that the minor issues preventing zfs.c from using CFLAGS_EARLY have
been fixed, use that mechanism like everything else that needs the
OpenZFS spl headers. This simplifies things somewhat. Update comments to
document why zfs.c is still special, though in different ways.

Note: We also use the fact that NEED_SOLARIS_BOOLEAN is only defined in
an environment where the solaris compat boolean stuff will be defined
prior to this point (eg, when we're building zfs.c in libsa), but not in
other environments (like when we're building mkimage and stand-alone
boot loaders that don't use libsa). These latter uses should be changed
to use the same ZFS compile env, but aren't as part of this commit.
This has to be done in the same change as the ZFS_EARLY change to not
break zfs.c building for one commit affecting bisectabiltiy.

Sponsored by: Netflix
Reviewed by: tsoome, delphij
Differential Revision: https://reviews.freebsd.org/D35894

23 months agozfs: Increase compatibility for different environments
Warner Losh [Sun, 24 Jul 2022 21:53:14 +0000 (15:53 -0600)]
zfs: Increase compatibility for different environments

libsa uses the full OpenZFS compilation environment when we build this
included in zfs.c there. Other parts of the tree have not been adapted
to the full OpenZFS environment yet and need these ASSERT* defines to
build properly. Since the ASSERT* macros are normally defined in
sys/debug.h in the OpenZFS compatibility spl, only define them when
ASSERT3S is not defined to cope with the parts of the loader that don't
yet use the full OpenZFS environment.

Sponsored by: Netflix
Reviewed by: tsoome, delphij
Differential Revision: https://reviews.freebsd.org/D35893

23 months agoskein: Update guard define check
Warner Losh [Sun, 24 Jul 2022 21:52:20 +0000 (15:52 -0600)]
skein: Update guard define check

OpenZFS changed the define _OPENSOLARIS_SYS_TYPES_H_ to
_SPL_SYS_TYPES_H_ to guard the sys/types.h compatibility file
inclusion. Follow the change here. The only place in the tree
_OPENSOLARIS_SYS_TYPES_H_ is mentioned is in the /*
_OPENSOLARIS_SYS_TYPES_H_ */ at the end of sys/types.h. That needs to be
changed upstream in OpenZFS since we don't like changing things in
FreeBSD's tree.

Sponsored by: Netflix
Reviewed by: tsoome, delphij
Differential Revision: https://reviews.freebsd.org/D35891

23 months agostand/zfs: Limit flags further for ZFS
Warner Losh [Sun, 24 Jul 2022 21:51:53 +0000 (15:51 -0600)]
stand/zfs: Limit flags further for ZFS

Constrain CFLAGS for ZFS: don't add anything globally. Add the includes
to only the files that need them. Add -DHAS_ZSTD_ZFS to zfs.c (which
includes zfsimpl.c which includes zfssubr.c both of which need this
defined). Also add it to efi/boot1/Makefile since zfs_module.c also
includes zfsimple.c.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D35887

23 months agostand: Use c99 structure initialization for userboot's host_fsops
Warner Losh [Sun, 24 Jul 2022 21:51:50 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for userboot's host_fsops

Sponsored by: Netflix

23 months agostand: Use c99 structure initialization for gzipfs_fsops
Warner Losh [Sun, 24 Jul 2022 21:51:47 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for gzipfs_fsops

Sponsored by: Netflix

23 months agostand: Use c99 structure initialization for splitfs_fsops
Warner Losh [Sun, 24 Jul 2022 21:51:44 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for splitfs_fsops

Sponsored by: Netflix

23 months agostand: Use c99 structure initialization for pkgfs_fsops
Warner Losh [Sun, 24 Jul 2022 21:51:42 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for pkgfs_fsops

Sponsored by: Netflix

23 months agostand: Use c99 structure initialization for nfs_fsops
Warner Losh [Sun, 24 Jul 2022 21:51:39 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for nfs_fsops

Sponsored by: Netflix

23 months agostand: Use c99 structure initialization for bzipfs_fsops
Warner Losh [Sun, 24 Jul 2022 21:51:36 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for bzipfs_fsops

Sponsored by: Netflix

23 months agostand: Use c99 structure initialization for ext2fs_fsops
Warner Losh [Sun, 24 Jul 2022 21:51:34 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for ext2fs_fsops

Sponsored by: Netflix

23 months agostand: Use c99 structure initialization for network device
Warner Losh [Sun, 24 Jul 2022 21:51:32 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for network device

Use c99 structure init for devsw.

Sponsored by: Netflix

23 months agostand: Use c99 structure initialization for fwohci device
Warner Losh [Sun, 24 Jul 2022 21:51:29 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for fwohci device

Use c99 structure init for devsw.

Sponsored by: Netflix

23 months agostand: Use c99 structure initialization for userboot block device
Warner Losh [Sun, 24 Jul 2022 21:51:27 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for userboot block device

Use c99 structure init for devsw.

Sponsored by: Netflix

23 months agostand: Use c99 structure initialization for uboot block device
Warner Losh [Sun, 24 Jul 2022 21:51:24 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for uboot block device

Use c99 structure init for devsw.

Sponsored by: Netflix

23 months agostand: Use c99 structure initialization for ofw's block device
Warner Losh [Sun, 24 Jul 2022 21:51:21 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for ofw's block device

Use c99 structure init for devsw.

Sponsored by: Netflix

23 months agostand: Use c99 structure initialization for kboot's hostdisk device
Warner Losh [Sun, 24 Jul 2022 21:51:19 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for kboot's hostdisk device

Use c99 structure init for devsw.

Sponsored by: Netflix

23 months agostand: Use c99 structure initialization for md device
Warner Losh [Sun, 24 Jul 2022 21:51:15 +0000 (15:51 -0600)]
stand: Use c99 structure initialization for md device

Use c99 structure init for devsw.

Sponsored by: Netflix

23 months agotools/boot: Fix universe.sh's ZFS exclusion test
Warner Losh [Sun, 24 Jul 2022 21:51:06 +0000 (15:51 -0600)]
tools/boot: Fix universe.sh's ZFS exclusion test

MK_LOADER_ZFS is the current spelling of enabling or disabling ZFS
builds. Use it instead of MK_ZFS.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D35896

23 months agoFix unused variable warning in mlx5_ib_devx.c
Dimitry Andric [Sun, 24 Jul 2022 22:22:05 +0000 (00:22 +0200)]
Fix unused variable warning in mlx5_ib_devx.c

With clang 15, the following -Werror warning is produced:

    sys/dev/mthca/mthca_cmd.c:662:23: error: variable 'tc' set but not used [-Werror,-Wunused-but-set-variable]
            int ts __unused = 0, tc = 0;
                                 ^

The 'ts' and 'tc' variables are eventually used only in mthca_dbg()
macros, if CONFIG_INFINIBAND_MTHCA_DEBUG is defined. Ensure 'ts' and
'tc' are only declared and used when CONFIG_INFINIBAND_MTHCA_DEBUG is
defined.

MFC after: 3 days

23 months agoFix unused variable warning in mlx5_ib_devx.c
Dimitry Andric [Sun, 24 Jul 2022 22:16:18 +0000 (00:16 +0200)]
Fix unused variable warning in mlx5_ib_devx.c

With clang 15, the following -Werror warning is produced:

    sys/dev/mlx5/mlx5_ib/mlx5_ib_devx.c:1926:6: error: variable 'num_alloc_xa_entries' set but not used [-Werror,-Wunused-but-set-variable]
            int num_alloc_xa_entries = 0;
                ^

The 'num_alloc_xa_entries' variable appears to have been a debugging aid
that has never been used for anything, so remove it.

MFC after: 3 days

23 months agoFix unused variable warning in mlx5_fs_tree.c
Dimitry Andric [Sun, 24 Jul 2022 22:09:33 +0000 (00:09 +0200)]
Fix unused variable warning in mlx5_fs_tree.c

With clang 15, the following -Werror warning is produced:

    sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c:1408:15: error: variable 'candidate_group_num' set but not used [-Werror,-Wunused-but-set-variable]
            unsigned int candidate_group_num = 0;
                         ^

The 'candidate_group_num' variable appears to have been a debugging aid
that has never been used for anything, so remove it.

MFC after: 3 days

23 months agoAdjust linux_vdso_{cpu,tsc}_selector_idx() definitions to avoid clang 15 warnings
Dimitry Andric [Sun, 24 Jul 2022 21:53:22 +0000 (23:53 +0200)]
Adjust linux_vdso_{cpu,tsc}_selector_idx() definitions to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/x86/linux/linux_vdso_selector_x86.c:44:28: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    linux_vdso_tsc_selector_idx()
                               ^
                                void
    sys/x86/linux/linux_vdso_selector_x86.c:62:28: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    linux_vdso_cpu_selector_idx()
                               ^
                                void

This is because linux_vdso_tsc_selector_idx() and
linux_vdso_cpu_selector_idx are declared with (void) argument lists, but
defined with empty argument lists. Make the definitions match the
declarations.

MFC after: 3 days

23 months agoAdjust linux_get_char_devices() definition to avoid clang 15 warning
Dimitry Andric [Sun, 24 Jul 2022 21:46:54 +0000 (23:46 +0200)]
Adjust linux_get_char_devices() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/compat/linux/linux_util.c:243:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    linux_get_char_devices()
                          ^
                           void

This is because linux_get_char_devices() is declared with a (void)
argument list, but defined with an empty argument list. Make the
definition match the declaration.

MFC after: 3 days

23 months agoAdjust authnone_create() definition to avoid clang 15 warning
Dimitry Andric [Sun, 24 Jul 2022 21:40:20 +0000 (23:40 +0200)]
Adjust authnone_create() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/rpc/auth_none.c:106:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    authnone_create()
                   ^
                    void

This is because authnone_create() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust svc_vc_null() definition to avoid clang 15 warning
Dimitry Andric [Sun, 24 Jul 2022 21:38:46 +0000 (23:38 +0200)]
Adjust svc_vc_null() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/rpc/svc_vc.c:1078:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    svc_vc_null()
               ^
                void

This is because svc_vc_null() is declared with a (void) argument list,
but defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoAdjust local_rpcb() definition to avoid clang 15 warning
Dimitry Andric [Sun, 24 Jul 2022 21:28:43 +0000 (23:28 +0200)]
Adjust local_rpcb() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/rpc/rpcb_clnt.c:439:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    local_rpcb()
              ^
               void

This is because local_rpcb() is declared with a (void) argument list,
but defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoAdjust irdma_prep_for_unregister() definition to avoid clang 15 warning
Dimitry Andric [Sun, 24 Jul 2022 21:27:24 +0000 (23:27 +0200)]
Adjust irdma_prep_for_unregister() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/dev/irdma/icrdma.c:621:26: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    irdma_prep_for_unregister()
                             ^
                              void

This is because irdma_prep_for_unregister() is declared with a (void)
argument list, but defined with an empty argument list. Make the
definition match the declaration.

MFC after: 3 days

23 months agoFix unused variable warning in icl_soft.c
Dimitry Andric [Sun, 24 Jul 2022 20:54:08 +0000 (22:54 +0200)]
Fix unused variable warning in icl_soft.c

With clang 15, the following -Werror warning is produced:

    sys/dev/iscsi//icl_soft.c:886:6: error: variable 'coalesced' set but not used [-Werror,-Wunused-but-set-variable]
            int coalesced, error;
                ^

The 'coalesced' variable is eventually used only in an #if 0'd block,
obviously meant for debugging. Ensure that 'coalesced' is only declared
and used when DEBUG_COALESCED is defined, so the debugging can be easily
turned on later, if desired.

MFC after: 3 days

23 months agonl: Correct history
Warner Losh [Sun, 24 Jul 2022 20:58:44 +0000 (14:58 -0600)]
nl: Correct history

nl actually first was available with System III, not System Vr2. Updated
based on discussion on TUHS mailing list (archive recently moved so this
message isn't get available in the archive).

Suggested by: segalogo (Matt G)

23 months agoReap dead code in lio_kqueue_test and aio_kqueue_test
Alan Somers [Mon, 30 May 2022 18:34:49 +0000 (12:34 -0600)]
Reap dead code in lio_kqueue_test and aio_kqueue_test

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35358

23 months agoAdd more aio tests
Alan Somers [Tue, 31 May 2022 02:20:55 +0000 (20:20 -0600)]
Add more aio tests

* Add tests for kqueue completion with all file types.
* Add a test for kqueue completion with EV_ONESHOT.
* Cleanup an unused variable.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35359

23 months agoprometheus_sysctl_exporter: ignore ENOENT for mibs specified on the CLI
Alan Somers [Tue, 21 Jun 2022 18:51:14 +0000 (12:51 -0600)]
prometheus_sysctl_exporter: ignore ENOENT for mibs specified on the CLI

They might belong to kernel modules not currently loaded, or to other
kernel versions.  Ignoring them allows the configuration to be shared
between multiple hosts.

MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: rew
Differential Revision: https://reviews.freebsd.org/D35540

23 months agoRevert "Fill in cn_name in struct consdev."
Jessica Clarke [Sat, 23 Jul 2022 21:44:19 +0000 (22:44 +0100)]
Revert "Fill in cn_name in struct consdev."

This reverts commit 82a21151cf1d7a3e9e95b9edbbf74ac10f386d6a.

This commit was made to aid debugging before consoles are initialised so
that they can more easily be identified from a debugger. However,
various consoles (cfecons, ofwcons, mambocons and rcons) all check
whether cn_name[0] is non-zero to see they are attached or not, and so
this breaks that (perhaps misguided) approach. On RISC-V this results in
rcons (the SBI firmware console driver) racing with the real UART driver
and so input gets probabilistically lost on the real UART (around 2/3 of
the time for me on QEMU).

Moreover, the name given to CONSOLE_DRIVER isn't necessarily the same as
what eventually gets written to cn_name, such as cfecons vs cfe, rcons
vs riscv, ttyj0 vs aju, ttyv0 vs sc, ttyuN vs uart_phyp/opal and all
manner of things vs ucom, so in some cases this is in fact misleading as
the name will change after attaching.

Discussed with: cperciva

23 months agoConvert runtime param checks to KASSERTs for fo_fspacectl
Ka Ho Ng [Sat, 23 Jul 2022 19:14:45 +0000 (15:14 -0400)]
Convert runtime param checks to KASSERTs for fo_fspacectl

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D35880

23 months agoif_vlan: avoid hash table thrashing when adding and removing entries
Kristof Provost [Fri, 22 Jul 2022 17:17:04 +0000 (19:17 +0200)]
if_vlan: avoid hash table thrashing when adding and removing entries

vlan_remhash() uses incorrect value for b.

When using the default value for VLAN_DEF_HWIDTH (4), the VLAN hash-list table
expands from 16 chains to 32 chains as the 129th entry is added. trunk->hwidth
becomes 5. Say a few more entries are added and there are now 135 entries.
trunk-hwidth will still be 5. If an entry is removed, vlan_remhash() will
calculate a value of 32 for b. refcnt will be decremented to 134. The if
comparison at line 473 will return true and vlan_growhash() will be called. The
VLAN hash-list table will be compressed from 32 chains wide to 16 chains wide.
hwidth will become 4. This is an error, and it can be seen when a new VLAN is
added. The table will again be expanded. If an entry is then removed, again
the table is contracted.

If the number of VLANS stays in the range of 128-512, each time an insert
follows a remove, the table will expand. Each time a remove follows an
insert, the table will be contracted.

The fix is simple. The line 473 should test that the number of entries has
decreased such that the table should be contracted using what would be the new
value of hwidth. line 467 should be:

b = 1 << (trunk->hwidth - 1);

PR: 265382
Reviewed by: kp
MFC after: 2 weeks
Sponsored by: NetApp, Inc.

23 months agostand geli: Restore include path to LDRSRC.
John Baldwin [Fri, 22 Jul 2022 15:56:18 +0000 (09:56 -0600)]
stand geli: Restore include path to LDRSRC.

Various GELI sources need bootstrap.h and disk.h. In theory they
shouldn't need anything outside of libsa, but disk.h and bootstrap.h are
currently required.

This fixes the build with MK_LOADER_ZFS=no.

Obtained from: CheriBSD
Fixes: eaf7aabddcde stand: geli CFLAGS tightening
Sponsored by: DARPA
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D35861

23 months agostand libsa: Restore include path to LDRSRC for disk.h for filesystems.
John Baldwin [Fri, 22 Jul 2022 15:53:57 +0000 (09:53 -0600)]
stand libsa: Restore include path to LDRSRC for disk.h for filesystems.

In theory they shouldn't need anything outside of libsa, but disk.h and
bootstrap.h are currently required. Future work wil address this issue.

This fixes the build with MK_LOADER_ZFS=no. ZFS's Makefile.inc adds
these flags globally to CFLAGS when it should not. This masked the
problem because the tools/boot/universe.sh didn't build MK_LOADER_ZFS=no
as part of its regressions. Future work will also fix this.

Obtained from: CheriBSD
Fixes: 84bf2bbbecc3 stand: constrain zlib/gzip CFLAGS better
Sponsored by: DARPA
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D35860

23 months agofind.1: small language fix after previous change
Eugene Grosbein [Fri, 22 Jul 2022 11:46:38 +0000 (18:46 +0700)]
find.1: small language fix after previous change

collate -> collation

23 months agofind.1: explain why "find -s" may differ from "find | sort"
Eugene Grosbein [Fri, 22 Jul 2022 11:39:47 +0000 (18:39 +0700)]
find.1: explain why "find -s" may differ from "find | sort"

In short, that's because a directory name may end
with a character that goes before slash (/).

MFC after: 1 week

23 months agoig4(4): Add device HID to match I2C controller on ASUS X540 laptops
Vladimir Kondratyev [Thu, 21 Jul 2022 23:19:15 +0000 (02:19 +0300)]
ig4(4): Add device HID to match I2C controller on ASUS X540 laptops

Tested by: Andrés Ramírez <rrandresf_AT_hotmail_DOT_com>
MFC after: 1 week

23 months agolibnv: bump library version
Kristof Provost [Thu, 21 Jul 2022 18:07:22 +0000 (20:07 +0200)]
libnv: bump library version

Now that we version symbols we should bump the library major version.
While here use version FBSD_1.7 to match the current HEAD FreeBSD
namespace and remove extraneous 'All rights reserved' and incorrect
copyright statement.

Reviewed by: kevans
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35875

23 months agocheck/delete-old: Fix /bin/rmail removal condition
Dmitry Chagin [Thu, 21 Jul 2022 22:20:25 +0000 (01:20 +0300)]
check/delete-old: Fix /bin/rmail removal condition

When WITHOUT_SENDMAIL is enabled and WITHOUT_MAILWRAPPER is disabled
we install /bin/rmail as a link to the /usr/sbin/mailwrapper.
Ensure make delete-old does not unlink /bin/rmail in that case.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D35874
MFC after: 2 weeks

23 months agoAdjust vt_mouse_paste() definition to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 20:10:22 +0000 (22:10 +0200)]
Adjust vt_mouse_paste() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/dev/vt/vt_core.c:2129:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    vt_mouse_paste()
                  ^
                   void

This is because vt_mouse_paste() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoFix unused variable warning in ipsec_mbuf.c
Dimitry Andric [Thu, 21 Jul 2022 20:03:50 +0000 (22:03 +0200)]
Fix unused variable warning in ipsec_mbuf.c

With clang 15, the following -Werror warning is produced:

    sys/netipsec/ipsec_mbuf.c:93:24: error: variable 'alloc' set but not used [-Werror,-Wunused-but-set-variable]
                    int todo, len, done, alloc;
                                         ^

The 'alloc' variable appears to have been a debugging aid that has never
been used for anything, so remove it.

MFC after: 3 days

23 months agogmirror.8: Remove references rc.early
Mateusz Piotrowski [Thu, 21 Jul 2022 19:43:14 +0000 (21:43 +0200)]
gmirror.8: Remove references rc.early

The manual page of gmirror describes how gmirror providers can be used
for kernel dumps. Unfortunately, the instruction references
/etc/rc.early, which is no longer a part of rc(8).

Remove references to rc.early and suggest creating an rc(8) service
script instead.

Future work: In the Problem Report on Bugzilla, Lawrence Chen suggested
adding example rc(8) scripts to the gmirror. However, those examples
need to be tested before they become official reference examples in the
base. Also, those scripts should probably land directly to /etc/rc.d,
/usr/share/examples/rc.d, or /usr/share/examples/gmirror instead of the
gmirror manual page.

PR: 178818
Reported by: Lawrence Chen <beastie@tardisi.com>
Fixes: dd2b024a336f Removal of early.sh
MFC after: 1 week

23 months agoFix unused variable warning in if_re_netmap.h
Dimitry Andric [Thu, 21 Jul 2022 19:52:29 +0000 (21:52 +0200)]
Fix unused variable warning in if_re_netmap.h

With clang 15, the following -Werror warning is produced:

    sys/dev/netmap/if_re_netmap.h:179:8: error: variable 'n' set but not used [-Werror,-Wunused-but-set-variable]
            u_int n;
                  ^

The 'n' variable appears to have been a debugging aid that has never
been used for anything, so remove it.

MFC after: 3 days

23 months agoAdjust tdsaContext_t::NvmdResponseSet declaration to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 19:49:47 +0000 (21:49 +0200)]
Adjust tdsaContext_t::NvmdResponseSet declaration to avoid clang 15 warning

With clang 15, the following -Werror warnings are produced:

    In file included from sys/dev/pms/freebsd/driver/ini/src/agtiapi.c:70:
    sys/dev/pms/RefTisa/tisa/sassata/common/tdsatypes.h:346:13: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
      volatile  NvmdResponseSet;
      ~~~~~~~~  ^
      int

The NvmdResponseSet member is effectively only used as a boolean in the
pms(4) driver, so it could be a single bit. But to avoid changing the
semantics at all in this unmaintained driver, simply declare it as a
volatile int.

MFC after: 3 days

23 months agoAdjust ipfw_iface_{init,destroy}() definitions to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 19:37:09 +0000 (21:37 +0200)]
Adjust ipfw_iface_{init,destroy}() definitions to avoid clang 15 warning

With clang 15, the following -Werror warnings are produced:

    sys/netpfil/ipfw/ip_fw_iface.c:206:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_iface_init()
                   ^
                    void
    sys/netpfil/ipfw/ip_fw_iface.c:219:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_iface_destroy()
                      ^
                       void

This is because ipfw_iface_init() and ipfw_iface_destroy() are declared
with (void) argument lists, but defined with empty argument lists. Make
the definitions match the declarations.

MFC after: 3 days

23 months agoAdjust iface_khandler_deregister() definition to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 19:32:16 +0000 (21:32 +0200)]
Adjust iface_khandler_deregister() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/netpfil/ipfw/ip_fw_iface.c:159:26: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    iface_khandler_deregister()
                             ^
                              void

This is because iface_khandler_deregister() is declared with a (void)
argument list, but defined with an empty argument list. Make the
definition match the declaration.

MFC after: 3 days

23 months agoAdjust ipfw_{init,destroy}_sopt_handler() definitions to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 19:30:05 +0000 (21:30 +0200)]
Adjust ipfw_{init,destroy}_sopt_handler() definitions to avoid clang 15 warning

With clang 15, the following -Werror warning are produced:

    sys/netpfil/ipfw/ip_fw_sockopt.c:3477:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_init_sopt_handler()
                          ^
                           void
    sys/netpfil/ipfw/ip_fw_sockopt.c:3485:26: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_destroy_sopt_handler()
                             ^
                              void

This is because ipfw_init_sopt_handler() and ipfw_destroy_sopt_handler()
are declared with (void) argument lists, but defined with empty argument
lists. Make the definitions match the declarations.

MFC after: 3 days

23 months agoAdjust iface_khandler_register() definition to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 19:28:03 +0000 (21:28 +0200)]
Adjust iface_khandler_register() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/netpfil/ipfw/ip_fw_iface.c:128:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    iface_khandler_register()
                           ^
                            void

This is because iface_khandler_register() is declared with a (void)
argument list, but defined with an empty argument list. Make the
definition match the declaration.

MFC after: 3 days

23 months agoAdjust ipfw_{init,destroy}_*() definitions to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 19:23:13 +0000 (21:23 +0200)]
Adjust ipfw_{init,destroy}_*() definitions to avoid clang 15 warning

With clang 15, the following -Werror warnings are produced:

    sys/netpfil/ipfw/ip_fw_sockopt.c:187:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_init_counters()
                      ^
                       void
    sys/netpfil/ipfw/ip_fw_sockopt.c:196:22: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_destroy_counters()
                         ^
                          void
    sys/netpfil/ipfw/ip_fw_sockopt.c:3241:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_init_obj_rewriter()
                          ^
                           void
    sys/netpfil/ipfw/ip_fw_sockopt.c:3249:26: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_destroy_obj_rewriter()
                             ^
                              void

This is because ipfw_init_counters(), ipfw_destroy_counters(),
ipfw_init_obj_rewriter(), and ipfw_destroy_obj_rewriter() are declared
with (void) argument lists, but defined with empty argument lists. Make
the definitions match the declarations.

MFC after: 3 days

23 months agoFix unused variable warning in iflib.c
Dimitry Andric [Thu, 21 Jul 2022 19:19:28 +0000 (21:19 +0200)]
Fix unused variable warning in iflib.c

With clang 15, the following -Werror warning is produced:

    sys/net/iflib.c:993:8: error: variable 'n' set but not used [-Werror,-Wunused-but-set-variable]
            u_int n;
                  ^

The 'n' variable appears to have been a debugging aid that has never
been used for anything, so remove it.

MFC after: 3 days

23 months agoFix unused variable warning in if_lagg.c
Dimitry Andric [Thu, 21 Jul 2022 18:51:23 +0000 (20:51 +0200)]
Fix unused variable warning in if_lagg.c

With clang 15, the following -Werror warning is produced:

    sys/net/if_lagg.c:2413:6: error: variable 'active_ports' set but not used [-Werror,-Wunused-but-set-variable]
            int active_ports = 0;
                ^

The 'active_ports' variable appears to have been a debugging aid that
has never been used for anything (ref https://reviews.freebsd.org/D549),
so remove it.

MFC after: 3 days

23 months agoFix unused variable warnings in hwpmc_mod.c
Dimitry Andric [Thu, 21 Jul 2022 18:35:41 +0000 (20:35 +0200)]
Fix unused variable warnings in hwpmc_mod.c

With clang 15, the following -Werror warnings are produced:

    sys/dev/hwpmc/hwpmc_mod.c:4805:6: error: variable 'nfree' set but not used [-Werror,-Wunused-but-set-variable]
            int nfree;
                ^
    sys/dev/hwpmc/hwpmc_mod.c:4804:6: error: variable 'ncallchains' set but not used [-Werror,-Wunused-but-set-variable]
            int ncallchains;
                ^

The 'nfree' and 'ncallchains' variables were used in KASSERTs, but these
were removed due to refactoring in d9f1b8dbf29d. Remove the variables
since they no longer serve any purpose.

MFC after:      3 days

23 months agoAdjust pmc_thread_descriptor_pool_drain() definition to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 18:31:56 +0000 (20:31 +0200)]
Adjust pmc_thread_descriptor_pool_drain() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/dev/hwpmc/hwpmc_mod.c:2462:33: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pmc_thread_descriptor_pool_drain()
                                    ^
                                     void

This is because pmc_thread_descriptor_pool_drain() is declared with a
(void) argument list, but defined with an empty argument list. Make the
definition match the declaration.

MFC after: 3 days

23 months agoAdjust pcm_md_initialize() definition to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 18:23:19 +0000 (20:23 +0200)]
Adjust pcm_md_initialize() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/dev/hwpmc/hwpmc_x86.c:245:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pcm_md_initialize()
                     ^
                      void

This is because pcm_md_initialize() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust pcmlog_{initialize,shutdown}() definitions to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 18:20:56 +0000 (20:20 +0200)]
Adjust pcmlog_{initialize,shutdown}() definitions to avoid clang 15 warning

With clang 15, the following -Werror warnings are produced:

    sys/dev/hwpmc/hwpmc_logging.c:1228:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pmclog_initialize()
                     ^
                      void
    sys/dev/hwpmc/hwpmc_logging.c:1277:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pmclog_shutdown()
                   ^
                    void

This is because pcmlog_{initialize,shutdown}() are declared with (void)
argument lists, but defined with empty argument lists. Make the
definitions match the declarations.

MFC after: 3 days

23 months agoFix unused variable warning in fwohci.c
Dimitry Andric [Thu, 21 Jul 2022 17:59:08 +0000 (19:59 +0200)]
Fix unused variable warning in fwohci.c

With clang 15, the following -Werror warning is produced:

    sys/dev/firewire/fwohci.c:2762:23: error: variable 'pcnt' set but not used [-Werror,-Wunused-but-set-variable]
            int len, plen, hlen, pcnt, offset;
                                 ^

The 'pcnt' variable is eventually used only in an #if 0'd block,
obviously meant for debugging. Ensure that 'pcnt' is only declared and
used when COUNT_PACKETS is defined, so the debugging can be easily
turned on later, if desired.

MFC after: 3 days

23 months agodevelopment.7: Remove CVS and SVN cross-references
Mateusz Piotrowski [Thu, 21 Jul 2022 18:33:47 +0000 (20:33 +0200)]
development.7: Remove CVS and SVN cross-references

Instead, point to the homepages of the projects.

MFC after: 1 week

23 months agorelease.7: Remove Subversion references
Mateusz Piotrowski [Thu, 21 Jul 2022 18:25:58 +0000 (20:25 +0200)]
release.7: Remove Subversion references

MFC after: 1 week