Skip to content

Commit

Permalink
utils, debug: refactor not needed variable
Browse files Browse the repository at this point in the history
Issue namhyung#1553 related ret variable dead store clean up.

Not needed initialization on double variable.

Signed-off-by: Paran Lee <p4ranlee@gmail.com>
  • Loading branch information
paranlee committed Aug 15, 2023
1 parent afeda9f commit 282079b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion utils/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ void print_time_unit(uint64_t delta_nsec)

void print_diff_percent(uint64_t base_nsec, uint64_t pair_nsec)
{
double percent = 999.99;
double percent;
const char *sc = get_color(COLOR_CODE_NORMAL);
const char *ec = get_color(COLOR_CODE_RESET);

Expand Down
4 changes: 1 addition & 3 deletions utils/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ struct kfilter {
static int set_filter_file(const char *filter_file, struct list_head *filters)
{
struct kfilter *pos, *tmp;
int ret = -1;
int fd;

fd = open_tracing_file(filter_file, true);
Expand All @@ -75,10 +74,9 @@ static int set_filter_file(const char *filter_file, struct list_head *filters)
if (write(fd, " ", 1) != 1)
pr_dbg2("writing filter file failed, but ignoring...\n");
}
ret = 0;

close(fd);
return ret;
return 0;
}

static int set_tracing_filter(struct uftrace_kernel_writer *kernel)
Expand Down

0 comments on commit 282079b

Please sign in to comment.