kernel: swap: Fix __swap signature

__swap function was returning -EAGAIN in some case, though its return
value was declared as unsigned int.

This commit changes this function to return int since it can return a
negative value and its return was already been propagate as int.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2018-09-11 18:33:37 -07:00 committed by Anas Nashif
commit 8a9ba10c2c
3 changed files with 7 additions and 7 deletions

View file

@ -41,11 +41,11 @@ extern const int _k_neg_eagain;
* On ARMv6-M, the intlock key is represented by the PRIMASK register,
* as BASEPRI is not available.
*
* @return may contain a return value setup by a call to
* @return -EAGAIN, or a return value set by a call to
* _set_thread_return_value()
*
*/
unsigned int __swap(int key)
int __swap(int key)
{
#ifdef CONFIG_USERSPACE
/* Save off current privilege mode */

View file

@ -34,7 +34,7 @@
*
*/
unsigned int __swap(unsigned int key)
int __swap(unsigned int key)
{
/*
* struct k_thread * _kernel.current is the currently runnig thread

View file

@ -40,7 +40,7 @@ void _smp_release_global_lock(struct k_thread *thread);
* Needed for SMP, where the scheduler requires spinlocking that we
* don't want to have to do in per-architecture assembly.
*/
static inline unsigned int _Swap(unsigned int key)
static inline int _Swap(unsigned int key)
{
struct k_thread *new_thread, *old_thread;
int ret = 0;
@ -90,11 +90,11 @@ static inline unsigned int _Swap(unsigned int key)
#else /* !CONFIG_USE_SWITCH */
extern unsigned int __swap(unsigned int key);
extern int __swap(unsigned int key);
static inline unsigned int _Swap(unsigned int key)
static inline int _Swap(unsigned int key)
{
unsigned int ret;
int ret;
_check_stack_sentinel();
_update_time_slice_before_swap();