From ad3e6d889854f646fcfb1abc618d5fa3e1140b4e Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Fri, 7 Aug 2020 08:51:22 +0800 Subject: [PATCH] [DFS] clean the unnecessary checking --- components/dfs/src/dfs_fs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c index 476e47fc06..c21b914727 100644 --- a/components/dfs/src/dfs_fs.c +++ b/components/dfs/src/dfs_fs.c @@ -129,7 +129,7 @@ const char *dfs_filesystem_get_mounted_path(struct rt_device *device) for (iter = &filesystem_table[0]; iter < &filesystem_table[DFS_FILESYSTEMS_MAX]; iter++) { - /* fint the mounted device */ + /* find the mounted device */ if (iter->ops == NULL) continue; else if (iter->dev_id == device) { @@ -321,7 +321,7 @@ int dfs_mount(const char *device_name, if (rt_device_open(fs->dev_id, RT_DEVICE_OFLAG_RDWR) != RT_EOK) { - /* The underlaying device has error, clear the entry. */ + /* The underlying device has error, clear the entry. */ dfs_lock(); memset(fs, 0, sizeof(struct dfs_filesystem)); @@ -568,8 +568,7 @@ int dfs_unmount_device(rt_device_t dev) iter < &filesystem_table[DFS_FILESYSTEMS_MAX]; iter++) { /* check if the PATH is mounted */ - if ((iter->dev_id->parent.name != NULL) - && (strcmp(iter->dev_id->parent.name, dev->parent.name) == 0)) + if (strcmp(iter->dev_id->parent.name, dev->parent.name) == 0) { fs = iter; break; -- GitLab