[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20160118212935.69417deb@debian>
Date: Mon, 18 Jan 2016 21:29:35 +0800
From: Wang Xiaoqiang <wangxq10@....edu.cn>
To: Ingo Molnar <mingo@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH] perf/core: Directly return the error pointer instead of use
'goto'
Hi, Ingo,
This patch return the error pointer directly, not use 'goto'. Patch
is as follows.
thanks,
Wang Xiaoqiang
>From 33ed914e6d3f3d63698b5e178efd648ca7cd086d Mon Sep 17 00:00:00 2001
From: Wang Xiaoqiang <wangxq10@....edu.cn>
Date: Mon, 18 Jan 2016 21:14:06 +0800
Subject: [PATCH] perf/core: Directly return the error pointer instead of use
'goto'
Just return the error pointer instead of using "goto" to make
the program structure more clear.
Signed-off-by: Wang Xiaoqiang <wangxq10@....edu.cn>
---
kernel/events/core.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index bf82441..1d250b2 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -8550,10 +8550,8 @@ perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu,
event = perf_event_alloc(attr, cpu, task, NULL, NULL,
overflow_handler, context, -1);
- if (IS_ERR(event)) {
- err = PTR_ERR(event);
- goto err;
- }
+ if (IS_ERR(event))
+ return event;
/* Mark owner so we could distinguish it from user events. */
event->owner = EVENT_OWNER_KERNEL;
@@ -8584,7 +8582,7 @@ perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu,
err_free:
free_event(event);
-err:
+
return ERR_PTR(err);
}
EXPORT_SYMBOL_GPL(perf_event_create_kernel_counter);
--
2.1.4
Powered by blists - more mailing lists