[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1466940078-65581-11-git-send-email-hekuang@huawei.com>
Date: Sun, 26 Jun 2016 11:21:02 +0000
From: He Kuang <hekuang@...wei.com>
To: <acme@...nel.org>, <peterz@...radead.org>, <mingo@...hat.com>,
<jolsa@...hat.com>, <brendan.d.gregg@...il.com>, <ast@...nel.org>,
<alexander.shishkin@...ux.intel.com>, <wangnan0@...wei.com>,
<hekuang@...wei.com>
CC: <linux-kernel@...r.kernel.org>
Subject: [RFC PATCH v2 10/26] perf bpf: Remove unused code in libbpf
Clean up unnecessary assignments to local variable 'result.pfd', and
remove 'pfd' field in 'struct bpf_prog_prep_result' since no one else
uses it.
Signed-off-by: He Kuang <hekuang@...wei.com>
---
tools/lib/bpf/libbpf.c | 4 ----
tools/lib/bpf/libbpf.h | 3 ---
tools/perf/util/bpf-loader.c | 1 -
3 files changed, 8 deletions(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 462e526..754e460 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -979,8 +979,6 @@ bpf_program__load(struct bpf_program *prog,
pr_debug("Skip loading the %dth instance of program '%s'\n",
i, prog->section_name);
prog->instances.fds[i] = -1;
- if (result.pfd)
- *result.pfd = -1;
continue;
}
@@ -994,8 +992,6 @@ bpf_program__load(struct bpf_program *prog,
goto out;
}
- if (result.pfd)
- *result.pfd = fd;
prog->instances.fds[i] = fd;
}
out:
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 722f46b..55f65de 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -125,9 +125,6 @@ struct bpf_prog_prep_result {
*/
struct bpf_insn *new_insn_ptr;
int new_insn_cnt;
-
- /* If not NULL, result fd is set to it */
- int *pfd;
};
/*
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index dcc8845..2ac73e3 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -429,7 +429,6 @@ preproc_gen_prologue(struct bpf_program *prog, int n,
res->new_insn_ptr = buf;
res->new_insn_cnt = prologue_cnt + orig_insns_cnt;
- res->pfd = NULL;
return 0;
errout:
--
1.8.5.2
Powered by blists - more mailing lists