From patchwork Fri Oct 13 12:31:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunt, David" X-Patchwork-Id: 30357 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8EAE21B6BC; Fri, 13 Oct 2017 14:31:50 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 0BB241B6BB for ; Fri, 13 Oct 2017 14:31:48 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Oct 2017 05:31:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,371,1503385200"; d="scan'208";a="146100586" Received: from silpixa00397898.ir.intel.com ([10.237.223.116]) by orsmga002.jf.intel.com with ESMTP; 13 Oct 2017 05:31:46 -0700 From: David Hunt To: dev@dpdk.org Cc: thomas@monjalon.net, David Hunt Date: Fri, 13 Oct 2017 13:31:42 +0100 Message-Id: <1507897902-49657-1-git-send-email-david.hunt@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] examples/power: fix build 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" Remove variable declaration from within for loop. Fixes: f14791a8126e ("examples/vm_power_mgr: add policy to channels") Signed-off-by: David Hunt --- examples/vm_power_manager/channel_monitor.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c index f16358d..f8e3491 100644 --- a/examples/vm_power_manager/channel_monitor.c +++ b/examples/vm_power_manager/channel_monitor.c @@ -169,8 +169,9 @@ update_policy(struct channel_packet *pkt) { unsigned int updated = 0; + int i; - for (int i = 0; i < MAX_VMS; i++) { + for (i = 0; i < MAX_VMS; i++) { if (strcmp(policies[i].pkt.vm_name, pkt->vm_name) == 0) { policies[i].pkt = *pkt; get_pcpu_to_control(&policies[i]); @@ -184,7 +185,7 @@ update_policy(struct channel_packet *pkt) } } if (!updated) { - for (int i = 0; i < MAX_VMS; i++) { + for (i = 0; i < MAX_VMS; i++) { if (policies[i].enabled == 0) { policies[i].pkt = *pkt; get_pcpu_to_control(&policies[i]); @@ -543,7 +544,9 @@ run_channel_monitor(void) } rte_delay_us(time_period_s*1000000); if (policy_is_set) { - for (int j = 0; j < MAX_VMS; j++) { + int j; + + for (j = 0; j < MAX_VMS; j++) { if (policies[j].enabled == 1) apply_policy(&policies[j]); }