Skip to content

Commit 803f445

Browse files
hharrisontorvalds
authored andcommitted
fat: use get/put_unaligned_* helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d15c0a4 commit 803f445

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎fs/fat/inode.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,8 +1222,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
12221222
brelse(bh);
12231223
goto out_invalid;
12241224
}
1225-
logical_sector_size =
1226-
le16_to_cpu(get_unaligned((__le16 *)&b->sector_size));
1225+
logical_sector_size = get_unaligned_le16(&b->sector_size);
12271226
if (!is_power_of_2(logical_sector_size)
12281227
|| (logical_sector_size < 512)
12291228
|| (logical_sector_size > 4096)) {
@@ -1322,8 +1321,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
13221321
sbi->dir_per_block_bits = ffs(sbi->dir_per_block) - 1;
13231322

13241323
sbi->dir_start = sbi->fat_start + sbi->fats * sbi->fat_length;
1325-
sbi->dir_entries =
1326-
le16_to_cpu(get_unaligned((__le16 *)&b->dir_entries));
1324+
sbi->dir_entries = get_unaligned_le16(&b->dir_entries);
13271325
if (sbi->dir_entries & (sbi->dir_per_block - 1)) {
13281326
if (!silent)
13291327
printk(KERN_ERR "FAT: bogus directroy-entries per block"
@@ -1335,7 +1333,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
13351333
rootdir_sectors = sbi->dir_entries
13361334
* sizeof(struct msdos_dir_entry) / sb->s_blocksize;
13371335
sbi->data_start = sbi->dir_start + rootdir_sectors;
1338-
total_sectors = le16_to_cpu(get_unaligned((__le16 *)&b->sectors));
1336+
total_sectors = get_unaligned_le16(&b->sectors);
13391337
if (total_sectors == 0)
13401338
total_sectors = le32_to_cpu(b->total_sect);
13411339

0 commit comments

Comments
 (0)