mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 08:38:38 +08:00
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:
parent
f3cf11dcb5
commit
5bf24a15b5
1 changed files with 1 additions and 8 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue