Received: from eggs.gnu.org ([2001:4830:134:3::10]:56643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkYF5-0000i6-0E for qemu-devel@nongnu.org; Thu, 15 Sep 2016 11:06:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkYF0-0008Rx-Cm for qemu-devel@nongnu.org; Thu, 15 Sep 2016 11:06:22 -0400 Received: from 1.mo177.mail-out.ovh.net ([178.33.107.143]:33766) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkYF0-0008Rd-2U for qemu-devel@nongnu.org; Thu, 15 Sep 2016 11:06:18 -0400 Received: from player699.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo177.mail-out.ovh.net (Postfix) with ESMTP id 3D53CFF98DA for ; Thu, 15 Sep 2016 17:06:17 +0200 (CEST) References: <147394943723.684.13967719989878111420.stgit@bahia> <147394945935.684.4901814937936629234.stgit@bahia> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: Date: Thu, 15 Sep 2016 17:06:14 +0200 MIME-Version: 1.0 In-Reply-To: <147394945935.684.4901814937936629234.stgit@bahia> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/4] 9pfs: drop useless v9fs_string_null() function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz , qemu-devel@nongnu.org Cc: "Aneesh Kumar K.V" On 09/15/2016 04:24 PM, Greg Kurz wrote: > The v9fs_string_null() function just calls v9fs_string_free(). Also it > only has 4 users, whereas v9fs_string_free() has 87. >=20 > This patch converts users to call directly v9fs_string_free() and drops > the useless function. Reviewed-by: C=C3=A9dric Le Goater > Signed-off-by: Greg Kurz > --- > fsdev/9p-marshal.c | 5 ----- > fsdev/9p-marshal.h | 1 - > hw/9pfs/9p.c | 8 ++++---- > 3 files changed, 4 insertions(+), 10 deletions(-) >=20 > 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 > @@ -23,15 +23,10 @@ void v9fs_string_free(V9fsString *str) > g_free(str->data); > str->data =3D NULL; > str->size =3D 0; > } > =20 > -void v9fs_string_null(V9fsString *str) > -{ > - v9fs_string_free(str); > -} > - > void GCC_FMT_ATTR(2, 3) > v9fs_string_sprintf(V9fsString *str, const char *fmt, ...) > { > va_list ap; > =20 > 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 > @@ -75,10 +75,9 @@ static inline void v9fs_string_init(V9fsString *str) > { > str->data =3D NULL; > str->size =3D 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); > =20 > #endif > 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 > @@ -808,19 +808,19 @@ static int stat_to_v9stat(V9fsPDU *pdu, V9fsPath = *name, > v9stat->mode =3D stat_to_v9mode(stbuf); > v9stat->atime =3D stbuf->st_atime; > v9stat->mtime =3D stbuf->st_mtime; > v9stat->length =3D stbuf->st_size; > =20 > - 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); > =20 > v9stat->n_uid =3D stbuf->st_uid; > v9stat->n_gid =3D stbuf->st_gid; > v9stat->n_muid =3D 0; > =20 > - v9fs_string_null(&v9stat->extension); > + v9fs_string_free(&v9stat->extension); > =20 > if (v9stat->mode & P9_STAT_MODE_SYMLINK) { > err =3D v9fs_co_readlink(pdu, name, &v9stat->extension); > if (err < 0) { > return err; >=20 >=20