diff mbox series

[2/2] tools, bpftool: Remove two unused variables.

Message ID 20201027233646.3434896-2-irogers@google.com
State Not Applicable
Delegated to: BPF Maintainers
Headers show
Series [1/2] tools, bpftool: Avoid array index warnings. | expand

Checks

Context Check Description
jkicinski/cover_letter success Link
jkicinski/fixes_present success Link
jkicinski/patch_count success Link
jkicinski/tree_selection success Guessed tree name to be net-next
jkicinski/subject_prefix success Link
jkicinski/source_inline success Was 0 now: 0
jkicinski/verify_signedoff success Link
jkicinski/module_param success Was 0 now: 0
jkicinski/build_32bit fail Errors and warnings before: 4 this patch: 4
jkicinski/kdoc success Errors and warnings before: 0 this patch: 0
jkicinski/verify_fixes success Link
jkicinski/checkpatch fail Link
jkicinski/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
jkicinski/header_inline success Link
jkicinski/stable success Stable not CCed

Commit Message

Ian Rogers Oct. 27, 2020, 11:36 p.m. UTC
Avoid an unused variable warning.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/bpf/bpftool/skeleton/profiler.bpf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andrii Nakryiko Oct. 28, 2020, 3:41 a.m. UTC | #1
On Tue, Oct 27, 2020 at 4:37 PM Ian Rogers <irogers@google.com> wrote:
>
> Avoid an unused variable warning.
>
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---

Acked-by: Andrii Nakryiko <andrii@kernel.org>

>  tools/bpf/bpftool/skeleton/profiler.bpf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/bpf/bpftool/skeleton/profiler.bpf.c b/tools/bpf/bpftool/skeleton/profiler.bpf.c
> index 4e3512f700c0..ce5b65e07ab1 100644
> --- a/tools/bpf/bpftool/skeleton/profiler.bpf.c
> +++ b/tools/bpf/bpftool/skeleton/profiler.bpf.c
> @@ -70,7 +70,7 @@ int BPF_PROG(fentry_XXX)
>  static inline void
>  fexit_update_maps(u32 id, struct bpf_perf_event_value *after)
>  {
> -       struct bpf_perf_event_value *before, diff, *accum;
> +       struct bpf_perf_event_value *before, diff;
>
>         before = bpf_map_lookup_elem(&fentry_readings, &id);
>         /* only account samples with a valid fentry_reading */
> @@ -95,7 +95,7 @@ int BPF_PROG(fexit_XXX)
>  {
>         struct bpf_perf_event_value readings[MAX_NUM_MATRICS];
>         u32 cpu = bpf_get_smp_processor_id();
> -       u32 i, one = 1, zero = 0;
> +       u32 i, zero = 0;
>         int err;
>         u64 *count;
>
> --
> 2.29.0.rc2.309.g374f81d7ae-goog
>
Tobias Klauser Oct. 28, 2020, 1:45 p.m. UTC | #2
On 2020-10-28 at 00:36:46 +0100, Ian Rogers <irogers@google.com> wrote:
> Avoid an unused variable warning.
> 
> Signed-off-by: Ian Rogers <irogers@google.com>

Reviewed-by: Tobias Klauser <tklauser@distanz.ch>
diff mbox series

Patch

diff --git a/tools/bpf/bpftool/skeleton/profiler.bpf.c b/tools/bpf/bpftool/skeleton/profiler.bpf.c
index 4e3512f700c0..ce5b65e07ab1 100644
--- a/tools/bpf/bpftool/skeleton/profiler.bpf.c
+++ b/tools/bpf/bpftool/skeleton/profiler.bpf.c
@@ -70,7 +70,7 @@  int BPF_PROG(fentry_XXX)
 static inline void
 fexit_update_maps(u32 id, struct bpf_perf_event_value *after)
 {
-	struct bpf_perf_event_value *before, diff, *accum;
+	struct bpf_perf_event_value *before, diff;
 
 	before = bpf_map_lookup_elem(&fentry_readings, &id);
 	/* only account samples with a valid fentry_reading */
@@ -95,7 +95,7 @@  int BPF_PROG(fexit_XXX)
 {
 	struct bpf_perf_event_value readings[MAX_NUM_MATRICS];
 	u32 cpu = bpf_get_smp_processor_id();
-	u32 i, one = 1, zero = 0;
+	u32 i, zero = 0;
 	int err;
 	u64 *count;