diff options
| author | tangyuxin <[email protected]> | 2019-04-03 18:09:52 +0800 |
|---|---|---|
| committer | tangyuxin <[email protected]> | 2019-04-08 14:51:01 +0800 |
| commit | e71ec65549db94a88fac1ba7a1f110d8667fd528 (patch) | |
| tree | bf37ded5b3ede720d4de17cfee444a13466596b6 /components/dfs/filesystems/devfs/devfs.c | |
| parent | 583f8c307329d09b236b2aa11c7a9b13a88d4654 (diff) | |
[components][dfs]格式化代码
Diffstat (limited to 'components/dfs/filesystems/devfs/devfs.c')
| -rw-r--r-- | components/dfs/filesystems/devfs/devfs.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/components/dfs/filesystems/devfs/devfs.c b/components/dfs/filesystems/devfs/devfs.c index 3080312874..936b074ce1 100644 --- a/components/dfs/filesystems/devfs/devfs.c +++ b/components/dfs/filesystems/devfs/devfs.c @@ -97,7 +97,7 @@ int dfs_device_fs_close(struct dfs_fd *file) root_dirent = (struct device_dirent *)file->data; RT_ASSERT(root_dirent != RT_NULL); - + /* release dirent */ rt_free(root_dirent); return RT_EOK; @@ -133,7 +133,7 @@ int dfs_device_fs_open(struct dfs_fd *file) struct rt_object_information *information; struct device_dirent *root_dirent; rt_uint32_t count = 0; - + /* lock scheduler */ rt_enter_critical(); @@ -145,8 +145,8 @@ int dfs_device_fs_open(struct dfs_fd *file) count ++; } - root_dirent = (struct device_dirent *)rt_malloc(sizeof(struct device_dirent) + - count * sizeof(rt_device_t)); + root_dirent = (struct device_dirent *)rt_malloc(sizeof(struct device_dirent) + + count * sizeof(rt_device_t)); if (root_dirent != RT_NULL) { root_dirent->devices = (rt_device_t *)(root_dirent + 1); @@ -165,7 +165,7 @@ int dfs_device_fs_open(struct dfs_fd *file) /* set data */ file->data = root_dirent; - + return RT_EOK; } @@ -178,7 +178,7 @@ int dfs_device_fs_open(struct dfs_fd *file) { /* use device fops */ file->fops = device->fops; - file->data = (void*)device; + file->data = (void *)device; /* use fops */ if (file->fops->open) @@ -214,7 +214,7 @@ int dfs_device_fs_stat(struct dfs_filesystem *fs, const char *path, struct stat st->st_dev = 0; st->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH | - S_IWUSR | S_IWGRP | S_IWOTH; + S_IWUSR | S_IWGRP | S_IWOTH; st->st_mode &= ~S_IFREG; st->st_mode |= S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH; @@ -233,7 +233,7 @@ int dfs_device_fs_stat(struct dfs_filesystem *fs, const char *path, struct stat st->st_dev = 0; st->st_mode = S_IRUSR | S_IRGRP | S_IROTH | - S_IWUSR | S_IWGRP | S_IWOTH; + S_IWUSR | S_IWGRP | S_IWOTH; if (dev_id->type == RT_Device_Class_Char) st->st_mode |= S_IFCHR; @@ -293,7 +293,7 @@ static int dfs_device_fs_poll(struct dfs_fd *fd, struct rt_pollreq *req) return mask; } -static const struct dfs_file_ops _device_fops = +static const struct dfs_file_ops _device_fops = { dfs_device_fs_open, dfs_device_fs_close, @@ -306,7 +306,7 @@ static const struct dfs_file_ops _device_fops = dfs_device_fs_poll, }; -static const struct dfs_filesystem_ops _device_fs = +static const struct dfs_filesystem_ops _device_fs = { "devfs", DFS_FS_FLAG_DEFAULT, |
