fix build error on procfs
authorsunghan <sh924.chang@samsung.com>
Fri, 31 Mar 2017 07:16:04 +0000 (16:16 +0900)
committersunghan <sh924.chang@samsung.com>
Fri, 31 Mar 2017 07:16:04 +0000 (16:16 +0900)
Some variables are only used when CONFIG_FS_PROCFS_EXCLUDE_PROCESS is disabled.
procfs/fs_procfs.c: In function 'procfs_opendir':
procfs/fs_procfs.c:439:13: error: unused variable 'flags' [-Werror=unused-variable]
  irqstate_t flags;
             ^
procfs/fs_procfs.c: In function 'procfs_readdir':
procfs/fs_procfs.c:590:8: error: unused variable 'pid' [-Werror=unused-variable]
  pid_t pid;
        ^
procfs/fs_procfs.c:589:13: error: unused variable 'flags' [-Werror=unused-variable]
  irqstate_t flags;
             ^
procfs/fs_procfs.c:586:20: error: unused variable 'tcb' [-Werror=unused-variable]
  FAR struct tcb_s *tcb;

os/fs/procfs/fs_procfs.c

index f5bb604..cd09c4e 100644 (file)
@@ -436,7 +436,9 @@ static int procfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, FA
        FAR struct procfs_level0_s *level0;
        FAR struct procfs_dir_priv_s *dirpriv;
        FAR void *priv = NULL;
+#ifndef CONFIG_FS_PROCFS_EXCLUDE_PROCESS
        irqstate_t flags;
+#endif
 
        fvdbg("relpath: \"%s\"\n", relpath ? relpath : "NULL");
        DEBUGASSERT(mountpt && relpath && dir && !dir->u.procfs);
@@ -583,11 +585,13 @@ static int procfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir)
 {
        FAR struct procfs_dir_priv_s *priv;
        FAR struct procfs_level0_s *level0;
-       FAR struct tcb_s *tcb;
        FAR const char *name = NULL;
        unsigned int index;
+#ifndef CONFIG_FS_PROCFS_EXCLUDE_PROCESS
+       FAR struct tcb_s *tcb;
        irqstate_t flags;
        pid_t pid;
+#endif
        int ret = -ENOENT;
 
        DEBUGASSERT(mountpt && dir && dir->u.procfs);