projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
perf kmem: use ARRAY_SIZE instead of reinventing it
[platform/adaptation/renesas_rcar/renesas_kernel.git]
/
tools
/
perf
/
builtin-kmem.c
diff --git
a/tools/perf/builtin-kmem.c
b/tools/perf/builtin-kmem.c
index
0b4b796
..
c746108
100644
(file)
--- a/
tools/perf/builtin-kmem.c
+++ b/
tools/perf/builtin-kmem.c
@@
-340,7
+340,7
@@
static void __print_result(struct rb_root *root, struct perf_session *session,
int n_lines, int is_caller)
{
struct rb_node *next;
int n_lines, int is_caller)
{
struct rb_node *next;
- struct machine *machine;
+ struct machine *machine
= &session->machines.host
;
printf("%.102s\n", graph_dotted_line);
printf(" %-34s |", is_caller ? "Callsite": "Alloc Ptr");
printf("%.102s\n", graph_dotted_line);
printf(" %-34s |", is_caller ? "Callsite": "Alloc Ptr");
@@
-349,11
+349,6
@@
static void __print_result(struct rb_root *root, struct perf_session *session,
next = rb_first(root);
next = rb_first(root);
- machine = perf_session__find_host_machine(session);
- if (!machine) {
- pr_err("__print_result: couldn't find kernel information\n");
- return;
- }
while (next && n_lines--) {
struct alloc_stat *data = rb_entry(next, struct alloc_stat,
node);
while (next && n_lines--) {
struct alloc_stat *data = rb_entry(next, struct alloc_stat,
node);
@@
-614,8
+609,7
@@
static struct sort_dimension *avail_sorts[] = {
&pingpong_sort_dimension,
};
&pingpong_sort_dimension,
};
-#define NUM_AVAIL_SORTS \
- (int)(sizeof(avail_sorts) / sizeof(struct sort_dimension *))
+#define NUM_AVAIL_SORTS ((int)ARRAY_SIZE(avail_sorts))
static int sort_dimension__add(const char *tok, struct list_head *list)
{
static int sort_dimension__add(const char *tok, struct list_head *list)
{