Code format - parameter ordering & remove redundant braces
authorgkostka <kostka.grzegorz@gmail.com>
Sun, 28 Jun 2015 06:49:23 +0000 (08:49 +0200)
committergkostka <kostka.grzegorz@gmail.com>
Sun, 28 Jun 2015 06:49:23 +0000 (08:49 +0200)
lwext4/ext4.c

index 38706a211b89a2ec8bcffc9bf7eeac63b7983ecc..d3b71357db81aba499fd17efb8d74d75f6b77eff 100644 (file)
@@ -286,7 +286,7 @@ static int ext4_unlink(struct ext4_mountpoint *mp,
 int ext4_mount(const char *dev_name, const char *mount_point)\r
 {\r
     ext4_assert(mount_point && dev_name);\r
-    int r = EOK;\r
+    int r;\r
     int i;\r
 \r
     uint32_t bsize;\r
@@ -318,9 +318,8 @@ int ext4_mount(const char *dev_name, const char *mount_point)
             break;\r
         }\r
 \r
-        if (!strcmp(_mp[i].name, mount_point)) {\r
+        if (!strcmp(_mp[i].name, mount_point))\r
             return EOK;\r
-        }\r
     }\r
 \r
     if (!mp)\r
@@ -374,7 +373,7 @@ int ext4_mount(const char *dev_name, const char *mount_point)
 int ext4_umount(const char *mount_point)\r
 {\r
     int i;\r
-    int r = EOK;\r
+    int r;\r
     struct ext4_mountpoint *mp = 0;\r
 \r
     for (i = 0; i < CONFIG_EXT4_MOUNTPOINTS_COUNT; ++i) {\r
@@ -535,14 +534,15 @@ static int ext4_generic_open(ext4_file *f, const char *path, const char *flags,
                              bool file_expect, uint32_t *parent_inode,\r
                              uint32_t *name_off)\r
 {\r
-    struct ext4_mountpoint *mp = ext4_get_mount(path);\r
-    struct ext4_directory_search_result result;\r
-    struct ext4_inode_ref ref;\r
     bool is_goal = false;\r
     uint8_t inode_type = EXT4_DIRECTORY_FILETYPE_DIR;\r
-    int r = ENOENT;\r
     uint32_t next_inode;\r
 \r
+    int r;\r
+    struct ext4_mountpoint *mp = ext4_get_mount(path);\r
+    struct ext4_directory_search_result result;\r
+    struct ext4_inode_ref ref;\r
+\r
     f->mp = 0;\r
 \r
     if (!mp)\r
@@ -709,13 +709,12 @@ int ext4_fremove(const char *path)
     ext4_file f;\r
     uint32_t parent_inode;\r
     uint32_t name_off;\r
+    bool is_goal;\r
     int r;\r
     int len;\r
-    bool is_goal;\r
-    struct ext4_mountpoint *mp = ext4_get_mount(path);\r
-\r
     struct ext4_inode_ref child;\r
     struct ext4_inode_ref parent;\r
+    struct ext4_mountpoint *mp = ext4_get_mount(path);\r
 \r
     if (!mp)\r
         return ENOENT;\r
@@ -801,17 +800,17 @@ int ext4_fclose(ext4_file *f)
 }\r
 int ext4_fread(ext4_file *f, void *buf, uint32_t size, uint32_t *rcnt)\r
 {\r
-    int r = EOK;\r
     uint32_t u;\r
     uint32_t fblock;\r
     uint32_t fblock_start;\r
     uint32_t fblock_cnt;\r
-    struct ext4_block b;\r
-    uint8_t *u8_buf = buf;\r
-    struct ext4_inode_ref ref;\r
     uint32_t sblock;\r
     uint32_t sblock_end;\r
     uint32_t block_size;\r
+    uint8_t *u8_buf = buf;\r
+    int r;\r
+    struct ext4_block b;\r
+    struct ext4_inode_ref ref;\r
 \r
     ext4_assert(f && f->mp);\r
 \r