Skip to content

Commit

Permalink
powerpc/perf/hv-24x7: Simplify extracting counter from result buffer
Browse files Browse the repository at this point in the history
Simplify code that extracts a 24x7 counter from the HCALL's result buffer.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Sukadev Bhattiprolu authored and Michael Ellerman committed Jul 25, 2015
1 parent 4038621 commit 465345c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions arch/powerpc/perf/hv-24x7.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,6 @@ static unsigned long single_24x7_request(struct perf_event *event, u64 *count)
unsigned long ret;
struct hv_24x7_request_buffer *request_buffer;
struct hv_24x7_data_result_buffer *result_buffer;
struct hv_24x7_result *resb;

BUILD_BUG_ON(sizeof(*request_buffer) > 4096);
BUILD_BUG_ON(sizeof(*result_buffer) > 4096);
Expand All @@ -1125,8 +1124,7 @@ static unsigned long single_24x7_request(struct perf_event *event, u64 *count)
}

/* process result from hcall */
resb = &result_buffer->results[0];
*count = be64_to_cpu(resb->elements[0].element_data[0]);
*count = be64_to_cpu(result_buffer->results[0].elements[0].element_data[0]);

out:
put_cpu_var(hv_24x7_reqb);
Expand Down

0 comments on commit 465345c

Please sign in to comment.