From: David Hunt <david.hunt@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, David Hunt <david.hunt@intel.com>
Subject: [dpdk-dev] [PATCH] examples/power: fix build
Date: Fri, 13 Oct 2017 13:31:42 +0100 [thread overview]
Message-ID: <1507897902-49657-1-git-send-email-david.hunt@intel.com> (raw)
Remove variable declaration from within for loop.
Fixes: f14791a8126e ("examples/vm_power_mgr: add policy to channels")
Signed-off-by: David Hunt <david.hunt@intel.com>
---
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]);
}
--
2.7.4
next reply other threads:[~2017-10-13 12:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 12:31 David Hunt [this message]
2017-10-13 13:30 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1507897902-49657-1-git-send-email-david.hunt@intel.com \
--to=david.hunt@intel.com \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).