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.
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -65,8 +65,6 @@ · 64 unmodified lines | |||
| 65 | #define MAX_FAT12 0xFF4 | 65 | #define MAX_FAT12 0xFF4 |
| 66 | #define MAX_FAT16 0xFFF4 | 66 | #define MAX_FAT16 0xFFF4 |
| 67 | #define MAX_FAT32 0x0FFFFFF6 | 67 | #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 0xFF7 | 70 | #define BAD_FAT12 0xFF7 |