Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uftrace: Fix dead store warnings found by infer #1757

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions utils/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ void print_time_unit(uint64_t delta_nsec)

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

if (base_nsec == 0) {
Expand Down
4 changes: 1 addition & 3 deletions utils/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,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 @@ -64,10 +63,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
1 change: 0 additions & 1 deletion utils/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ void record_perf_data(struct uftrace_perf_writer *perf, int cpu, int sock)

buf = &data[start & mask];
size = end - start;
start += size;

if (sock > 0)
send_trace_perf_data(sock, cpu, buf, size);
Expand Down