* [PATCH] fs: fat: eliminate DIRENTSPERBLOCK() macro
@ 2020-12-25 14:11 Heinrich Schuchardt
2020-12-29 3:32 ` Simon Glass
0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2020-12-25 14:11 UTC (permalink / raw)
To: u-boot
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>
---
Applicable to origin/next
---
fs/fat/fat.c | 5 ++---
include/fat.h | 1 -
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 3141c7191a..17afe99584 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -811,7 +811,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;
@@ -839,8 +838,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/
diff --git a/include/fat.h b/include/fat.h
index 3c29a4484d..8cae283030 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -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))
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] fs: fat: eliminate DIRENTSPERBLOCK() macro
2020-12-25 14:11 [PATCH] fs: fat: eliminate DIRENTSPERBLOCK() macro Heinrich Schuchardt
@ 2020-12-29 3:32 ` Simon Glass
0 siblings, 0 replies; 2+ messages in thread
From: Simon Glass @ 2020-12-29 3:32 UTC (permalink / raw)
To: u-boot
On Fri, 25 Dec 2020 at 07:11, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> 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>
> ---
> Applicable to origin/next
> ---
> fs/fat/fat.c | 5 ++---
> include/fat.h | 1 -
> 2 files changed, 2 insertions(+), 4 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-29 3:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-25 14:11 [PATCH] fs: fat: eliminate DIRENTSPERBLOCK() macro Heinrich Schuchardt
2020-12-29 3:32 ` Simon Glass
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.