kstat: silence "maybe uninitialized" warnings

Firmly in the "shouldn't happen" camp, but at least GCC 7.4 (Ubuntu
18.04) complained about them, and it's easy to shut up, so do so.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #17189
This commit is contained in:
Rob Norris 2025-03-29 13:25:47 +11:00 committed by GitHub
parent 5b29e70ae1
commit 75e921da6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -395,7 +395,7 @@ kstat_delete_module(kstat_module_t *module)
kstat_module_t *parent = module->ksm_parent;
char *p = module->ksm_name, *frag;
char *p = module->ksm_name, *frag = NULL;
while (p != NULL && (frag = strsep(&p, "/"))) {}
remove_proc_entry(frag, parent ? parent->ksm_proc : proc_spl_kstat);
@ -420,7 +420,7 @@ kstat_create_module(char *name)
(void) strlcpy(buf, name, KSTAT_STRLEN);
parent = NULL;
module = parent = NULL;
char *p = buf, *frag;
while ((frag = strsep(&p, "/")) != NULL) {
module = kstat_find_module(buf);
@ -454,7 +454,6 @@ kstat_create_module(char *name)
}
return (module);
}
static int