This is an automated email from the ASF dual-hosted git repository.

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

commit 65bad9f4dd666fc804a24757b95dff7e3f53960c
Author: yukangzhi <[email protected]>
AuthorDate: Mon Jul 6 11:27:10 2026 +0800

    procfs: remove redundant preprocessor guards duplicating build system
    
    The build system (CMakeLists.txt / Make.defs) already ensures procfs
    source files are only compiled when CONFIG_FS_PROCFS is enabled and
    CONFIG_DISABLE_MOUNTPOINT is not set.  Remove the redundant whole-file
    guards.
    
    Retain inner guards that provide additional granularity (e.g.
    CONFIG_FS_PROCFS_EXCLUDE_xxx, CONFIG_ARCH_HAVE_TCBINFO) since those
    are not checked by the build system.
    
    Also fix incorrect #endif comments (EXCLUDE_PROCESS -> EXCLUDE_UPTIME /
    EXCLUDE_VERSION).
    
    Signed-off-by: yukangzhi <[email protected]>
    Signed-off-by: jingfei <[email protected]>
---
 fs/procfs/fs_procfscpuload.c | 2 --
 fs/procfs/fs_procfsproc.c    | 2 --
 fs/procfs/fs_procfstcbinfo.c | 6 +++---
 fs/procfs/fs_procfsuptime.c  | 4 +---
 fs/procfs/fs_procfsutil.c    | 4 ----
 fs/procfs/fs_procfsversion.c | 4 +---
 6 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/fs/procfs/fs_procfscpuload.c b/fs/procfs/fs_procfscpuload.c
index 3c19b49c4b1..51f72a924ed 100644
--- a/fs/procfs/fs_procfscpuload.c
+++ b/fs/procfs/fs_procfscpuload.c
@@ -48,7 +48,6 @@
 
 #include "fs_heap.h"
 
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_PROCFS)
 #if !defined(CONFIG_SCHED_CPULOAD_NONE) && \
     !defined(CONFIG_FS_PROCFS_EXCLUDE_CPULOAD)
 
@@ -342,4 +341,3 @@ static int cpuload_stat(const char *relpath, struct stat 
*buf)
  ****************************************************************************/
 
 #endif /* CONFIG_FS_PROCFS_EXCLUDE_CPULOAD */
-#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_PROCFS */
diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c
index 53cbfa1db1f..eb31134bcac 100644
--- a/fs/procfs/fs_procfsproc.c
+++ b/fs/procfs/fs_procfsproc.c
@@ -68,7 +68,6 @@
 #  include <nuttx/clock.h>
 #endif
 
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_PROCFS)
 #ifndef CONFIG_FS_PROCFS_EXCLUDE_PROCESS
 
 /****************************************************************************
@@ -2303,4 +2302,3 @@ static int proc_stat(const char *relpath, struct stat 
*buf)
  ****************************************************************************/
 
 #endif /* CONFIG_FS_PROCFS_EXCLUDE_PROCESS */
-#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_PROCFS */
diff --git a/fs/procfs/fs_procfstcbinfo.c b/fs/procfs/fs_procfstcbinfo.c
index 1e2b5beb1e1..e10f64d411c 100644
--- a/fs/procfs/fs_procfstcbinfo.c
+++ b/fs/procfs/fs_procfstcbinfo.c
@@ -46,8 +46,8 @@
 #include "fs_heap.h"
 #include "sched/sched.h"
 
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_PROCFS) && \
-    defined(CONFIG_ARCH_HAVE_TCBINFO) && 
!defined(CONFIG_FS_PROCFS_EXCLUDE_TCBINFO)
+#if defined(CONFIG_ARCH_HAVE_TCBINFO) && \
+    !defined(CONFIG_FS_PROCFS_EXCLUDE_TCBINFO)
 
 /****************************************************************************
  * Pre-processor Definitions
@@ -285,4 +285,4 @@ static int tcbinfo_stat(FAR const char *relpath, FAR struct 
stat *buf)
  * Public Functions
  ****************************************************************************/
 
-#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_PROCFS */
+#endif /* CONFIG_ARCH_HAVE_TCBINFO && !CONFIG_FS_PROCFS_EXCLUDE_TCBINFO */
diff --git a/fs/procfs/fs_procfsuptime.c b/fs/procfs/fs_procfsuptime.c
index ffed34e8430..c865bc7e587 100644
--- a/fs/procfs/fs_procfsuptime.c
+++ b/fs/procfs/fs_procfsuptime.c
@@ -47,7 +47,6 @@
 
 #include "fs_heap.h"
 
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_PROCFS)
 #ifndef CONFIG_FS_PROCFS_EXCLUDE_UPTIME
 
 /****************************************************************************
@@ -315,5 +314,4 @@ static int uptime_stat(FAR const char *relpath, FAR struct 
stat *buf)
  * Public Functions
  ****************************************************************************/
 
-#endif /* CONFIG_FS_PROCFS_EXCLUDE_PROCESS */
-#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_PROCFS */
+#endif /* CONFIG_FS_PROCFS_EXCLUDE_UPTIME */
diff --git a/fs/procfs/fs_procfsutil.c b/fs/procfs/fs_procfsutil.c
index c6a3eb2efe4..350bc15a8b0 100644
--- a/fs/procfs/fs_procfsutil.c
+++ b/fs/procfs/fs_procfsutil.c
@@ -33,8 +33,6 @@
 
 #include <nuttx/fs/procfs.h>
 
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_PROCFS)
-
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
@@ -212,5 +210,3 @@ void procfs_sprintf(FAR char *buf, size_t size, FAR off_t 
*offset,
 
   *offset -= copysize;
 }
-
-#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_PROCFS */
diff --git a/fs/procfs/fs_procfsversion.c b/fs/procfs/fs_procfsversion.c
index 2e673cda643..04647f005de 100644
--- a/fs/procfs/fs_procfsversion.c
+++ b/fs/procfs/fs_procfsversion.c
@@ -47,7 +47,6 @@
 
 #include "fs_heap.h"
 
-#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_PROCFS)
 #ifndef CONFIG_FS_PROCFS_EXCLUDE_VERSION
 
 /****************************************************************************
@@ -288,5 +287,4 @@ static int version_stat(FAR const char *relpath, FAR struct 
stat *buf)
  * Public Functions
  ****************************************************************************/
 
-#endif /* CONFIG_FS_PROCFS_EXCLUDE_PROCESS */
-#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_PROCFS */
+#endif /* CONFIG_FS_PROCFS_EXCLUDE_VERSION */

Reply via email to