From 312eb0c412de72519c8819bf03a7cf831568ebc1 Mon Sep 17 00:00:00 2001 From: xqyjlj Date: Wed, 1 Feb 2023 11:30:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=88=20style(components/dfs/filesystems?= =?UTF-8?q?/tmpfs/dfs=5Ftmpfs.c):=20fix=20style?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/filesystems/tmpfs/dfs_tmpfs.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/components/dfs/filesystems/tmpfs/dfs_tmpfs.c b/components/dfs/filesystems/tmpfs/dfs_tmpfs.c index b52b27cb73..d7bc27731b 100644 --- a/components/dfs/filesystems/tmpfs/dfs_tmpfs.c +++ b/components/dfs/filesystems/tmpfs/dfs_tmpfs.c @@ -383,7 +383,8 @@ int dfs_tmpfs_open(struct dfs_fd *file) /* Creates a new file. */ if (file->flags & O_CREAT) { - if (d_file == NULL) { + if (d_file == NULL) + { /* find parent file */ _path_separate(file->vnode->path, parent_path, file_name); if (file_name[0] == '\0') /* it's root dir */ @@ -396,7 +397,8 @@ int dfs_tmpfs_open(struct dfs_fd *file) /* create a file entry */ d_file = (struct tmpfs_file *)rt_calloc(1, sizeof(struct tmpfs_file)); - if (d_file == NULL) { + if (d_file == NULL) + { return -ENOMEM; } superblock->df_size += sizeof(struct tmpfs_file); @@ -408,10 +410,12 @@ int dfs_tmpfs_open(struct dfs_fd *file) d_file->data = NULL; d_file->size = 0; d_file->sb = superblock; - if (file->flags & O_DIRECTORY) { + if (file->flags & O_DIRECTORY) + { d_file->type = TMPFS_TYPE_DIR; } - else { + else + { d_file->type = TMPFS_TYPE_FILE; } rt_hw_spin_lock(&lock); -- GitLab