From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brQTe-0003iC-Cb for qemu-devel@nongnu.org; Tue, 04 Oct 2016 10:13:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brQTX-0004sj-BH for qemu-devel@nongnu.org; Tue, 04 Oct 2016 10:13:49 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brQTX-0004sF-0Y for qemu-devel@nongnu.org; Tue, 04 Oct 2016 10:13:43 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u94E8tGK007331 for ; Tue, 4 Oct 2016 10:13:41 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 25vc49xamn-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 04 Oct 2016 10:13:41 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 4 Oct 2016 08:13:40 -0600 From: Greg Kurz Date: Tue, 04 Oct 2016 16:13:36 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <147559041610.22779.15798454251003046283.stgit@bahia.lab.toulouse-stg.fr.ibm.com> Subject: [Qemu-devel] [PATCH] 9pfs: drop useless check in pdu_free() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Greg Kurz , "Aneesh Kumar K.V" Out of the three users of pdu_free(), none ever passes a NULL pointer to this function. Signed-off-by: Greg Kurz --- hw/9pfs/9p.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 479b2b260ce8..058588d64121 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -626,16 +626,14 @@ V9fsPDU *pdu_alloc(V9fsState *s) void pdu_free(V9fsPDU *pdu) { - if (pdu) { - V9fsState *s = pdu->s; - /* - * Cancelled pdu are added back to the freelist - * by flush request . - */ - if (!pdu->cancelled) { - QLIST_REMOVE(pdu, next); - QLIST_INSERT_HEAD(&s->free_list, pdu, next); - } + V9fsState *s = pdu->s; + /* + * Cancelled pdu are added back to the freelist + * by flush request . + */ + if (!pdu->cancelled) { + QLIST_REMOVE(pdu, next); + QLIST_INSERT_HEAD(&s->free_list, pdu, next); } }