From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 62392A0093; Thu, 10 Nov 2022 00:47:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40D6942D0C; Thu, 10 Nov 2022 00:46:59 +0100 (CET) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id 9D857400D4 for ; Thu, 10 Nov 2022 00:46:57 +0100 (CET) Received: by mail-pj1-f48.google.com with SMTP id l22-20020a17090a3f1600b00212fbbcfb78so3330055pjc.3 for ; Wed, 09 Nov 2022 15:46:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/sluQM/YR/JUUSXg8kIj5TtFEM3ub/Ak2m/Sv78jozs=; b=wjqj8iDiNgQ2mug5zI+9Ii1Jvo1wubU+2igAvGOokwniCP1a7FXAGcKBOkDQm5E7tJ t6YQZAf6XvfQbyUgCD2m1zsD6LfC8fUsFDXkFJx6tpcy2fidc6iMC290VRlrlbOnaUus YQy3gfIySDHhGI0xpnRQvdzTrH4DpAfychTB/gx1z8np7WQam5jUIMpVrvZMFiZ59K9/ OGSDFqoa+x2oCEa3vXZFIxY5g7HeMZovFbkbhuWvs7eZ3sxSuzAWM7P+onahb2QFuUYh USxdmHl1ogTNDLOb2u2HRrUIxqXnEhr40SRUg/neEE/wOunAMPbFYmTg3sZnL3rcU4Py /Fcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/sluQM/YR/JUUSXg8kIj5TtFEM3ub/Ak2m/Sv78jozs=; b=ecw44+5/gmAPyeVupvI8W0Cp4WPBlAsLx0o0VA2YiKv3wroWlZzk3jX9O7oTkHwvhK nFBQv2SZMBKeLVPK4p9n66jYkfN8qu47JpRedoPiL2Rm5IMSeMi5EvWQxBtD5uTDAENm dh4YLPcH0FDpqSKxByEs2wn1wYwwdAFnbOuJbt20cSjqAd0PVzd8pRFmby2tPTpGAel9 ezdvIH4e2k1Z5YQeO/AO183Ck7A7eeJ8G0QnUdhC2kYzXCy8qjnsyLqgHAGyDDac+oo8 viaoj3V1XK6xuK4ABnvcUki4tDFNONw7PYS5gwpCz+7zMV2oROmtRysYyaqvl4nH+xoN H/mA== X-Gm-Message-State: ACrzQf0zBB5jgad5nKLEo2XHeTSnRalBpuPqiKwD8i23BybC5SzfGdAc sM0+nh2zbd/aC/CWZ+5D7Vfsi2jOUS4Jnw== X-Google-Smtp-Source: AMsMyM5lj2E8XKuVvtFC+cl45TQZL1N3XRAFUVKqO7WbnAhu7L8FfM4YijP7D/H+UJZWgsvxqoL5xQ== X-Received: by 2002:a17:90a:520c:b0:212:d135:4471 with SMTP id v12-20020a17090a520c00b00212d1354471mr83695244pjh.71.1668037616498; Wed, 09 Nov 2022 15:46:56 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id e18-20020a63e012000000b00470275c8d6dsm7895259pgh.10.2022.11.09.15.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 15:46:55 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jingjing Wu , Beilei Xing Subject: [PATCH 3/4] idpf: remvoee unnecessary null checks Date: Wed, 9 Nov 2022 15:46:48 -0800 Message-Id: <20221109234649.331942-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221109234649.331942-1-stephen@networkplumber.org> References: <20221109234649.331942-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The function rte_free() already handles NULL argument; therefore the checks in this code are unnecessary. Signed-off-by: Stephen Hemminger --- drivers/net/idpf/idpf_rxtx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/idpf/idpf_rxtx.c b/drivers/net/idpf/idpf_rxtx.c index bafa007faf85..b1f58089e031 100644 --- a/drivers/net/idpf/idpf_rxtx.c +++ b/drivers/net/idpf/idpf_rxtx.c @@ -251,8 +251,7 @@ reset_single_rx_queue(struct idpf_rx_queue *rxq) rxq->rx_tail = 0; rxq->nb_rx_hold = 0; - if (rxq->pkt_first_seg != NULL) - rte_pktmbuf_free(rxq->pkt_first_seg); + rte_pktmbuf_free(rxq->pkt_first_seg); rxq->pkt_first_seg = NULL; rxq->pkt_last_seg = NULL; -- 2.35.1