aboutsummaryrefslogtreecommitdiffstats
path: root/module/zcommon/zfs_comutil.c
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2023-03-11 13:39:24 -0500
committerBrian Behlendorf <[email protected]>2023-03-14 15:25:50 -0700
commitd1807f168edd09ca26a5a0c6b570686b982808ad (patch)
treedb5bfd360991fa3528fe688247eb289ef1d8b859 /module/zcommon/zfs_comutil.c
parent50f6934b9c1f4aa583592e8a969b934440a44c64 (diff)
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 <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #14612
Diffstat (limited to 'module/zcommon/zfs_comutil.c')
-rw-r--r--module/zcommon/zfs_comutil.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/module/zcommon/zfs_comutil.c b/module/zcommon/zfs_comutil.c
index 36a9c8a35..384746bd4 100644
--- a/module/zcommon/zfs_comutil.c
+++ b/module/zcommon/zfs_comutil.c
@@ -70,7 +70,7 @@ zfs_allocatable_devs(nvlist_t *nv)
boolean_t
zfs_special_devs(nvlist_t *nv, const char *type)
{
- char *bias;
+ const char *bias;
uint_t c;
nvlist_t **child;
uint_t children;
@@ -98,7 +98,7 @@ zpool_get_load_policy(nvlist_t *nvl, zpool_load_policy_t *zlpp)
{
nvlist_t *policy;
nvpair_t *elem;
- char *nm;
+ const char *nm;
/* Defaults */
zlpp->zlp_rewind = ZPOOL_NO_REWIND;