Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1621050
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] perf/core: Remove some dead code |
| Date | 2017-04-11 11:10 +0200 |
| Message-ID | <tuZYe-4Xn-21@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
perf_init_event() never returns NULL, only error pointer. The check for
NULL causes a static checker warning and it seems slightly buggy to do
a goto err_ns without setting the error code so those are two other
reasons to delete this.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 6e75a5c9412d..0028efa0abc3 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;
}
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH] perf/core: Remove some dead code Dan Carpenter <dan.carpenter@oracle.com> - 2017-04-11 11:10 +0200
csiph-web