9pfs: drop useless v9fs_string_null() function
The v9fs_string_null() function just calls v9fs_string_free(). Also it
only has 4 users, whereas v9fs_string_free() has 87.
This patch converts users to call directly v9fs_string_free() and drops
the useless function.
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
diff --git a/fsdev/9p-marshal.c b/fsdev/9p-marshal.c
index 238dbf2..a01bba6 100644
--- a/fsdev/9p-marshal.c
+++ b/fsdev/9p-marshal.c
@@ -25,11 +25,6 @@
str->size = 0;
}
-void v9fs_string_null(V9fsString *str)
-{
- v9fs_string_free(str);
-}
-
void GCC_FMT_ATTR(2, 3)
v9fs_string_sprintf(V9fsString *str, const char *fmt, ...)
{
diff --git a/fsdev/9p-marshal.h b/fsdev/9p-marshal.h
index 140db6d..77f7fef 100644
--- a/fsdev/9p-marshal.h
+++ b/fsdev/9p-marshal.h
@@ -77,7 +77,6 @@
str->size = 0;
}
extern void v9fs_string_free(V9fsString *str);
-extern void v9fs_string_null(V9fsString *str);
extern void v9fs_string_sprintf(V9fsString *str, const char *fmt, ...);
extern void v9fs_string_copy(V9fsString *lhs, V9fsString *rhs);
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index dfe293d..d8f48ca 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -810,15 +810,15 @@
v9stat->mtime = stbuf->st_mtime;
v9stat->length = stbuf->st_size;
- v9fs_string_null(&v9stat->uid);
- v9fs_string_null(&v9stat->gid);
- v9fs_string_null(&v9stat->muid);
+ v9fs_string_free(&v9stat->uid);
+ v9fs_string_free(&v9stat->gid);
+ v9fs_string_free(&v9stat->muid);
v9stat->n_uid = stbuf->st_uid;
v9stat->n_gid = stbuf->st_gid;
v9stat->n_muid = 0;
- v9fs_string_null(&v9stat->extension);
+ v9fs_string_free(&v9stat->extension);
if (v9stat->mode & P9_STAT_MODE_SYMLINK) {
err = v9fs_co_readlink(pdu, name, &v9stat->extension);