HomeFreeBSD

nvpair: Constify string functions

Description

nvpair: Constify string functions

After addressing coverity complaints involving nvpair_name(), the
compiler started complaining about dropping const. This lead to a rabbit
hole where not only nvpair_name() needed to be constified, but also
nvpair_value_string(), fnvpair_value_string() and a few other static
functions, plus variable pointers throughout the code. The result became
a fairly big change, so it has been split out into its own patch.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14612

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Mar 11 2023, 6:39 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Mar 14 2023, 10:25 PM
Parents
rG50f6934b9c1f: discover_cached_paths() should not corrupt nvlist string value
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGd1807f168edd: nvpair: Constify string functions (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Mar 14 2023, 10:25 PM