diff options
| author | Amlal <amlal@nekernel.org> | 2025-04-25 13:28:08 +0200 |
|---|---|---|
| committer | Amlal <amlal@nekernel.org> | 2025-04-25 13:28:08 +0200 |
| commit | 1c8414d3348c55fcf132839a04fdedec5efaacbe (patch) | |
| tree | 5c7386fae0504a798801e0b34b588f4177ba67c1 /src/coreboot-partition-map.c | |
| parent | d7e35959ebb6b1dd892a99f23c2a7f23c0f99041 (diff) | |
dev: refactor codebase.
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'src/coreboot-partition-map.c')
| -rw-r--r-- | src/coreboot-partition-map.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/src/coreboot-partition-map.c b/src/coreboot-partition-map.c index 69bcddd..f5d937b 100644 --- a/src/coreboot-partition-map.c +++ b/src/coreboot-partition-map.c @@ -1,6 +1,6 @@ /* ------------------------------------------- - Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved. + Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved. ------------------------------------------- */ @@ -10,28 +10,21 @@ // include this for documentation. #define CB_FILESYSTEM_COUNT 4 -#define CB_FILESYSTEM_LIST \ - { \ - "NeFS", "HeFS", "FAT32", "ext4" \ - } +#define CB_FILESYSTEM_LIST \ + { "NeFS", "HeFS", "FAT32", "ext4" } /// @brief check if filesystem is supported by CoreBoot. /// @param fs the filesystem magic, as provided by EPM. -boolean cb_filesystem_exists(caddr_t fs, size_t len) -{ - if (fs == nil || - *fs == 0) - return no; - - char* fs_list[] = CB_FILESYSTEM_LIST; - - for (size_t fs_index = 0; fs_index < CB_FILESYSTEM_COUNT; fs_index++) - { - if (strncmp(fs_list[fs_index], fs, strlen(fs_list[fs_index])) == 0) - { - return yes; - } - } - - return no; +boolean cb_filesystem_exists(caddr_t fs, size_t len) { + if (fs == nil || *fs == 0) return no; + + char* fs_list[] = CB_FILESYSTEM_LIST; + + for (size_t fs_index = 0; fs_index < CB_FILESYSTEM_COUNT; fs_index++) { + if (strncmp(fs_list[fs_index], fs, strlen(fs_list[fs_index])) == 0) { + return yes; + } + } + + return no; } |
