Skip to content

Commit 19db485

Browse files
katsustercarlescufi
authored andcommitted
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 <[email protected]>
1 parent 59903e2 commit 19db485

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

arch/sparc/core/thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void *z_arch_get_next_switch_handle(struct k_thread **old_thread)
7676
#if defined(CONFIG_FPU_SHARING)
7777
int arch_float_disable(struct k_thread *thread)
7878
{
79-
return -ENOSYS;
79+
return -ENOTSUP;
8080
}
8181

8282
int arch_float_enable(struct k_thread *thread, unsigned int options)

arch/x86/core/ia32/thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int arch_float_disable(struct k_thread *thread)
5656
#if defined(CONFIG_LAZY_FPU_SHARING)
5757
return z_float_disable(thread);
5858
#else
59-
return -ENOSYS;
59+
return -ENOTSUP;
6060
#endif /* CONFIG_LAZY_FPU_SHARING */
6161
}
6262

include/kernel.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5538,9 +5538,9 @@ __syscall void k_str_out(char *c, size_t n);
55385538
*
55395539
* @param thread ID of thread.
55405540
*
5541-
* @retval 0 On success.
5542-
* @retval -ENOSYS If the floating point disabling is not implemented.
5543-
* -EINVAL If the floating point disabling could not be performed.
5541+
* @retval 0 On success.
5542+
* @retval -ENOTSUP If the floating point disabling is not implemented.
5543+
* -EINVAL If the floating point disabling could not be performed.
55445544
*/
55455545
__syscall int k_float_disable(struct k_thread *thread);
55465546

kernel/thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ int z_impl_k_float_disable(struct k_thread *thread)
880880
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
881881
return arch_float_disable(thread);
882882
#else
883-
return -ENOSYS;
883+
return -ENOTSUP;
884884
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
885885
}
886886

tests/kernel/fpu_sharing/float_disable/src/k_float_disable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static void usr_fp_thread_entry_1(void)
3636
(defined(CONFIG_X86) && defined(CONFIG_LAZY_FPU_SHARING))
3737
#define K_FLOAT_DISABLE_SYSCALL_RETVAL 0
3838
#else
39-
#define K_FLOAT_DISABLE_SYSCALL_RETVAL -ENOSYS
39+
#define K_FLOAT_DISABLE_SYSCALL_RETVAL -ENOTSUP
4040
#endif
4141

4242
static void usr_fp_thread_entry_2(void)
@@ -98,7 +98,7 @@ void test_k_float_disable_common(void)
9898
usr_fp_thread.base.user_options);
9999
#else
100100
/* Verify k_float_disable() is not supported */
101-
zassert_true((k_float_disable(&usr_fp_thread) == -ENOSYS),
101+
zassert_true((k_float_disable(&usr_fp_thread) == -ENOTSUP),
102102
"k_float_disable() successful when not supported");
103103
#endif
104104
}

0 commit comments

Comments
 (0)