lkml.org 
[lkml]   [2016]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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@lzu.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@lzu.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


\
 
 \ /
  Last update: 2016-01-18 15:41    [W:3.984 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site