From d79e5a49328f1c48f4465d543608f5cdee722555 Mon Sep 17 00:00:00 2001 From: Saurav Pal Date: Fri, 2 Feb 2024 21:06:11 +0000 Subject: [PATCH] fs/vfat: Fix typo in the macro DIRSEC_BYTENDX The DIRSEC_BYTENDX(f, i) is supposed to have DIRSEC_NDXMASK(f) in its expansion instead of DIRSEC_NDXMASK(fs). It went unnoticed in the codebase as DIRSEC_BYTENDX(fs, idx) is the way it is used, and it leads to a similar expansion as desired, and thus it has worked till now without any issues from this. Signed-off-by: Saurav Pal --- .gitignore | 2 ++ fs/fat/fs_fat32.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index bd4937245b..5f21c69b30 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,5 @@ uImage .DS_Store tools/gdb/__pycache__ /build +.ccls-cache +compile_commands.json diff --git a/fs/fat/fs_fat32.h b/fs/fat/fs_fat32.h index afff4598a0..e1d7ce43a9 100644 --- a/fs/fat/fs_fat32.h +++ b/fs/fat/fs_fat32.h @@ -261,7 +261,7 @@ #define DIRSEC_NDXMASK(f) (((f)->fs_hwsectorsize - 1) >> 5) #define DIRSEC_NDIRS(f) (((f)->fs_hwsectorsize) >> 5) -#define DIRSEC_BYTENDX(f,i) (((i) & DIRSEC_NDXMASK(fs)) << 5) +#define DIRSEC_BYTENDX(f,i) (((i) & DIRSEC_NDXMASK(f)) << 5) #define SEC_NDXMASK(f) ((f)->fs_hwsectorsize - 1) #define SEC_NSECTORS(f,n) ((n) / (f)->fs_hwsectorsize)