You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
FAT_VALID_MEDIA(): remove pointless test
The on-disk media specification field in FAT is only 8-bits, so testing for <=0xff is pointless, and can generate a "comparison is always true due to limited range of data type" warning. While we're there, convert FAT_VALID_MEDIA() into a C function - the present implementation is buggy: it generates either one or two references to its argument. Cc: Frank Seidel <fseidel@suse.de> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
c7a6c4edc7
commit
73f20e58b1
@@ -58,7 +58,11 @@
|
||||
#define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */
|
||||
|
||||
/* media of boot sector */
|
||||
#define FAT_VALID_MEDIA(x) ((0xF8 <= (x) && (x) <= 0xFF) || (x) == 0xF0)
|
||||
static inline int fat_valid_media(u8 media)
|
||||
{
|
||||
return 0xf8 <= media || media == 0xf0;
|
||||
}
|
||||
|
||||
#define FAT_FIRST_ENT(s, x) ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : \
|
||||
MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user