From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738AbcFZL0y (ORCPT ); Sun, 26 Jun 2016 07:26:54 -0400 Received: from szxga04-in.huawei.com ([58.251.152.52]:20859 "EHLO szxga04-in.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752331AbcFZLWB (ORCPT ); Sun, 26 Jun 2016 07:22:01 -0400 From: He Kuang To: , , , , , , , , CC: Subject: [RFC PATCH v2 10/26] perf bpf: Remove unused code in libbpf Date: Sun, 26 Jun 2016 11:21:02 +0000 Message-ID: <1466940078-65581-11-git-send-email-hekuang@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1466940078-65581-1-git-send-email-hekuang@huawei.com> References: <1466940078-65581-1-git-send-email-hekuang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.193.250] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.576FBACD.006C,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 39d167f835f9ee41bd019501f853f9f9 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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