Re: [PATCH 2/2] fat: New macros to determine the FAT variant (32, 16 or 12)

From: OGAWA Hirofumi
Date: Thu Dec 13 2018 - 22:16:13 EST


Joe Perches <joe@xxxxxxxxxxx> writes:

>>
>> -#define FAT_FIRST_ENT(s, x) ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : \
>> - MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x))
>> +#define IS_FAT12(sbi) (sbi->fat_bits == 12)
>> +#define IS_FAT16(sbi) (sbi->fat_bits == 16)
>> +#define IS_FAT32(sbi) (sbi->fat_bits == 32)
>
> sbi should be parenthesized or perhaps better these should be
> static inline bool functions

Right, rather this is the bug (not hit yet though) that should be fixed.

Thanks.
--
OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>