[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 3/8] 9pfs: drop useless v9fs_string_null() function
From: |
Greg Kurz |
Subject: |
[Qemu-devel] [PULL 3/8] 9pfs: drop useless v9fs_string_null() function |
Date: |
Fri, 16 Sep 2016 15:09:09 +0200 |
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 <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
---
fsdev/9p-marshal.c | 5 -----
fsdev/9p-marshal.h | 1 -
hw/9pfs/9p.c | 8 ++++----
3 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/fsdev/9p-marshal.c b/fsdev/9p-marshal.c
index 238dbf21b1d5..a01bba6908a8 100644
--- a/fsdev/9p-marshal.c
+++ b/fsdev/9p-marshal.c
@@ -25,11 +25,6 @@ void v9fs_string_free(V9fsString *str)
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 140db6d99f9c..77f7fef326ee 100644
--- a/fsdev/9p-marshal.h
+++ b/fsdev/9p-marshal.h
@@ -77,7 +77,6 @@ static inline void v9fs_string_init(V9fsString *str)
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 dfe293d11d1c..d8f48ca76c47 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -810,15 +810,15 @@ static int stat_to_v9stat(V9fsPDU *pdu, V9fsPath *name,
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);
--
2.5.5
- [Qemu-devel] [PULL 0/8] 9p patches for 2.8 20160916, Greg Kurz, 2016/09/16
- [Qemu-devel] [PULL 5/8] tests: virtio-9p: introduce start/stop functions, Greg Kurz, 2016/09/16
- [Qemu-devel] [PULL 7/8] tests: virtio-9p: add basic transaction test, Greg Kurz, 2016/09/16
- [Qemu-devel] [PULL 3/8] 9pfs: drop useless v9fs_string_null() function,
Greg Kurz <=
- [Qemu-devel] [PULL 8/8] 9pfs: fix potential segfault during walk, Greg Kurz, 2016/09/16
- [Qemu-devel] [PULL 2/8] 9pfs: drop duplicate line in proxy backend, Greg Kurz, 2016/09/16
- [Qemu-devel] [PULL 1/8] 9pfs: drop unused fmt strings in the proxy backend, Greg Kurz, 2016/09/16
- [Qemu-devel] [PULL 6/8] tests: virtio-9p: add basic configuration test, Greg Kurz, 2016/09/16
- [Qemu-devel] [PULL 4/8] 9pfs: introduce v9fs_path_sprintf() helper, Greg Kurz, 2016/09/16