apache-mynewt-bot commented on pull request #2522:
URL: https://github.com/apache/mynewt-core/pull/2522#issuecomment-796759482


   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### fs/littlefs/src/mynewt_glue.c
   <details>
   
   ```diff
   @@ -38,10 +38,10 @@
    #endif
    
    static int littlefs_open(const char *path, uint8_t access_flags,
   -  struct fs_file **out_file);
   +                         struct fs_file **out_file);
    static int littlefs_close(struct fs_file *fs_file);
    static int littlefs_read(struct fs_file *fs_file, uint32_t len, void 
*out_data,
   -  uint32_t *out_len);
   +                         uint32_t *out_len);
    static int littlefs_write(struct fs_file *fs_file, const void *data, int 
len);
    static int littlefs_flush(struct fs_file *fs_file);
    static int littlefs_seek(struct fs_file *fs_file, uint32_t offset);
   @@ -54,7 +54,7 @@
    static int littlefs_readdir(struct fs_dir *dir, struct fs_dirent 
**out_dirent);
    static int littlefs_closedir(struct fs_dir *dir);
    static int littlefs_dirent_name(const struct fs_dirent *fs_dirent, size_t 
max_len,
   -  char *out_name, uint8_t *out_name_len);
   +                                char *out_name, uint8_t *out_name_len);
    static int littlefs_dirent_is_dir(const struct fs_dirent *fs_dirent);
    
    struct littlefs_file {
   @@ -100,7 +100,8 @@
        .f_name = "littlefs"
    };
    
   -int littlefs_to_vfs_error(int err)
   +int
   +littlefs_to_vfs_error(int err)
    {
        int rc = FS_EOS;
    
   @@ -222,7 +223,7 @@
    static lfs_t *g_lfs = NULL;
    static bool g_lfs_alloc_done = false;
    
   -#define MIN(a, b) (((a)<(b))?(a):(b))
   +#define MIN(a, b) (((a) < (b)) ? (a) : (b))
    
    #define READ_SIZE (MYNEWT_VAL(MCU_FLASH_MIN_WRITE_SIZE) * 2)
    static uint8_t read_buffer[READ_SIZE];
   @@ -233,10 +234,10 @@
    static struct lfs_config g_lfs_cfg = {
        .context = NULL,
    
   -    .read  = flash_read,
   -    .prog  = flash_prog,
   +    .read = flash_read,
   +    .prog = flash_prog,
        .erase = flash_erase,
   -    .sync  = flash_sync,
   +    .sync = flash_sync,
    
        /* block device configuration */
        .read_size = READ_SIZE,
   @@ -340,8 +341,12 @@
    
    out:
        if (rc != FS_EOK) {
   -        if (file) free(file);
   -        if (out_file) free(out_file);
   +        if (file) {
   +            free(file);
   +        }
   +        if (out_file) {
   +            free(out_file);
   +        }
        }
        return rc;
    }
   @@ -453,7 +458,7 @@
    
    static int
    littlefs_read(struct fs_file *fs_file, uint32_t len, void *out_data,
   -           uint32_t *out_len)
   +              uint32_t *out_len)
    {
        lfs_file_t *file;
        lfs_t *lfs;
   @@ -531,7 +536,7 @@
        }
    
        littlefs_lock();
   -    rc= lfs_remove(g_lfs, path);
   +    rc = lfs_remove(g_lfs, path);
        littlefs_unlock();
    
        return littlefs_to_vfs_error(rc);
   @@ -611,8 +616,12 @@
    
    out:
        if (rc != FS_EOK) {
   -        if (dir) free(dir);
   -        if (out_dir) free(out_dir);
   +        if (dir) {
   +            free(dir);
   +        }
   +        if (out_dir) {
   +            free(out_dir);
   +        }
        }
        return rc;
    }
   @@ -684,7 +693,7 @@
    
    static int
    littlefs_dirent_name(const struct fs_dirent *fs_dirent, size_t max_len,
   -                  char *out_name, uint8_t *out_name_len)
   +                     char *out_name, uint8_t *out_name_len)
    {
    
        struct lfs_info *info;
   ```
   
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to