Skip to content

Commit

Permalink
[all] Fix formatting to clang-format-16
Browse files Browse the repository at this point in the history
  • Loading branch information
nimelehin committed Apr 6, 2023
1 parent b55a51a commit 4d07954
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ jobs:
- name: Check
shell: bash
run: |
brew install clang-format
brew install clang-format@16
find ./ -iname '*.h' -o -iname '*.cpp' -o -iname '*.c' | xargs clang-format --dry-run --Werror
4 changes: 2 additions & 2 deletions boot/libboot/fs/ext2_lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ uint32_t _ext2_lite_get_offset_of_block(uint32_t block_index)
static uint8_t tmp_read_buf[8192];
void _ext2_lite_read(uint8_t* buf, uint32_t start, uint32_t len)
{
void (*read)(uint32_t sector, uint8_t * read_to) = active_drive_desc->read;
void (*read)(uint32_t sector, uint8_t* read_to) = active_drive_desc->read;
int already_read = 0;
while (len != 0) {
uint32_t sector = start / 512;
Expand Down Expand Up @@ -62,7 +62,7 @@ void _ext2_lite_read_inode(uint32_t inode_id, inode_t* inode)
int ext2_lite_init(drive_desc_t* drive_desc, fs_desc_t* fs_desc)
{
active_drive_desc = drive_desc;
void (*read)(uint32_t sector, uint8_t * read_to) = drive_desc->read;
void (*read)(uint32_t sector, uint8_t* read_to) = drive_desc->read;
_ext2_lite_read((uint8_t*)&superblock, SUPERBLOCK_START, SUPERBLOCK_LEN);

if (superblock.magic != 0xEF53) {
Expand Down
1 change: 0 additions & 1 deletion boot/x86/stage2/drivers/ata.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ typedef struct { // LBA28 | LBA48
void init_ata(uint32_t port, char is_master);
int indentify_ata_device(drive_desc_t* drive_desc);
int ata_read(uint32_t sector, uint8_t* read_to);
// extern uint16_t ata_read_to_ram(ata_t *dev, uint32_t sectorNum, uint32_t toRam, uint8_t offset);

#endif
14 changes: 7 additions & 7 deletions kernel/kernel/fs/ext2/ext2.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int ext2_rm(const path_t* path);

static void _ext2_read_from_dev(vfs_device_t* vfsdev, uint8_t* buf, uint32_t start, uint32_t len)
{
void (*read)(device_t * d, uint32_t s, uint8_t * r) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_READ);
void (*read)(device_t* d, uint32_t s, uint8_t* r) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_READ);
int already_read = 0;
uint32_t sector = start / 512;
uint32_t start_offset = start % 512;
Expand All @@ -138,8 +138,8 @@ static void _ext2_read_from_dev(vfs_device_t* vfsdev, uint8_t* buf, uint32_t sta

static void _ext2_write_to_dev(vfs_device_t* vfsdev, uint8_t* buf, uint32_t start, uint32_t len)
{
void (*read)(device_t * d, uint32_t s, uint8_t * r) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_READ);
void (*write)(device_t * d, uint32_t s, uint8_t * r, uint32_t siz) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_WRITE);
void (*read)(device_t* d, uint32_t s, uint8_t* r) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_READ);
void (*write)(device_t* d, uint32_t s, uint8_t* r, uint32_t siz) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_WRITE);
int already_written = 0;
uint32_t sector = start / 512;
uint32_t start_offset = start % 512;
Expand Down Expand Up @@ -171,7 +171,7 @@ static void _ext2_umem_copy_from_user(vfs_device_t* vfsdev, void* dest, const vo

static void _ext2_user_read_from_dev(vfs_device_t* vfsdev, void __user* buf, uint32_t start, uint32_t len)
{
void (*read)(device_t * d, uint32_t s, uint8_t * r) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_READ);
void (*read)(device_t* d, uint32_t s, uint8_t* r) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_READ);
int already_read = 0;
uint32_t sector = start / 512;
uint32_t start_offset = start % 512;
Expand All @@ -192,8 +192,8 @@ static void _ext2_user_read_from_dev(vfs_device_t* vfsdev, void __user* buf, uin

static void _ext2_user_write_to_dev(vfs_device_t* vfsdev, void __user* buf, uint32_t start, uint32_t len)
{
void (*read)(device_t * d, uint32_t s, uint8_t * r) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_READ);
void (*write)(device_t * d, uint32_t s, uint8_t * r, uint32_t siz) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_WRITE);
void (*read)(device_t* d, uint32_t s, uint8_t* r) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_READ);
void (*write)(device_t* d, uint32_t s, uint8_t* r, uint32_t siz) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_WRITE);
int already_written = 0;
uint32_t sector = start / 512;
uint32_t start_offset = start % 512;
Expand All @@ -216,7 +216,7 @@ static void _ext2_user_write_to_dev(vfs_device_t* vfsdev, void __user* buf, uint

static uint32_t _ext2_get_disk_size(vfs_device_t* vfsdev)
{
uint32_t (*get_size)(device_t * d) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_CAPACITY);
uint32_t (*get_size)(device_t* d) = devman_function_handler(vfsdev->dev, DRIVER_STORAGE_CAPACITY);
return get_size(vfsdev->dev);
}

Expand Down

0 comments on commit 4d07954

Please sign in to comment.