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 DADBEA0C55; Fri, 5 Nov 2021 16:56:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B44C41134; Fri, 5 Nov 2021 16:56:52 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 5DFFB40E5A for ; Fri, 5 Nov 2021 16:56:51 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10159"; a="318126470" X-IronPort-AV: E=Sophos;i="5.87,212,1631602800"; d="scan'208";a="318126470" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2021 08:56:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,212,1631602800"; d="scan'208";a="450614342" Received: from jrharri1-clx.ch.intel.com ([143.182.136.99]) by orsmga006.jf.intel.com with ESMTP; 05 Nov 2021 08:56:27 -0700 From: Jim Harris To: dev@dpdk.org, david.hunt@intel.com, david.marchand@redhat.com Cc: Jim Harris Date: Fri, 5 Nov 2021 15:53:51 +0000 Message-Id: <20211105155351.350403-1-james.r.harris@intel.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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. Original idea was to just remove the tot_ppi variable, but feedback from David Marchand on mailing list was that the related ppi_av array in struct priority_worker wasn't useful and should be removed. This allows us to also remove num_dequeue_pkts_prev and pc from struct priority_worker since they are only used in conjunction with the ppi_av array. Signed-off-by: Jim Harris --- lib/power/rte_power_empty_poll.c | 12 +----------- lib/power/rte_power_empty_poll.h | 5 ----- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/lib/power/rte_power_empty_poll.c b/lib/power/rte_power_empty_poll.c index 975aa92997..c4b5de9601 100644 --- a/lib/power/rte_power_empty_poll.c +++ b/lib/power/rte_power_empty_poll.c @@ -72,8 +72,6 @@ enter_normal_state(struct priority_worker *poll_stats) /* Clear the averages arrays and strs */ memset(poll_stats->edpi_av, 0, sizeof(poll_stats->edpi_av)); poll_stats->ec = 0; - memset(poll_stats->ppi_av, 0, sizeof(poll_stats->ppi_av)); - poll_stats->pc = 0; poll_stats->cur_freq = MED; poll_stats->iter_counter = 0; @@ -91,8 +89,6 @@ enter_busy_state(struct priority_worker *poll_stats) { memset(poll_stats->edpi_av, 0, sizeof(poll_stats->edpi_av)); poll_stats->ec = 0; - memset(poll_stats->ppi_av, 0, sizeof(poll_stats->ppi_av)); - poll_stats->pc = 0; poll_stats->cur_freq = HGH; poll_stats->iter_counter = 0; @@ -207,7 +203,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; @@ -216,10 +212,6 @@ update_stats(struct priority_worker *poll_stats) s->empty_dequeues_prev = s->empty_dequeues; - uint64_t ppi = s->num_dequeue_pkts - s->num_dequeue_pkts_prev; - - s->num_dequeue_pkts_prev = s->num_dequeue_pkts; - if (s->thresh[s->cur_freq].base_edpi < cur_edpi) { /* edpi mean empty poll counter difference per interval */ @@ -233,11 +225,9 @@ update_stats(struct priority_worker *poll_stats) } s->edpi_av[s->ec++ % BINS_AV] = cur_edpi; - s->ppi_av[s->pc++ % BINS_AV] = ppi; 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; diff --git a/lib/power/rte_power_empty_poll.h b/lib/power/rte_power_empty_poll.h index 6ba0a37074..43fb276077 100644 --- a/lib/power/rte_power_empty_poll.h +++ b/lib/power/rte_power_empty_poll.h @@ -71,7 +71,6 @@ struct priority_worker { enum queue_state queue_state; uint64_t empty_dequeues_prev; - uint64_t num_dequeue_pkts_prev; /* Used for training only */ struct freq_threshold thresh[NUM_FREQ]; @@ -82,10 +81,6 @@ struct priority_worker { uint64_t edpi_av[BINS_AV]; /* empty poll counter */ uint32_t ec; - /* ppi mean valid poll counter per interval */ - uint64_t ppi_av[BINS_AV]; - /* valid poll counter */ - uint32_t pc; uint32_t lcore_id; uint32_t iter_counter; -- 2.32.0