mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
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
This commit is contained in:
committed by
Brian Behlendorf
parent
50f6934b9c
commit
d1807f168e
+3
-3
@@ -612,7 +612,7 @@ _zed_event_add_string_array(uint64_t eid, zed_strings_t *zsp,
|
||||
char buf[MAXBUF];
|
||||
int buflen = sizeof (buf);
|
||||
const char *name;
|
||||
char **strp;
|
||||
const char **strp;
|
||||
uint_t nelem;
|
||||
uint_t i;
|
||||
char *p;
|
||||
@@ -652,7 +652,7 @@ _zed_event_add_nvpair(uint64_t eid, zed_strings_t *zsp, nvpair_t *nvp)
|
||||
uint16_t i16;
|
||||
uint32_t i32;
|
||||
uint64_t i64;
|
||||
char *str;
|
||||
const char *str;
|
||||
|
||||
assert(zsp != NULL);
|
||||
assert(nvp != NULL);
|
||||
@@ -935,7 +935,7 @@ zed_event_service(struct zed_conf *zcp)
|
||||
uint64_t eid;
|
||||
int64_t *etime;
|
||||
uint_t nelem;
|
||||
char *class;
|
||||
const char *class;
|
||||
const char *subclass;
|
||||
int rv;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user