You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/10/15 18:31:22 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request, #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

xiaoxiang781216 opened a new pull request, #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319

   ## Summary
   
   ## Impact
   procfs default setting
   
   ## Testing
   Pass CI
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#issuecomment-1280711122

   Done.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r996418603


##########
fs/procfs/fs_procfs.c:
##########
@@ -184,27 +184,24 @@ static const struct procfs_entry_s g_procfs_entries[] =
 #if defined(CONFIG_DEBUG_TCBINFO) && !defined(CONFIG_FS_PROCFS_EXCLUDE_TCBINFO)
   { "tcbinfo",       &tcbinfo_operations,         PROCFS_FILE_TYPE   },
 #endif
+  { NULL,            NULL,                        PROCFS_UNKOWN_TYPE },
 };
 
 #ifdef CONFIG_FS_PROCFS_REGISTER
 static const uint8_t g_base_entrycount = sizeof(g_base_entries) /

Review Comment:
   why do we need `g_base_entrycount` if array us already NULL terminated and can be just `while`-ed till `pathpattern != NULL`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r996433261


##########
fs/procfs/fs_procfs.c:
##########
@@ -184,27 +184,24 @@ static const struct procfs_entry_s g_procfs_entries[] =
 #if defined(CONFIG_DEBUG_TCBINFO) && !defined(CONFIG_FS_PROCFS_EXCLUDE_TCBINFO)
   { "tcbinfo",       &tcbinfo_operations,         PROCFS_FILE_TYPE   },
 #endif
+  { NULL,            NULL,                        PROCFS_UNKOWN_TYPE },
 };
 
 #ifdef CONFIG_FS_PROCFS_REGISTER
 static const uint8_t g_base_entrycount = sizeof(g_base_entries) /

Review Comment:
   Adding NULL entry avoid the out of boundary error:
   ```
   procfs/fs_procfs.c: In function 'procfs_readdir':
   Error: procfs/fs_procfs.c:878:35: error: array subscript <unknown> is outside array bounds of 'const struct procfs_entry_s[0]' [-Werror=array-bounds]
     878 |       if (strncmp(g_procfs_entries[level1->base.index].pathpattern,
   ```
   Many place verify the index in the range, the code has to recompute every time without `g_base_entrycount`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r996381986


##########
fs/procfs/Kconfig:
##########
@@ -31,15 +31,15 @@ menu "Exclude individual procfs entries"
 
 config FS_PROCFS_EXCLUDE_PROCESS
 	bool "Exclude process information"
-	default n
+	default DEFAULT_SMALL

Review Comment:
   But, I think `default DEFAULT_SMALL` is more clear and simple than `default y if DEFAULT_SMALL`. For example, people may ask question what's default value if DEFAULT_SMALL disable?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] masayuki2009 merged pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
masayuki2009 merged PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] masayuki2009 commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r997589673


