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
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
@ -50,11 +51,7 @@
|
|||||||
|
|
||||||
int get_nprocs_conf(void)
|
int get_nprocs_conf(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SMP_NCPUS
|
|
||||||
return CONFIG_SMP_NCPUS;
|
return CONFIG_SMP_NCPUS;
|
||||||
#else
|
|
||||||
return 1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -78,9 +75,5 @@ int get_nprocs_conf(void)
|
|||||||
|
|
||||||
int get_nprocs(void)
|
int get_nprocs(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SMP_NCPUS
|
|
||||||
return CONFIG_SMP_NCPUS;
|
return CONFIG_SMP_NCPUS;
|
||||||
#else
|
|
||||||
return 1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user