From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkxUL-0002Do-TE for qemu-devel@nongnu.org; Fri, 16 Sep 2016 14:03:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkxUI-00004y-Jn for qemu-devel@nongnu.org; Fri, 16 Sep 2016 14:03:49 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33652 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkxUI-0008WL-Cm for qemu-devel@nongnu.org; Fri, 16 Sep 2016 14:03:46 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8GI2mGg043401 for ; Fri, 16 Sep 2016 14:03:46 -0400 Received: from e06smtp08.uk.ibm.com (e06smtp08.uk.ibm.com [195.75.94.104]) by mx0b-001b2d01.pphosted.com with ESMTP id 25ghv83hfr-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 16 Sep 2016 14:03:45 -0400 Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 16 Sep 2016 19:03:44 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 2733217D8024 for ; Fri, 16 Sep 2016 19:05:37 +0100 (BST) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u8GI3efR5439888 for ; Fri, 16 Sep 2016 18:03:40 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u8GI3dMH003241 for ; Fri, 16 Sep 2016 12:03:40 -0600 From: Greg Kurz Date: Fri, 16 Sep 2016 20:03:25 +0200 In-Reply-To: <1474049010-13533-1-git-send-email-groug@kaod.org> References: <1474049010-13533-1-git-send-email-groug@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Message-Id: <1474049010-13533-4-git-send-email-groug@kaod.org> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL v2 3/8] 9pfs: drop useless v9fs_string_null() function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , "Aneesh Kumar K.V" , Greg Kurz 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 Reviewed-by: C=C3=A9dric Le Goater --- 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 =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, ...) { 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 =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 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 *n= ame, 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); --=20 2.5.5