From 00e76375488e13cecd1ed18746490e559caf4af4 Mon Sep 17 00:00:00 2001 From: James Archer Date: Wed, 9 Oct 2024 16:51:36 +1100 Subject: [PATCH 1/2] fat: fix array type Signed-off-by: James Archer --- components/fs/fat/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/fs/fat/event.c b/components/fs/fat/event.c index 339c5089..c443ab8f 100644 --- a/components/fs/fat/event.c +++ b/components/fs/fat/event.c @@ -69,7 +69,7 @@ typedef struct FS_request{ } fs_request; // This operations list must be consistent with the file system protocol enum -void (*operation_functions[])() = { +void (*operation_functions[])(void) = { fat_mount, fat_unmount, fat_open, From 691afdf91358aeac71009fb7d31ef481358f47cd Mon Sep 17 00:00:00 2001 From: James Archer Date: Wed, 9 Oct 2024 16:52:40 +1100 Subject: [PATCH 2/2] fat: make operation table more explicit Signed-off-by: James Archer --- components/fs/fat/event.c | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/components/fs/fat/event.c b/components/fs/fat/event.c index c443ab8f..b951e205 100644 --- a/components/fs/fat/event.c +++ b/components/fs/fat/event.c @@ -70,26 +70,26 @@ typedef struct FS_request{ // This operations list must be consistent with the file system protocol enum void (*operation_functions[])(void) = { - fat_mount, - fat_unmount, - fat_open, - fat_close, - fat_stat, - fat_pread, - fat_pwrite, - fat_fsize, - fat_rename, - fat_unlink, - fat_truncate, - fat_mkdir, - fat_rmdir, - fat_opendir, - fat_closedir, - fat_sync, - fat_readdir, - fat_seekdir, - fat_telldir, - fat_rewinddir, + [FS_CMD_INITIALISE] = fat_mount, + [FS_CMD_DEINITIALISE] = fat_unmount, + [FS_CMD_OPEN] = fat_open, + [FS_CMD_CLOSE] = fat_close, + [FS_CMD_STAT] = fat_stat, + [FS_CMD_READ] = fat_pread, + [FS_CMD_WRITE] = fat_pwrite, + [FS_CMD_FSIZE] = fat_fsize, + [FS_CMD_RENAME] = fat_rename, + [FS_CMD_UNLINK] = fat_unlink, + [FS_CMD_TRUNCATE] = fat_truncate, + [FS_CMD_MKDIR] = fat_mkdir, + [FS_CMD_RMDIR] = fat_rmdir, + [FS_CMD_OPENDIR] = fat_opendir, + [FS_CMD_CLOSEDIR] = fat_closedir, + [FS_CMD_FSYNC] = fat_sync, + [FS_CMD_READDIR] = fat_readdir, + [FS_CMD_SEEKDIR] = fat_seekdir, + [FS_CMD_TELLDIR] = fat_telldir, + [FS_CMD_REWINDDIR] = fat_rewinddir, }; static fs_request request_pool[FAT_THREAD_NUM];