kernel: arch: use ENOTSUP instead of ENOSYS in k_float_disable()

This patch replaces ENOSYS into ENOTSUP to keep consistency with
the return value specification of k_float_enable().

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
This commit is contained in:
Katsuhiro Suzuki 2021-03-24 01:54:15 +09:00 committed by Carles Cufí
commit 19db485737
5 changed files with 8 additions and 8 deletions

View file

@ -76,7 +76,7 @@ void *z_arch_get_next_switch_handle(struct k_thread **old_thread)
#if defined(CONFIG_FPU_SHARING) #if defined(CONFIG_FPU_SHARING)
int arch_float_disable(struct k_thread *thread) int arch_float_disable(struct k_thread *thread)
{ {
return -ENOSYS; return -ENOTSUP;
} }
int arch_float_enable(struct k_thread *thread, unsigned int options) int arch_float_enable(struct k_thread *thread, unsigned int options)

View file

@ -56,7 +56,7 @@ int arch_float_disable(struct k_thread *thread)
#if defined(CONFIG_LAZY_FPU_SHARING) #if defined(CONFIG_LAZY_FPU_SHARING)
return z_float_disable(thread); return z_float_disable(thread);
#else #else
return -ENOSYS; return -ENOTSUP;
#endif /* CONFIG_LAZY_FPU_SHARING */ #endif /* CONFIG_LAZY_FPU_SHARING */
} }

View file

@ -5538,9 +5538,9 @@ __syscall void k_str_out(char *c, size_t n);
* *
* @param thread ID of thread. * @param thread ID of thread.
* *
* @retval 0 On success. * @retval 0 On success.
* @retval -ENOSYS If the floating point disabling is not implemented. * @retval -ENOTSUP If the floating point disabling is not implemented.
* -EINVAL If the floating point disabling could not be performed. * -EINVAL If the floating point disabling could not be performed.
*/ */
__syscall int k_float_disable(struct k_thread *thread); __syscall int k_float_disable(struct k_thread *thread);

View file

@ -880,7 +880,7 @@ int z_impl_k_float_disable(struct k_thread *thread)
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING) #if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
return arch_float_disable(thread); return arch_float_disable(thread);
#else #else
return -ENOSYS; return -ENOTSUP;
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */ #endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
} }

View file

@ -36,7 +36,7 @@ static void usr_fp_thread_entry_1(void)
(defined(CONFIG_X86) && defined(CONFIG_LAZY_FPU_SHARING)) (defined(CONFIG_X86) && defined(CONFIG_LAZY_FPU_SHARING))
#define K_FLOAT_DISABLE_SYSCALL_RETVAL 0 #define K_FLOAT_DISABLE_SYSCALL_RETVAL 0
#else #else
#define K_FLOAT_DISABLE_SYSCALL_RETVAL -ENOSYS #define K_FLOAT_DISABLE_SYSCALL_RETVAL -ENOTSUP
#endif #endif
static void usr_fp_thread_entry_2(void) static void usr_fp_thread_entry_2(void)
@ -98,7 +98,7 @@ void test_k_float_disable_common(void)
usr_fp_thread.base.user_options); usr_fp_thread.base.user_options);
#else #else
/* Verify k_float_disable() is not supported */ /* Verify k_float_disable() is not supported */
zassert_true((k_float_disable(&usr_fp_thread) == -ENOSYS), zassert_true((k_float_disable(&usr_fp_thread) == -ENOTSUP),
"k_float_disable() successful when not supported"); "k_float_disable() successful when not supported");
#endif #endif
} }