From 5bf24a15b5abd5633151b4c8008676827c274168 Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Tue, 20 Aug 2024 10:17:41 +0800 Subject: [PATCH] lib_getnprocs:add #include instead of ifdef Summary: Since there is a default definition for CONFIG_SMP_NCPUS in sys/types.h, we can remove #ifdef and return CONFIG_SMP_NCPUS directly. Signed-off-by: chenrun1 --- libs/libc/misc/lib_getnprocs.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libs/libc/misc/lib_getnprocs.c b/libs/libc/misc/lib_getnprocs.c index 06d68a94d9..80cc96af0b 100644 --- a/libs/libc/misc/lib_getnprocs.c +++ b/libs/libc/misc/lib_getnprocs.c @@ -24,6 +24,7 @@ #include #include +#include /**************************************************************************** * Public Functions @@ -50,11 +51,7 @@ int get_nprocs_conf(void) { -#ifdef CONFIG_SMP_NCPUS return CONFIG_SMP_NCPUS; -#else - return 1; -#endif } /**************************************************************************** @@ -78,9 +75,5 @@ int get_nprocs_conf(void) int get_nprocs(void) { -#ifdef CONFIG_SMP_NCPUS return CONFIG_SMP_NCPUS; -#else - return 1; -#endif }