HomeFreeBSD

LinuxKPI: fix WRITE_ONCE(), remove ACCESS_ONCE()

Description

LinuxKPI: fix WRITE_ONCE(), remove ACCESS_ONCE()

Fix a gcc warning: "to be safe all intermediate pointers in cast from
'...' to '...' must be 'const' qualified [-Wcast-qual]".
Doing what is essentially a __DECONST() adding the uintptr_t gets
rid of the massive amount of warnings we get in LinuxKPI and lets
us see the actual problems a lot better.
This is a follow-up to 74e908b3c63b28de1d590dc42502fbe959a6da2e which
fixed READ_ONCE().
ACCESS_ONCE() seems to be an obsolete KPI these days in Linux and
FreeBSD does not use it either directly so we can entirely remove
it now.

Sponsored by: The FreeBSD Foundation
Suggested by: jhb
Reviewed by: hselasky
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D40084

Details

Provenance
bzAuthored on May 13 2023, 3:17 PM
Reviewer
hselasky
Differential Revision
D40084: LinuxKPI: fix WRITE_ONCE()
Parents
rG805d759338a2: mlx4: Move DEFINE_MUTEX() outside function body.
Branches
Unknown
Tags
Unknown