All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fat: silence warning for 64KB PAGE_SIZE builds
@ 2007-11-07  5:15 Olof Johansson
  2007-11-07 14:39 ` OGAWA Hirofumi
  0 siblings, 1 reply; 4+ messages in thread
From: Olof Johansson @ 2007-11-07  5:15 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Annoying gcc warning:

fs/fat/inode.c: In function 'fat_fill_super':
fs/fat/inode.c:1222: warning: comparison is always false due to limited range of data type

logical_sector_size can never be more than 16 bits worth, but switching
it to an int silences gcc. It's a sanity check that can never fail with
64KB PAGE_SIZE but it seems like it'd still be useful for other page
sizes, so it's worth keeping:

        if (!is_power_of_2(logical_sector_size)
            || (logical_sector_size < 512)
            || (PAGE_CACHE_SIZE < logical_sector_size)) {
                if (!silent)
                        printk(KERN_ERR "FAT: bogus logical sector size %u\n",
                               logical_sector_size);
                brelse(bh);
                goto out_invalid;
        }


Signed-off-by: Olof Johansson <olof@lixom.net>

diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 920a576..6aae680 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -1158,7 +1158,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
 	struct buffer_head *bh;
 	struct fat_boot_sector *b;
 	struct msdos_sb_info *sbi;
-	u16 logical_sector_size;
+	int logical_sector_size;
 	u32 total_sectors, total_clusters, fat_clusters, rootdir_sectors;
 	int debug;
 	unsigned int media;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-11-07 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-07  5:15 [PATCH] fat: silence warning for 64KB PAGE_SIZE builds Olof Johansson
2007-11-07 14:39 ` OGAWA Hirofumi
2007-11-07 15:01   ` Olof Johansson
2007-11-07 15:02     ` OGAWA Hirofumi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.