From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F0D4A00BE for ; Wed, 30 Oct 2019 09:00:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 55ADF1BEF0; Wed, 30 Oct 2019 09:00:05 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id B62D21BDAC for ; Wed, 30 Oct 2019 09:00:00 +0100 (CET) Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 16086C05A1C2 for ; Wed, 30 Oct 2019 08:00:00 +0000 (UTC) Received: by mail-vs1-f69.google.com with SMTP id k16so128237vsb.23 for ; Wed, 30 Oct 2019 01:00:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QDfpXvGRNSUmA6cenTJyaX1rpfVny+JIwPjB6OZIaAc=; b=osap3amvgALScB9TBrVB6RRXIt6j0oQD4R99CBxx7HC5B5WO2x4LAROrCLHQLZBrop M/Q3yoA/RwA9442JER3xhIJq5rjxNXBEpD/4V47OKzY3/SEunuv8nriUm2D4TA+LibEm Q/Kz3YafWc5f0YWxenfvom+852swXPQhuBOQ6BG57SzHE5n0+CsGeeQxCbjs7crBtFHV MMuGxwJru9XHC1bmHZ07fVYjibeKKTwZTk4dexxLTOPkcs5G2riqG4dcE2cO9A9lt85+ pa/vtY+7K6KrYpB2XAYph61c3HnLjdBouKmLIAmrSA1TOKDDQCGnKgz8BfcCc8lHI393 LLdg== X-Gm-Message-State: APjAAAX1l0tTSN8WFo2/9WdyzueI5j19iOA09WLDH91yLOQSaTGXrWUZ YI88PoevvVQPh6X+GAqMDWUMqNQGlL+aRn5o9J2QgKvJxRf3zP2I8w/CJ3BfNmHUWVErGeYY1a/ ixMKJfmU7eTTdnAfQnYMRCqc= X-Received: by 2002:a67:fa99:: with SMTP id f25mr4183862vsq.141.1572422399306; Wed, 30 Oct 2019 00:59:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCktaz+iPjAUSbhREEo5xKWE/Ki7qZBjnP6ArlbB0b8rQWNfr5Eh0ywxD49bNmcbUkAO3aTcV5r4WakeYqJCM= X-Received: by 2002:a67:fa99:: with SMTP id f25mr4183854vsq.141.1572422399060; Wed, 30 Oct 2019 00:59:59 -0700 (PDT) MIME-Version: 1.0 References: <20191001125315.6191-1-ktraynor@redhat.com> <20191001130405.7076-1-ktraynor@redhat.com> <20191001130405.7076-3-ktraynor@redhat.com> In-Reply-To: <20191001130405.7076-3-ktraynor@redhat.com> From: David Marchand Date: Wed, 30 Oct 2019 08:59:48 +0100 Message-ID: To: Rosen Xu Cc: dev , Kevin Traynor , dpdk stable , Xiaolong Ye Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hello Rosen, Review please. On Tue, Oct 1, 2019 at 3:04 PM Kevin Traynor wrote: > > Coverity is complaining about identical code regardless of which branch > of the if else is taken. Functionally it means an error will always be > returned if this if else is hit. Remove the else branch. > > CID 337928 (#1 of 1): Identical code for different branches > (IDENTICAL_BRANCHES)identical_branches: The same code is executed > regardless of whether n->level != IPN3KE_TM_NODE_LEVEL_COS || > n->n_children != 0U is true, because the 'then' and 'else' branches > are identical. Should one of the branches be modified, or the entire > 'if' statement replaced? > 1506 if (n->level != IPN3KE_TM_NODE_LEVEL_COS || > 1507 n->n_children != 0) { > 1508 return -rte_tm_error_set(error, > 1509 EINVAL, > 1510 RTE_TM_ERROR_TYPE_UNSPECIFIED, > 1511 NULL, > 1512 rte_strerror(EINVAL)); > else_branch: The else branch, identical to the then branch. > 1513 } else { > 1514 return -rte_tm_error_set(error, > 1515 EINVAL, > 1516 RTE_TM_ERROR_TYPE_UNSPECIFIED, > 1517 NULL, > 1518 rte_strerror(EINVAL)); > 1519 } > > Coverity issue: 337928 > Fixes: c820468ac99c ("net/ipn3ke: support TM") > Cc: rosen.xu@intel.com > Cc: stable@dpdk.org > > Signed-off-by: Kevin Traynor > --- > drivers/net/ipn3ke/ipn3ke_tm.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c > index adf02c157..a93145d59 100644 > --- a/drivers/net/ipn3ke/ipn3ke_tm.c > +++ b/drivers/net/ipn3ke/ipn3ke_tm.c > @@ -1511,10 +1511,4 @@ ipn3ke_tm_hierarchy_commit_check(struct rte_eth_dev *dev, > NULL, > rte_strerror(EINVAL)); > - } else { > - return -rte_tm_error_set(error, > - EINVAL, > - RTE_TM_ERROR_TYPE_UNSPECIFIED, > - NULL, > - rte_strerror(EINVAL)); > } > } > -- > 2.21.0 > -- David Marchand