Skip to content

Commit 9e4e0a9

Browse files
olsajiriacmel
authored andcommitted
perf tools: Change (symbol|annotation)__calc_percent return type to void
There's no need for symbol__calc_percent and annotation__calc_percent functions to return any value, since it's always zero. Changing both function to return void. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-z0gs28hh24m4gia1t1ctraye@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent a7eec4c commit 9e4e0a9

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

tools/perf/util/annotate.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,8 +1584,8 @@ static void calc_percent(struct sym_hist *hist,
15841584
}
15851585
}
15861586

1587-
static int annotation__calc_percent(struct annotation *notes,
1588-
struct perf_evsel *evsel, s64 len)
1587+
static void annotation__calc_percent(struct annotation *notes,
1588+
struct perf_evsel *evsel, s64 len)
15891589
{
15901590
struct annotation_line *al, *next;
15911591

@@ -1609,15 +1609,13 @@ static int annotation__calc_percent(struct annotation *notes,
16091609
calc_percent(hist, sample, al->offset, end);
16101610
}
16111611
}
1612-
1613-
return 0;
16141612
}
16151613

1616-
int symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel)
1614+
void symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel)
16171615
{
16181616
struct annotation *notes = symbol__annotation(sym);
16191617

1620-
return annotation__calc_percent(notes, evsel, symbol__size(sym));
1618+
annotation__calc_percent(notes, evsel, symbol__size(sym));
16211619
}
16221620

16231621
int symbol__annotate(struct symbol *sym, struct map *map,
@@ -1656,10 +1654,11 @@ int symbol__annotate(struct symbol *sym, struct map *map,
16561654
}
16571655

16581656
err = symbol__disassemble(sym, &args);
1659-
if (err)
1660-
return err;
1657+
if (!err)
1658+
symbol__calc_percent(sym, evsel);
1659+
1660+
return err;
16611661

1662-
return symbol__calc_percent(sym, evsel);
16631662
}
16641663

16651664
static void insert_source_line(struct rb_root *root, struct annotation_line *al)

tools/perf/util/annotate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ struct annotation_line *
107107
annotation_line__next(struct annotation_line *pos, struct list_head *head);
108108
int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw);
109109
size_t disasm__fprintf(struct list_head *head, FILE *fp);
110-
int symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel);
110+
void symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel);
111111

112112
struct sym_hist {
113113
u64 nr_samples;

0 commit comments

Comments
 (0)