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/08/07 14:55:05 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6803: fs/directory: Using file api to implement operations on directories

xiaoxiang781216 commented on code in PR #6803:
URL: https://github.com/apache/incubator-nuttx/pull/6803#discussion_r939679035


##########
arch/arm/src/cxd56xx/cxd56_powermgr_procfs.c:
##########
@@ -781,7 +783,7 @@ static int cxd56_powermgr_procfs_readdir(struct fs_dirent_s *dir)
  *
  ****************************************************************************/
 
-static int cxd56_powermgr_procfs_rewinddir(struct fs_dirent_s *dir)
+static int cxd56_powermgr_procfs_rewinddir(FAR struct fs_dirent_s *dir)

Review Comment:
   remove FAR



##########
arch/arm/src/cxd56xx/cxd56_powermgr_procfs.c:
##########
@@ -749,7 +750,8 @@ static int cxd56_powermgr_procfs_closedir(struct fs_dirent_s *dir)
  *
  ****************************************************************************/
 
-static int cxd56_powermgr_procfs_readdir(struct fs_dirent_s *dir)
+static int cxd56_powermgr_procfs_readdir(FAR struct fs_dirent_s *dir,
+                                         FAR struct dirent *entry)

Review Comment:
   remove FAR from both



##########
arch/arm/src/cxd56xx/cxd56_powermgr_procfs.c:
##########
@@ -711,7 +710,7 @@ static int cxd56_powermgr_procfs_opendir(const char *relpath,
     }
 
   procfs->index = 0;
-  dir->u.procfs = (void *)procfs;
+  *dir = (FAR struct fs_dirent_s *)procfs;

Review Comment:
   remove FAR



##########
arch/arm/src/cxd56xx/cxd56_powermgr_procfs.c:
##########
@@ -787,9 +777,9 @@ static int cxd56_powermgr_procfs_rewinddir(FAR struct fs_dirent_s *dir)
 {
   struct cxd56_powermgr_procfs_dir_s *procfs;
 
-  DEBUGASSERT(dir && dir->u.procfs);
+  DEBUGASSERT(dir);
 
-  procfs = (struct cxd56_powermgr_procfs_dir_s *)dir->u.procfs;
+  procfs = (FAR struct cxd56_powermgr_procfs_dir_s *)dir;

Review Comment:
   ditto



##########
arch/arm/src/cxd56xx/cxd56_powermgr_procfs.c:
##########
@@ -755,9 +745,9 @@ static int cxd56_powermgr_procfs_readdir(FAR struct fs_dirent_s *dir,
 {
   struct cxd56_powermgr_procfs_dir_s *procfs;
 
-  DEBUGASSERT(dir && dir->u.procfs);
+  DEBUGASSERT(dir);
 
-  procfs = (struct cxd56_powermgr_procfs_dir_s *)dir->u.procfs;
+  procfs = (FAR struct cxd56_powermgr_procfs_dir_s *)dir;

Review Comment:
   remove FAR



-- 
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