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 29301A00BE; Wed, 30 Oct 2019 08:43:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 68CE91BEB4; Wed, 30 Oct 2019 08:43:25 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 4EA651BEAD for ; Wed, 30 Oct 2019 08:43:24 +0100 (CET) Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) (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 867053DE32 for ; Wed, 30 Oct 2019 07:43:23 +0000 (UTC) Received: by mail-vs1-f71.google.com with SMTP id m188so128607vsd.4 for ; Wed, 30 Oct 2019 00:43:23 -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=Op7cU/MRAz9RYyHstc+GPqljAuzSFumgRhkJ7FnI6jo=; b=mdyBbEV9ANxbug8/yudbPNbxnP5FCBLhDqx1jg12mR2feoRm62fJ9FPqXpfdKBXv4n jjM4LIYFxIX2cIDpxS2SDcYR4GNvaRQicQEh/MjweU+2b8NTbHuHMeKx5FuW1GkVeAtt b5u/+LK59E6i4pdVEmYkEsmsxe4btD/7DOqYIhCOj7LTRKeADQJIDZM2sNTSkxxS7YD9 xpaiVfmp0ZHMTsuXsefervlYUL0+DBTq9r5FS19ktgv5TdM2lWaclE44OFIzExwYS6KU G22KJVIffiijj9XjIOw7l/HlAFOjLSKVDoOJluanIYxE8tNeeqnskR/QABGSYuEqdbRD b0sw== X-Gm-Message-State: APjAAAXa7uaQ783MRZQv/J3LdvA1OHALMLfHPMXDtpgxHhRnP2iSWVgg rZGD4PSueHn0d63MxVWJueLbaofK9GSGLg8lW8dMYZRuKOe0/CcwK3rgtYcIKqGSzUPVNR5bEs/ gBud4dOEgKzdeLDhl6u0= X-Received: by 2002:a1f:60ce:: with SMTP id u197mr8801341vkb.80.1572421402595; Wed, 30 Oct 2019 00:43:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXA3r/2tJEe+9Z3NPTdiYMtaxyd8ywpSgi3LkNuaBerDKzyu9mXb0frOyf77pYee+aiNmQOwcoPEpmaY87QKU= X-Received: by 2002:a1f:60ce:: with SMTP id u197mr8801337vkb.80.1572421402208; Wed, 30 Oct 2019 00:43:22 -0700 (PDT) MIME-Version: 1.0 References: <20191001125315.6191-1-ktraynor@redhat.com> <20191001130405.7076-1-ktraynor@redhat.com> <20191001130405.7076-2-ktraynor@redhat.com> In-Reply-To: From: David Marchand Date: Wed, 30 Oct 2019 08:43:10 +0100 Message-ID: To: Ajit Khaparde , Kevin Traynor Cc: dev , Lance Richardson , dpdk stable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 3/9] net/bnxt: remove logically dead code 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 Ajit, Kevin, On Wed, Oct 2, 2019 at 3:29 AM Ajit Khaparde wrote: > > On Tue, Oct 1, 2019 at 6:04 AM Kevin Traynor wrote: > > > If rc contains a non-zero return code from bnxt_hwrm_send_message(), > > HWRM_CHECK_RESULT_SILENT() will return. > > > > Just after that code, there is an 'if (!rc) {...} else {...}'. > > Coverity is complaining that this if else statement is dead code as > > rc will always be 0 if that code is reached. > > > > 4309 rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), > > BNXT_USE_CHIMP_MB); > > cond_const: Condition rc, taking false branch. > > Now the value of rc is equal to 0. > > 4310 HWRM_CHECK_RESULT_SILENT(); > > 4311 > > const: At condition rc, the value of rc must be equal to 0. > > dead_error_condition: The condition !rc must be true. > > 4312 if (!rc) { > > > > [snip] > > > > 4373 } else { > > CID 343450 (#1 of 1): Logically dead code > > (DEADCODE)dead_error_line: Execution cannot > > reach this statement: rc = 0;. > > 4374 rc = 0; > > 4375 } > > > > Coverity issue: 343450 > > Fixes: f8168ca0e690 ("net/bnxt: support thor controller") > > Cc: lance.richardson@broadcom.com > > Cc: stable@dpdk.org > > > > Signed-off-by: Kevin Traynor > > > Acked-by: Ajit Khaparde I can see a *really* close patch has been submitted the day after. http://patchwork.dpdk.org/patch/58352/ And merged after a v3: https://git.dpdk.org/dpdk/commit/?id=b4f74051165560aa81814433dea7e6eb0bdb32b9 So I suppose this patch can be dropped. -- David Marchand