lib_getnprocs:add #include <sys/types.h> 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 <chenrun1@xiaomi.com>
This commit is contained in:
chenrun1 2024-08-20 10:17:41 +08:00 committed by Xiang Xiao
parent f3cf11dcb5
commit 5bf24a15b5

View file

@ -24,6 +24,7 @@
#include <nuttx/config.h>
#include <sys/sysinfo.h>
#include <sys/types.h>
/****************************************************************************
* 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
}