Skip to content

Commit

Permalink
perf kvm: Add braces around multi-line statements
Browse files Browse the repository at this point in the history
Multi-line statements should have braces. Improves readability.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Dong Hao <haodong@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1349716656-48165-9-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
David Ahern authored and Arnaldo Carvalho de Melo committed Oct 8, 2012
1 parent e4f7637 commit 355afe8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/perf/builtin-kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,10 @@ static struct kvm_event *find_create_kvm_event(struct perf_kvm *kvm,
BUG_ON(key->key == INVALID_KEY);

head = &kvm->kvm_events_cache[kvm_events_hash_fn(key->key)];
list_for_each_entry(event, head, hash_entry)
list_for_each_entry(event, head, hash_entry) {
if (event->key.key == key->key && event->key.info == key->info)
return event;
}

event = kvm_alloc_init_event(key);
if (!event)
Expand Down Expand Up @@ -610,13 +611,15 @@ static void sort_result(struct perf_kvm *kvm)
int vcpu = kvm->trace_vcpu;
struct kvm_event *event;

for (i = 0; i < EVENTS_CACHE_SIZE; i++)
list_for_each_entry(event, &kvm->kvm_events_cache[i], hash_entry)
for (i = 0; i < EVENTS_CACHE_SIZE; i++) {
list_for_each_entry(event, &kvm->kvm_events_cache[i], hash_entry) {
if (event_is_valid(event, vcpu)) {
update_total_count(kvm, event);
insert_to_result(&kvm->result, event,
kvm->compare, vcpu);
}
}
}
}

/* returns left most element of result, and erase it */
Expand Down

0 comments on commit 355afe8

Please sign in to comment.