fix: iconv: move NULL checks before pointer arithmetic in iconvctl()
strchr() result was used in pointer arithmetic and incremented before
being checked for NULL. Move the guards above the strlcpy() call.
tcplay/cryptdisks: Suppress GCC 15 false-positive -Wmaybe-uninitialized.
GCC 15 cannot see that mem is always initialized after the
malloc NULL check. Use a guarded diagnostic pragma to suppress
the warning only on GCC >= 15.
various: Fix -Wstringop-overread and -Wdangling-pointer warnings.
Fix sizeof(&sum) vs sizeof(sum) bug in adventure save/restore.
Fix strcmp() on non-NUL-terminated fgetln() buffer in libfetch.
Suppress false positives in libefivar and libnvmm.
libc/rs: Fix use-after-free on realloc (-Wuse-after-free).
GCC 15 warns when pointer arithmetic references a pointer that was
passed to realloc(). Save the offset before the realloc call and
recompute the pointer from the new allocation afterwards.
various: Fix always-true/false address comparisons (-Waddress).
GCC 15 warns when comparing the address of a struct member against
NULL, since such addresses can never be NULL. Replace with emptiness
checks where intent was "is it set", remove dead guards otherwise.
Also fixes a latent bug in telnet ring.c where a pointer expression
was used as a boolean instead of as the RHS of a comparison.
various: Fix -Wunterminated-string-initialization warnings.
GCC 15 warns when a string literal exactly fills a char array,
truncating the NUL terminator. Extend arrays used as strings.
Use char array initializers for intentionally non-terminated arrays.
various: Swap transposed calloc() count/size arguments.
GCC 15 warns when calloc() is called with sizeof() as the first
argument and count as the second (-Wcalloc-transposed-args).
The correct prototype is calloc(count, size).
csh(1): Fix further warnings and bump WARNS from 1 to 6.
* Remove unneeded malloc_usable_size() prototype (there is one
in <stdlib.h>).
* ut_host is a member of struct utmpx, too, so expand the #ifdef for
the prototypes for utmphost() and utmphostsize() accordingly.
fix: tcsh: add missing exportpath() prototype to sh.decls.h
GCC 15 treats implicit function declarations as errors.
exportpath() is defined in sh.set.c but had no prototype,
causing a build failure with -Werror=implicit-function-declaration.
Fix various issues in manual pages.
* BACKLIGHT_SET_STATUS() is not in the backlight interface on Dragonfly.
So remove the associated documentation.
* Remove unneeded .Pp
* Fix whitespace issues.
* Add .Mt where it is missing.
* Fix .Dd
* Fix some .Fn -> .Dv
* Use .Fx, .Nx and .Ox
* .Nm needs an argument only the first time.
efirt - Register EFI Reset with the shutdown_final EVENTHANDLER.
- This adds a safeguard to efi_enter() to fail gracefully when called from
a kernel thread, where curthread->td_lwp is NULL.
- Further work is needed to allow EFI Reset to work more simply without
messing with the current LWP's vmspace.
ddb - Try AcpiReset() when invoking DDB's reset command.
- This allows some modern notebooks to successfully reset from DDB, where
the classic outb(0x64, 0xFE) method no longer works. For some notebooks,
we'll also need to support EFI Reset here, but that will require further
work.
u4b: Sync usb_msctest.[ch] with FreeBSD
Most changes are auto quirk detection and application. However, the
previous commit disabled such auto quirks, so this commit should have no
functional change.
u4b: Make autoquirk code optional and opt out
As the FreeBSD described:
> There are significant problems with the current autoquirk code. This
> results in quite a bit of bogus over-quirking.
> ...
> For all these reasons, I'm turning this off and will likely remove it
> entirely in the future once the alternative SYNC CACHE code has
> provent itself.
Actually, this fixes the USB stick probing timeout error in a USB 3.0
port on my HPE MicroServer Gen10. That timeout error happened during
the boot and would drop the system to the 'mountroot>' prompt:
```
CAM: Configuring bus: ahci0
CAM: Configuring bus: ahci0
CAM: Configuring bus: ahci0
CAM: Configuring bus: ahci0
[56 lines not shown]
kernel: Use lockowned() instead of (lockstatus(&lock, curthread) != 0).
It is sufficient and more lightweight.
Most of these lockstatus() were added by me.
Discussed-with: aly