[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-85c617abc786d7da9e95c0b4174159864dd3f85c@git.kernel.org>
Date: Tue, 23 May 2017 01:41:24 -0700
From: tip-bot for Dan Carpenter <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, tglx@...utronix.de, peterz@...radead.org,
dan.carpenter@...cle.com, mingo@...nel.org, eranian@...gle.com,
alexander.shishkin@...ux.intel.com, acme@...nel.org,
linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
jolsa@...hat.com, hpa@...or.com, vincent.weaver@...ne.edu
Subject: [tip:perf/core] perf/core: Remove some dead code
Commit-ID: 85c617abc786d7da9e95c0b4174159864dd3f85c
Gitweb: http://git.kernel.org/tip/85c617abc786d7da9e95c0b4174159864dd3f85c
Author: Dan Carpenter <dan.carpenter@...cle.com>
AuthorDate: Mon, 22 May 2017 12:03:49 +0300
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 23 May 2017 09:50:05 +0200
perf/core: Remove some dead code
perf_init_event() can't return NULL. If it did, the error handling is
incomplete and we would crash. I have removed this confusing dead code.
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Vince Weaver <vincent.weaver@...ne.edu>
Link: http://lkml.kernel.org/r/20170522090348.5g7yyld5en3yeky4@mwanda
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/events/core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 6e75a5c..0028efa 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -9172,7 +9172,7 @@ static int perf_try_init_event(struct pmu *pmu, struct perf_event *event)
static struct pmu *perf_init_event(struct perf_event *event)
{
- struct pmu *pmu = NULL;
+ struct pmu *pmu;
int idx;
int ret;
@@ -9456,9 +9456,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
}
pmu = perf_init_event(event);
- if (!pmu)
- goto err_ns;
- else if (IS_ERR(pmu)) {
+ if (IS_ERR(pmu)) {
err = PTR_ERR(pmu);
goto err_ns;
}
Powered by blists - more mailing lists