diff --git a/libc/pthread/pthread_attrsetschedparam.c b/libc/pthread/pthread_attrsetschedparam.c index 0a06f1b926180c0bf7883917ed38db124cfab048..70fcd11272b116afbc356e91b48bbe71a356aade 100644 --- a/libc/pthread/pthread_attrsetschedparam.c +++ b/libc/pthread/pthread_attrsetschedparam.c @@ -45,6 +45,10 @@ #include <debug.h> #include <errno.h> +/**************************************************************************** + * Public Functions + ****************************************************************************/ + /**************************************************************************** * Function: pthread_attr_setschedparam * diff --git a/libc/sched/sched_getprioritymax.c b/libc/sched/sched_getprioritymax.c index fd3fdd490b344437ba31061ad58782122325bd17..e65c25d603abb2cd62c4406fa49c8d054c50031a 100644 --- a/libc/sched/sched_getprioritymax.c +++ b/libc/sched/sched_getprioritymax.c @@ -1,7 +1,7 @@ /************************************************************************ * libc/sched/sched_getprioritymax.c * - * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -39,31 +39,9 @@ #include <nuttx/config.h> -#include <nuttx/arch.h> - -/************************************************************************ - * Pre-processor Definitions - ************************************************************************/ - -/************************************************************************ - * Private Type Declarations - ************************************************************************/ - -/************************************************************************ - * Global Variables - ************************************************************************/ +#include <assert.h> -/************************************************************************ - * Private Variables - ************************************************************************/ - -/************************************************************************ - * Private Function Prototypes - ************************************************************************/ - -/************************************************************************ - * Private Functions - ************************************************************************/ +#include <nuttx/arch.h> /************************************************************************ * Public Functions @@ -89,12 +67,6 @@ int sched_get_priority_max(int policy) { - if (policy != SCHED_FIFO && policy != SCHED_RR) - { - return ERROR; - } - else - { - return SCHED_PRIORITY_MAX; - } + DEBUGASSERT(policy >= SCHED_FIFO && policy <= SCHED_OTHER); + return SCHED_PRIORITY_MAX; } diff --git a/libc/sched/sched_getprioritymin.c b/libc/sched/sched_getprioritymin.c index 27156b6558cf3cf0bafd5f857de4a91df10e340f..23a06f5d3b6ccd7db82e8ab3e169ea1f4bfd1383 100644 --- a/libc/sched/sched_getprioritymin.c +++ b/libc/sched/sched_getprioritymin.c @@ -1,7 +1,7 @@ /************************************************************************ * libc/sched/sched_getprioritymin.c * - * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -39,31 +39,9 @@ #include <nuttx/config.h> -#include <nuttx/arch.h> - -/************************************************************************ - * Pre-processor Definitions - ************************************************************************/ - -/************************************************************************ - * Private Type Declarations - ************************************************************************/ - -/************************************************************************ - * Global Variables - ************************************************************************/ +#include <assert.h> -/************************************************************************ - * Private Variables - ************************************************************************/ - -/************************************************************************ - * Private Function Prototypes - ************************************************************************/ - -/************************************************************************ - * Private Functions - ************************************************************************/ +#include <nuttx/arch.h> /************************************************************************ * Public Functions @@ -89,12 +67,6 @@ int sched_get_priority_min(int policy) { - if (policy != SCHED_FIFO && policy != SCHED_RR) - { - return ERROR; - } - else - { - return SCHED_PRIORITY_MIN; - } + DEBUGASSERT(policy >= SCHED_FIFO && policy <= SCHED_OTHER); + return SCHED_PRIORITY_MIN; } diff --git a/libc/spawn/lib_psa_setschedparam.c b/libc/spawn/lib_psa_setschedparam.c index 3e29ca4937e8035c1fd03c5d0e0bf71b8b3bf750..41c0366e0f986cfe1693e3910a09388cceb332fc 100644 --- a/libc/spawn/lib_psa_setschedparam.c +++ b/libc/spawn/lib_psa_setschedparam.c @@ -44,7 +44,7 @@ #include <assert.h> /**************************************************************************** - * Global Functions + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c index efd9d10eeda79a502dd58f49ec1ff7d4ac6b37eb..86e3dd8d8d636a30ed762a59fdf3d0919f641164 100644 --- a/sched/pthread/pthread_create.c +++ b/sched/pthread/pthread_create.c @@ -58,16 +58,9 @@ #include "pthread/pthread.h" /**************************************************************************** - * Pre-processor Definitions + * Public Data ****************************************************************************/ -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Global Variables - ****************************************************************************/ /* Default pthread attributes (see include/nuttx/pthread.h). When configured * to build separate kernel- and user-address spaces, this global is * duplicated in each address spaced. This copy can only be shared within @@ -77,7 +70,7 @@ const pthread_attr_t g_default_pthread_attr = PTHREAD_ATTR_INITIALIZER; /**************************************************************************** - * Private Variables + * Private Data ****************************************************************************/ /* This is the name for name-less pthreads */ diff --git a/sched/sched/sched_setparam.c b/sched/sched/sched_setparam.c index 5ba08d3c97b47d781ea866cac3273f9f1c44deef..e75980c3b59169a32f83639db3501cf7383208f1 100644 --- a/sched/sched/sched_setparam.c +++ b/sched/sched/sched_setparam.c @@ -48,30 +48,6 @@ #include "clock/clock.h" #include "sched/sched.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Global Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/sched/sched/sched_setscheduler.c b/sched/sched/sched_setscheduler.c index 8849a426a94df064067518a1aa4364085dc7f78e..f05fb39bc79d7df32b0c31c8ec9af9a6083c1946 100644 --- a/sched/sched/sched_setscheduler.c +++ b/sched/sched/sched_setscheduler.c @@ -49,30 +49,6 @@ #include "sched/sched.h" #include "clock/clock.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Global Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/sched/task/task_spawnparms.c b/sched/task/task_spawnparms.c index 32be77bd369245782dfd347b08d9ab963097989e..8e1b0318fbf7c5e55b6f103281ad79480ff48787 100644 --- a/sched/task/task_spawnparms.c +++ b/sched/task/task_spawnparms.c @@ -49,10 +49,6 @@ #include "task/spawn.h" #include "task/task.h" -/**************************************************************************** - * Private Types - ****************************************************************************/ - /**************************************************************************** * Public Data ****************************************************************************/ @@ -63,10 +59,6 @@ sem_t g_spawn_execsem = SEM_INITIALIZER(0); #endif struct spawn_parms_s g_spawn_parms; -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -310,7 +302,7 @@ int spawn_execattrs(pid_t pid, FAR const posix_spawnattr_t *attr) * file_actions - The attributes to use * * Returned Value: - * 0 (OK) on successed; A negated errno value is returned on failure. + * 0 (OK) on success; A negated errno value is returned on failure. * ****************************************************************************/