perf/core: Directly return the error pointer instead of use 'goto'
PATCH 1/1 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
Quoted 1 line
From
33ed914e6d3f3d63698b5e178efd648ca7cd086dMon Sep 17 00:00:00 2001
From: Wang Xiaoqiang <[email protected]>
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 <[email protected]>
--- kernel/events/core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
kernel/events/core.c +3 -5
@@ -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);
Signature · 1 line
2.1.4