From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 2AA37A0C41;
	Fri, 29 Oct 2021 20:53:59 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id D9AB9410FC;
	Fri, 29 Oct 2021 20:53:58 +0200 (CEST)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.133.124])
 by mails.dpdk.org (Postfix) with ESMTP id 4962A40DDB
 for <dev@dpdk.org>; Fri, 29 Oct 2021 20:53:58 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1635533637;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=oIdvNysRJmiHd1sXJJOP5mA2SNd59YwL8nx2RleEcVA=;
 b=gp7V/i3iUJN4gvMLs2HB+uhfYCFwFAI0ahGO2SrwmexR08LYeQXB0IXmRQtrlkvVSmNzws
 3+roC3t58tjZSBrcAAlq7eNI1EVL85z/pAsY75V5oPQhFmGp8rO5KOj4ozPr1imSRoZ8YO
 q+NL8vEFQaXhWY7wUppMefMflGaAlf0=
Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com
 [209.85.208.198]) (Using TLS) by relay.mimecast.com with ESMTP id
 us-mta-334-HpJ3aEJTNN28DXzfn8TbbQ-1; Fri, 29 Oct 2021 14:53:56 -0400
X-MC-Unique: HpJ3aEJTNN28DXzfn8TbbQ-1
Received: by mail-lj1-f198.google.com with SMTP id
 j8-20020a2e3c08000000b00210e2890d61so3496343lja.9
 for <dev@dpdk.org>; Fri, 29 Oct 2021 11:53:56 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=oIdvNysRJmiHd1sXJJOP5mA2SNd59YwL8nx2RleEcVA=;
 b=siHJsJw/UW5BUojsofWPdypDCDylgUQ8TWkVlkD1rFQHyrHpOqx8yqeSa+i2QlZmYV
 iixfGCSOPlzOVogdF7KUBYp2XJrRRPnKi/4hfK4vYPRuMEnWLw7Hk1CY2pEsCf38+cE2
 45VkDESC2PysZcBx7PXpgW/biCrk+EHbx3y8OH/jBLABuSbWBMDMQWtRH4PNhFGIICEb
 VhFy4yD3Ed3h4d9WD4Bit94GFfzn9kaDW1LZoinjPmUyEY4IpC93IgOcp/kad5cENjlk
 kyN54MMSTsSyLFG8kAzHFXTRp9DRYBj23MIxk/iOYbH+1VVcL6I2bT1WK6SKnX9yzCsR
 ZqpA==
X-Gm-Message-State: AOAM5313r/zs+pb7poyVacZT0xpUp7NPWPQxV+keqMDjZ2LhSBKaauTO
 etG5zil1yhugGWOZjax2D8JOgfjtWsGKanWmeCmSP/8TNBcBfwTBhwbLSMo93EI2pUp4F4kAeVr
 mZb9l6gNvlCC6gRvH0R8=
X-Received: by 2002:ac2:5d68:: with SMTP id h8mr12229459lft.217.1635533634902; 
 Fri, 29 Oct 2021 11:53:54 -0700 (PDT)
X-Google-Smtp-Source: ABdhPJzAfoKLsURs+H4Vx+0n3QvknqxAsdJXCCBJzQdTwwrdoZEhQ8kR4cddWYpp//ItUwo0oWAesh0P/ecLBAnUBOc=
X-Received: by 2002:ac2:5d68:: with SMTP id h8mr12229445lft.217.1635533634720; 
 Fri, 29 Oct 2021 11:53:54 -0700 (PDT)
MIME-Version: 1.0
References: <20211029171550.330229-1-james.r.harris@intel.com>
In-Reply-To: <20211029171550.330229-1-james.r.harris@intel.com>
From: David Marchand <david.marchand@redhat.com>
Date: Fri, 29 Oct 2021 20:53:43 +0200
Message-ID: <CAJFAV8xZXqgqgmK5HFAtdXTFWF-cFuPxNMOuN-OeHbm+w4tRrg@mail.gmail.com>
To: Jim Harris <james.r.harris@intel.com>
Cc: dev <dev@dpdk.org>, David Hunt <david.hunt@intel.com>
Authentication-Results: relay.mimecast.com;
 auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [dpdk-dev] [PATCH] power: fix unused-but-set variable error
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Fri, Oct 29, 2021 at 7:17 PM Jim Harris <james.r.harris@intel.com> wrote:
>
> clang-13 rightfully complains that the tot_ppi
> variable in update_stats is set but not used, since
> the final accumulated tot_ppi results isn't used
> anywhere. So just remove the tot_ppi variable.

Dead code, from the start...
Fixes: 450f0791312c ("power: add traffic pattern aware power control")


>
> Signed-off-by: Jim Harris <james.r.harris@intel.com>
> ---
>  lib/power/rte_power_empty_poll.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/lib/power/rte_power_empty_poll.c b/lib/power/rte_power_empty_poll.c
> index 975aa92997..8a2d60c576 100644
> --- a/lib/power/rte_power_empty_poll.c
> +++ b/lib/power/rte_power_empty_poll.c
> @@ -207,7 +207,7 @@ update_training_stats(struct priority_worker *poll_stats,
>  static __rte_always_inline uint32_t
>  update_stats(struct priority_worker *poll_stats)
>  {
> -       uint64_t tot_edpi = 0, tot_ppi = 0;
> +       uint64_t tot_edpi = 0;
>         uint32_t j, percent;
>
>         struct priority_worker *s = poll_stats;
> @@ -237,7 +237,6 @@ update_stats(struct priority_worker *poll_stats)
>
>         for (j = 0; j < BINS_AV; j++) {
>                 tot_edpi += s->edpi_av[j];
> -               tot_ppi += s->ppi_av[j];
>         }
>
>         tot_edpi = tot_edpi / BINS_AV;
> --
> 2.32.0
>

I don't think keeping ppi_av[] (and related data struct) is that
useful.. but in any case patch lgtm:

Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand