[PATCH] rtems: Coding style
Sebastian Huber
sebastian.huber at embedded-brains.de
Wed May 28 15:26:31 UTC 2014
---
cpukit/rtems/src/schedulergetprocessorset.c | 28 +++++++++++---------------
1 files changed, 12 insertions(+), 16 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;
+ const Scheduler_Control *scheduler;
- if ( cpuset != NULL ) {
- const Scheduler_Control *scheduler;
+ if ( cpuset == NULL ) {
+ return RTEMS_INVALID_ADDRESS;
+ }
- if ( _Scheduler_Get_by_id( scheduler_id, &scheduler ) ) {
- if ( _CPU_set_Is_large_enough( cpusetsize ) ) {
- _Scheduler_Get_processor_set( scheduler, cpusetsize, cpuset );
+ if ( !_Scheduler_Get_by_id( scheduler_id, &scheduler ) ) {
+ return RTEMS_INVALID_ID;
+ }
- sc = RTEMS_SUCCESSFUL;
- } else {
- sc = RTEMS_INVALID_NUMBER;
- }
- } else {
- sc = RTEMS_INVALID_ID;
- }
- } else {
- sc = RTEMS_INVALID_ADDRESS;
+ if ( !_CPU_set_Is_large_enough( cpusetsize ) ) {
+ return RTEMS_INVALID_NUMBER;
}
- return sc;
+ _Scheduler_Get_processor_set( scheduler, cpusetsize, cpuset );
+
+ return RTEMS_SUCCESSFUL;
}
#endif /* defined(__RTEMS_HAVE_SYS_CPUSET_H__) */
--
1.7.7
More information about the devel
mailing list