lkml.org 
[lkml]   [2013]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 05/16] perf, persistent: Return resonable error code
Date
From: Robert Richter <robert.richter@calxeda.com>

Returning -ENODEV if no file descriptor is found. An error code of -1
(-EPERM) is misleading in this case.

Signed-off-by: Robert Richter <robert.richter@calxeda.com>
---
kernel/events/persistent.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/persistent.c b/kernel/events/persistent.c
index 6612eb77..190aa75 100644
--- a/kernel/events/persistent.c
+++ b/kernel/events/persistent.c
@@ -165,7 +165,7 @@ int perf_get_persistent_event_fd(unsigned cpu, struct perf_event_attr *attr)
if (desc->attr->config == attr->config)
return __alloc_persistent_event_fd(desc);

- return -1;
+ return -ENODEV;
}


--
1.8.1.1


\
 
 \ /
  Last update: 2013-05-31 13:21    [W:0.169 / U:2.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site