##########
fs/procfs/fs_procfs.c:
##########
@@ -858,14 +843,16 @@ static int procfs_readdir(FAR struct inode *mountpt,
        * subdirectory are listed in order in the procfs_entry array.
        */
 
-      if (strncmp(g_procfs_entries[level1->base.index].pathpattern,
+      if (level1->base.index < g_procfs_entrycount &&
+          level1->firstindex < g_procfs_entrycount &&
+          strncmp(g_procfs_entries[level1->base.index].pathpattern,
                   g_procfs_entries[level1->firstindex].pathpattern,
                   level1->subdirlen) == 0)
         {
           /* This entry matches.  Report the subdir entry */
 
-          name = &g_procfs_entries[level1->base.index].pathpattern[
-                    level1->subdirlen + 1];
+          name = &g_procfs_entries[level1->base.index].
+                    pathpattern[level1->subdirlen + 1];

Review Comment:
   @xiaoxiang781216 
   I think this is a style change, so it would be better to merge the change into the first commit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] acassis commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
acassis commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r996433969


##########
fs/procfs/Kconfig:
##########
@@ -31,15 +31,15 @@ menu "Exclude individual procfs entries"
 
 config FS_PROCFS_EXCLUDE_PROCESS
 	bool "Exclude process information"
-	default n
+	default DEFAULT_SMALL

Review Comment:
   I think the opposite, ```default DEFAULT_SMALL``` give the impression that it is setting DEFAULT_SMALL. The ```default n``` is implicit when DEFAULT_SMALL is not enabled.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r996441187


##########
fs/procfs/fs_procfs.c:
##########
@@ -186,25 +176,21 @@ static const struct procfs_entry_s g_procfs_entries[] =
 #endif
 };
 
-#ifdef CONFIG_FS_PROCFS_REGISTER
 static const uint8_t g_base_entrycount = sizeof(g_base_entries) /
                                          sizeof(struct procfs_entry_s);
 
+#ifdef CONFIG_FS_PROCFS_REGISTER
 static FAR struct procfs_entry_s *g_procfs_entries;
 static uint8_t g_procfs_entrycount;
 #else
-static const uint8_t g_procfs_entrycount = sizeof(g_procfs_entries) /
-                                           sizeof(struct procfs_entry_s);
+static FAR const struct procfs_entry_s *g_procfs_entries = g_base_entries;

Review Comment:
   Maybe we can use `define` and not introduce new variable?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r996467030


##########
fs/procfs/fs_procfs.c:
##########
@@ -1025,7 +989,7 @@ static int procfs_statfs(struct inode *mountpt, struct statfs *buf)
 static int procfs_stat(struct inode *mountpt, const char *relpath,
                        struct stat *buf)

Review Comment:
   ditto
   ```suggestion
   static int procfs_stat(FAR struct inode *mountpt, FAR const char *relpath,
                          FAR struct stat *buf)
   ```



##########
fs/procfs/fs_procfs.c:
##########
@@ -375,15 +363,14 @@ static int procfs_open(FAR struct file *filep, FAR const char *relpath,
           /* Match found!  Stat using this procfs entry */
 
           DEBUGASSERT(g_procfs_entries[x].ops &&
-              g_procfs_entries[x].ops->open);
+                      g_procfs_entries[x].ops->open);
 
           ret = g_procfs_entries[x].ops->open(filep, relpath, oflags, mode);
-
           if (ret == OK)
             {
               DEBUGASSERT(filep->f_priv);
 
-              ((struct procfs_file_s *) filep->f_priv)->procfsentry =
+              ((struct procfs_file_s *)filep->f_priv)->procfsentry =

Review Comment:
   Note for one of next PRs.
   ```suggestion
                 ((FAR struct procfs_file_s *)filep->f_priv)->procfsentry =
   ```



##########
fs/procfs/fs_procfs.c:
##########
@@ -947,7 +911,7 @@ static int procfs_rewinddir(struct inode *mountpt, struct fs_dirent_s *dir)
 
   if (priv->level > 0 && priv->procfsentry == NULL)
     {
-      priv->index = ((struct procfs_level1_s *) priv)->firstindex;
+      priv->index = ((struct procfs_level1_s *)priv)->firstindex;

Review Comment:
   ditto
   ```suggestion
         priv->index = ((FAR struct procfs_level1_s *)priv)->firstindex;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#issuecomment-1280613569

   @xiaoxiang781216 
   I think most of the changes in the first commit relate to style changes. 
   So it would be better to separate the commit to style changes and fix warnings.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] acassis commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
acassis commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r996350720


##########
fs/procfs/Kconfig:
##########
@@ -31,15 +31,15 @@ menu "Exclude individual procfs entries"
 
 config FS_PROCFS_EXCLUDE_PROCESS
 	bool "Exclude process information"
-	default n
+	default DEFAULT_SMALL

Review Comment:
   Hi @xiaoxiang781216 I saw that sched/Kconfig and fs/Kconfig has this already, but I suggest using "default y DEFAULT_SMALL" for legibility. I will submit a patch to fix sched and fs



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r996455791


##########
fs/procfs/fs_procfs.c:
##########
@@ -186,25 +176,21 @@ static const struct procfs_entry_s g_procfs_entries[] =
 #endif
 };
 
-#ifdef CONFIG_FS_PROCFS_REGISTER
 static const uint8_t g_base_entrycount = sizeof(g_base_entries) /
                                          sizeof(struct procfs_entry_s);
 
+#ifdef CONFIG_FS_PROCFS_REGISTER
 static FAR struct procfs_entry_s *g_procfs_entries;
 static uint8_t g_procfs_entrycount;
 #else
-static const uint8_t g_procfs_entrycount = sizeof(g_procfs_entries) /
-                                           sizeof(struct procfs_entry_s);
+static FAR const struct procfs_entry_s *g_procfs_entries = g_base_entries;

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#issuecomment-1280034150

   @acassis @pkarashchenko done.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r996381986


##########
fs/procfs/Kconfig:
##########
@@ -31,15 +31,15 @@ menu "Exclude individual procfs entries"
 
 config FS_PROCFS_EXCLUDE_PROCESS
 	bool "Exclude process information"
-	default n
+	default DEFAULT_SMALL

Review Comment:
   But, I think `default DEFAULT_SMALL` is more clear than `default y if DEFAULT_SMALL`. For example, what's default value if DEFAULT_SMALL disable?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r997644483


##########
fs/procfs/fs_procfs.c:
##########
@@ -858,14 +843,16 @@ static int procfs_readdir(FAR struct inode *mountpt,
        * subdirectory are listed in order in the procfs_entry array.
        */
 
-      if (strncmp(g_procfs_entries[level1->base.index].pathpattern,
+      if (level1->base.index < g_procfs_entrycount &&
+          level1->firstindex < g_procfs_entrycount &&
+          strncmp(g_procfs_entries[level1->base.index].pathpattern,
                   g_procfs_entries[level1->firstindex].pathpattern,
                   level1->subdirlen) == 0)
         {
           /* This entry matches.  Report the subdir entry */
 
-          name = &g_procfs_entries[level1->base.index].pathpattern[
-                    level1->subdirlen + 1];
+          name = &g_procfs_entries[level1->base.index].
+                    pathpattern[level1->subdirlen + 1];

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r996436090


##########
fs/procfs/fs_procfs.c:
##########
@@ -184,27 +184,24 @@ static const struct procfs_entry_s g_procfs_entries[] =
 #if defined(CONFIG_DEBUG_TCBINFO) && !defined(CONFIG_FS_PROCFS_EXCLUDE_TCBINFO)
   { "tcbinfo",       &tcbinfo_operations,         PROCFS_FILE_TYPE   },
 #endif
+  { NULL,            NULL,                        PROCFS_UNKOWN_TYPE },
 };
 
 #ifdef CONFIG_FS_PROCFS_REGISTER
 static const uint8_t g_base_entrycount = sizeof(g_base_entries) /

Review Comment:
   Now we have a similar error, but at line 740



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r996381986


##########
fs/procfs/Kconfig:
##########
@@ -31,15 +31,15 @@ menu "Exclude individual procfs entries"
 
 config FS_PROCFS_EXCLUDE_PROCESS
 	bool "Exclude process information"
-	default n
+	default DEFAULT_SMALL

Review Comment:
   But, I think `default DEFAULT_SMALL` is more clear and simple than `default y if DEFAULT_SMALL`. For example, what's default value if DEFAULT_SMALL disable?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#issuecomment-1280321094

   > @xiaoxiang781216
   > 
   > Hmm, ps command not found with `hifive1-revb:nsh`
   > 
   > ```
   > NuttShell (NSH) NuttX-3.6.1
   > nsh> uname -a
   > NuttX 3.6.1 25df009f87 Oct 17 2022 11:55:14 risc-v hifive1-revb
   > nsh> help
   > help usage:  help [-v] [<cmd>]
   > 
   >   ?       cat     echo    help    kill    ls      mount   sleep   uname   usleep
   > 
   > Builtin Apps:
   >   buttons   sh        getprime  hello     nsh
   > nsh> ps
   > nsh: ps: command not found
   > nsh> Traceback (most recent call last):
   > ```
   
   @masayuki2009 this is because the default value is changed when DEFAULT_SMALL is enabled. I have update all defconfig which enable DEFAULT_SMALL to keep the expanded result same as before. Please try again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r996433261


##########
fs/procfs/fs_procfs.c:
##########
@@ -184,27 +184,24 @@ static const struct procfs_entry_s g_procfs_entries[] =
 #if defined(CONFIG_DEBUG_TCBINFO) && !defined(CONFIG_FS_PROCFS_EXCLUDE_TCBINFO)
   { "tcbinfo",       &tcbinfo_operations,         PROCFS_FILE_TYPE   },
 #endif
+  { NULL,            NULL,                        PROCFS_UNKOWN_TYPE },
 };
 
 #ifdef CONFIG_FS_PROCFS_REGISTER
 static const uint8_t g_base_entrycount = sizeof(g_base_entries) /

Review Comment:
   Adding NULL entry avoid the out of boundary error:
   ```
   procfs/fs_procfs.c: In function 'procfs_readdir':
   Error: procfs/fs_procfs.c:878:35: error: array subscript <unknown> is outside array bounds of 'const struct procfs_entry_s[0]' [-Werror=array-bounds]
     878 |       if (strncmp(g_procfs_entries[level1->base.index].pathpattern,
   ```
   Many place verify the index in the range, the code has to recompute the count every time if we remove `g_base_entrycount`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org