nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acas...@apache.org
Subject [incubator-nuttx] 01/03: builtin: Remove HAVE_BUILTIN_CONTEXT macro
Date Fri, 01 May 2020 13:43:54 GMT
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit fe5cb9529d7539270bc6664a72c60f77ac85547a
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
AuthorDate: Thu Apr 30 14:35:04 2020 +0800

    builtin: Remove HAVE_BUILTIN_CONTEXT macro
    
    it's enough to decide which code should be compiled with CONFIG_BUILTIN and CONFIG_FS_BINFS
    
    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
---
 binfmt/binfmt.h                          |  4 ++--
 binfmt/binfmt_initialize.c               |  2 +-
 binfmt/builtin.c                         |  4 ++--
 include/nuttx/lib/builtin.h              | 10 ----------
 libs/libc/builtin/lib_builtin_forindex.c |  4 ----
 libs/libc/builtin/lib_builtin_getname.c  |  4 ----
 libs/libc/builtin/lib_builtin_isavail.c  |  4 ----
 7 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/binfmt/binfmt.h b/binfmt/binfmt.h
index d26bd31..371d6f3 100644
--- a/binfmt/binfmt.h
+++ b/binfmt/binfmt.h
@@ -147,7 +147,7 @@ void binfmt_freeargv(FAR struct binary_s *bin);
  *
  ****************************************************************************/
 
-#if defined(CONFIG_FS_BINFS) && defined(HAVE_BUILTIN_CONTEXT)
+#ifdef CONFIG_FS_BINFS
 int builtin_initialize(void);
 #endif
 
@@ -162,7 +162,7 @@ int builtin_initialize(void);
  *
  ****************************************************************************/
 
-#if defined(CONFIG_FS_BINFS) && defined(HAVE_BUILTIN_CONTEXT)
+#ifdef CONFIG_FS_BINFS
 void builtin_uninitialize(void);
 #endif
 
diff --git a/binfmt/binfmt_initialize.c b/binfmt/binfmt_initialize.c
index 14c9558..99d16bb 100644
--- a/binfmt/binfmt_initialize.c
+++ b/binfmt/binfmt_initialize.c
@@ -64,7 +64,7 @@ void binfmt_initialize(void)
 {
   int ret;
 
-#if defined(CONFIG_FS_BINFS) && defined(HAVE_BUILTIN_CONTEXT)
+#ifdef CONFIG_FS_BINFS
   ret = builtin_initialize();
   if (ret < 0)
     {
diff --git a/binfmt/builtin.c b/binfmt/builtin.c
index a3356d2..57b2431 100644
--- a/binfmt/builtin.c
+++ b/binfmt/builtin.c
@@ -53,7 +53,7 @@
 #include <nuttx/binfmt/binfmt.h>
 #include <nuttx/lib/builtin.h>
 
-#ifdef HAVE_BUILTIN_CONTEXT
+#ifdef CONFIG_FS_BINFS
 
 /****************************************************************************
  * Private Function Prototypes
@@ -191,4 +191,4 @@ void builtin_uninitialize(void)
   unregister_binfmt(&g_builtin_binfmt);
 }
 
-#endif /* HAVE_BUILTIN_CONTEXT */
+#endif /* CONFIG_FS_BINFS */
diff --git a/include/nuttx/lib/builtin.h b/include/nuttx/lib/builtin.h
index 8e853d5..6d36520 100644
--- a/include/nuttx/lib/builtin.h
+++ b/include/nuttx/lib/builtin.h
@@ -53,16 +53,6 @@
 #ifdef CONFIG_BUILTIN
 
 /****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/* This logic is not usable in the KERNEL build from within the kernel. */
-
-#if !defined(CONFIG_BUILD_KERNEL) || !defined(__KERNEL__)
-#  define HAVE_BUILTIN_CONTEXT
-#endif
-
-/****************************************************************************
  * Public Types
  ****************************************************************************/
 
diff --git a/libs/libc/builtin/lib_builtin_forindex.c b/libs/libc/builtin/lib_builtin_forindex.c
index e8f1471..4c4ec70 100644
--- a/libs/libc/builtin/lib_builtin_forindex.c
+++ b/libs/libc/builtin/lib_builtin_forindex.c
@@ -43,8 +43,6 @@
 
 #include <nuttx/lib/builtin.h>
 
-#ifdef HAVE_BUILTIN_CONTEXT
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -77,5 +75,3 @@ FAR const struct builtin_s *builtin_for_index(int index)
 
   return NULL;
 }
-
-#endif /* HAVE_BUILTIN_CONTEXT */
diff --git a/libs/libc/builtin/lib_builtin_getname.c b/libs/libc/builtin/lib_builtin_getname.c
index 5627856..fa7a7b2 100644
--- a/libs/libc/builtin/lib_builtin_getname.c
+++ b/libs/libc/builtin/lib_builtin_getname.c
@@ -48,8 +48,6 @@
 
 #include <nuttx/lib/builtin.h>
 
-#ifdef HAVE_BUILTIN_CONTEXT
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -83,5 +81,3 @@ FAR const char *builtin_getname(int index)
 
   return NULL;
 }
-
-#endif /* HAVE_BUILTIN_CONTEXT */
diff --git a/libs/libc/builtin/lib_builtin_isavail.c b/libs/libc/builtin/lib_builtin_isavail.c
index 3a99fe0..d5b8f56 100644
--- a/libs/libc/builtin/lib_builtin_isavail.c
+++ b/libs/libc/builtin/lib_builtin_isavail.c
@@ -52,8 +52,6 @@
 
 #include <nuttx/lib/builtin.h>
 
-#ifdef HAVE_BUILTIN_CONTEXT
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -92,5 +90,3 @@ int builtin_isavail(FAR const char *appname)
 
   return -ENOENT;
 }
-
-#endif /* HAVE_BUILTIN_CONTEXT */


Mime
View raw message