]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fs: fat: eliminate DIRENTSPERBLOCK() macro
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 25 Dec 2020 13:30:04 +0000 (14:30 +0100)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 31 Dec 2020 13:32:02 +0000 (14:32 +0100)
The FAT filesystem implementation uses several marcros referring to a magic
variable name mydata which renders the code less readable. Eliminate one of
them which is only used for a debug() statement.

Use log_debug() instead of debug().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
fs/fat/fat.c
include/fat.h

index 47344bb57e00b12ce0ec0cd6ee0674391499fbe4..c9742d534bbc4deb944b219040e6eab79e9cedaa 100644 (file)
@@ -810,7 +810,6 @@ static void fat_itr_child(fat_itr *itr, fat_itr *parent)
  */
 void *fat_next_cluster(fat_itr *itr, unsigned int *nbytes)
 {
-       fsdata *mydata = itr->fsdata;  /* for silly macros */
        int ret;
        u32 sect;
        u32 read_size;
@@ -838,8 +837,8 @@ void *fat_next_cluster(fat_itr *itr, unsigned int *nbytes)
                read_size = itr->fsdata->clust_size;
        }
 
-       debug("FAT read(sect=%d), clust_size=%d, read_size=%u, DIRENTSPERBLOCK=%zd\n",
-             sect, itr->fsdata->clust_size, read_size, DIRENTSPERBLOCK);
+       log_debug("FAT read(sect=%d), clust_size=%d, read_size=%u\n",
+                 sect, itr->fsdata->clust_size, read_size);
 
        /*
         * NOTE: do_fat_read_at() had complicated logic to deal w/
index 3c29a4484d419e26ed04baf0538bfd9a64192bfe..8cae283030f8b33e01ca00c1a2c118e0616b80a8 100644 (file)
@@ -22,7 +22,6 @@ struct disk_partition;
 
 #define MAX_CLUSTSIZE  CONFIG_FS_FAT_MAX_CLUSTSIZE
 
-#define DIRENTSPERBLOCK        (mydata->sect_size / sizeof(dir_entry))
 #define DIRENTSPERCLUST        ((mydata->clust_size * mydata->sect_size) / \
                         sizeof(dir_entry))