[rtems commit] rtems: Coding style

Sebastian Huber sebh at rtems.org
Mon Jun 2 08:02:58 UTC 2014


Module:    rtems
Branch:    master
Commit:    d7a1863be24c4df0ed7f50b0486d278e1b3f260b
Changeset: http://git.rtems.org/rtems/commit/?id=d7a1863be24c4df0ed7f50b0486d278e1b3f260b

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed May 28 17:23:27 2014 +0200

rtems: Coding style

---

 cpukit/rtems/src/schedulergetprocessorset.c |   34 ++++++++++++---------------
 1 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/cpukit/rtems/src/schedulergetprocessorset.c b/cpukit/rtems/src/schedulergetprocessorset.c
index e459b17..016c368 100644
--- a/cpukit/rtems/src/schedulergetprocessorset.c
+++ b/cpukit/rtems/src/schedulergetprocessorset.c
@@ -28,27 +28,23 @@ rtems_status_code rtems_scheduler_get_processor_set(
   cpu_set_t *cpuset
 )
 {
-  rtems_status_code sc;
-
-  if ( cpuset != NULL ) {
-    const Scheduler_Control *scheduler;
-
-    if ( _Scheduler_Get_by_id( scheduler_id, &scheduler ) ) {
-      if ( _CPU_set_Is_large_enough( cpusetsize ) ) {
-        _Scheduler_Get_processor_set( scheduler, cpusetsize, cpuset );
-
-        sc = RTEMS_SUCCESSFUL;
-      } else {
-        sc = RTEMS_INVALID_NUMBER;
-      }
-    } else {
-      sc = RTEMS_INVALID_ID;
-    }
-  } else {
-    sc = RTEMS_INVALID_ADDRESS;
+  const Scheduler_Control *scheduler;
+
+  if ( cpuset == NULL ) {
+    return RTEMS_INVALID_ADDRESS;
+  }
+
+  if ( !_Scheduler_Get_by_id( scheduler_id, &scheduler ) ) {
+    return RTEMS_INVALID_ID;
   }
 
-  return sc;
+  if ( !_CPU_set_Is_large_enough( cpusetsize ) ) {
+    return RTEMS_INVALID_NUMBER;
+  }
+
+  _Scheduler_Get_processor_set( scheduler, cpusetsize, cpuset );
+
+  return RTEMS_SUCCESSFUL;
 }
 
 #endif /* defined(__RTEMS_HAVE_SYS_CPUSET_H__) */




More information about the vc mailing list