Skip to content

Commit dd687ff

Browse files
authored
Merge pull request #3806 from BernardXiong/code_cleanup
[DFS] clean the unnecessary checking
2 parents 37f60a3 + ad3e6d8 commit dd687ff

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

components/dfs/src/dfs_fs.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ const char *dfs_filesystem_get_mounted_path(struct rt_device *device)
129129
for (iter = &filesystem_table[0];
130130
iter < &filesystem_table[DFS_FILESYSTEMS_MAX]; iter++)
131131
{
132-
/* fint the mounted device */
132+
/* find the mounted device */
133133
if (iter->ops == NULL) continue;
134134
else if (iter->dev_id == device)
135135
{
@@ -321,7 +321,7 @@ int dfs_mount(const char *device_name,
321321
if (rt_device_open(fs->dev_id,
322322
RT_DEVICE_OFLAG_RDWR) != RT_EOK)
323323
{
324-
/* The underlaying device has error, clear the entry. */
324+
/* The underlying device has error, clear the entry. */
325325
dfs_lock();
326326
memset(fs, 0, sizeof(struct dfs_filesystem));
327327

@@ -568,8 +568,7 @@ int dfs_unmount_device(rt_device_t dev)
568568
iter < &filesystem_table[DFS_FILESYSTEMS_MAX]; iter++)
569569
{
570570
/* check if the PATH is mounted */
571-
if ((iter->dev_id->parent.name != NULL)
572-
&& (strcmp(iter->dev_id->parent.name, dev->parent.name) == 0))
571+
if (strcmp(iter->dev_id->parent.name, dev->parent.name) == 0)
573572
{
574573
fs = iter;
575574
break;

0 commit comments

Comments
 (0)