History

fat: move MAX_FAT to fat.h and change it to inline function

MAX_FAT is useless in msdos_fs.h, since it uses the MSDOS_SB function that is defined in fat.h. So really, this macro can be only called from code that already includes fat.h. Hence, this patch moves it to fat.h, right after MSDOS_SB is defined. I also changed it to an inline function in order to save the double call to MSDOS_SB. This was suggested by joe@perches.com in the previous version. This patch is required for the next in the series, in which the variant (whether this is FAT12, FAT16 or FAT32) checks are replaced with new macros.

Carmeli Tamir committed 7 years ago

Commit d19dc011 parent b5533373 files · +10 −3Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/msdos_fs.h+0−2
@@ -65,8 +65,6 @@ · 64 unmodified lines
65#define MAX_FAT12 0xFF465#define MAX_FAT12 0xFF4
66#define MAX_FAT16 0xFFF466#define MAX_FAT16 0xFFF4
67#define MAX_FAT32 0x0FFFFFF667#define MAX_FAT32 0x0FFFFFF6
68#define MAX_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 : \
69 MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12)
70 68
71/* bad cluster mark */69/* bad cluster mark */
72#define BAD_FAT12 0xFF770#define BAD_FAT12 0xFF7