From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D629CA9EC0 for ; Wed, 30 Oct 2019 08:00:04 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 2E84D2054F for ; Wed, 30 Oct 2019 08:00:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E84D2054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0ACC81BDAC; Wed, 30 Oct 2019 09:00:03 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id AE8CD1B948 for ; Wed, 30 Oct 2019 09:00:00 +0100 (CET) Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (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 1434C87638 for ; Wed, 30 Oct 2019 08:00:00 +0000 (UTC) Received: by mail-vk1-f200.google.com with SMTP id a188so630306vkc.7 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=G5rskFsaJE5pogwSqAvmZbD+cG8oBYSjoma7CwGrn2s+rWPo9zMPCj83YOxiPJWBMe uE3vcOzbue/ddaWgQnpqRoYpsmgjYBMbFXVO1CbqZ64Sa1H5xxGWVZlSOF1EKzUCEydA HC0wJW+nr4FsDSi9svqyZqTDMyzjNO+2NaAVuWgW5gsNVLJqGoQDOhlCNOq1sruIZrTV vrXcft2rNwgEyHWmZfPudNz6oby6Rw0lrhF9qHzjhQSFEXAR6LXMkaDdv2Y4zXvZBymX H+UrY/34xVfJUPDe26giSyin7rRbLcFUuANppoX0BSx1xxH3ARwwzgeOx4Wz78z1IsWc ALVw== X-Gm-Message-State: APjAAAWJrLcgRKJvQckBshcuqexwyvROhAVGo8LpEvC8xqs1jeHzCfi5 e9KqC9Zm5pWjyq/wdYZCWkXnO/GsNR2WFU18Z7q75e44X4WF1obgeC4l7DnI3fY1NuZX/eYkf1C YubDwRr8pKGCKk6NWiAk= X-Received: by 2002:a67:fa99:: with SMTP id f25mr4183860vsq.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-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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