The patch titled EXT3: Fix sparse warnings has been added to the -mm tree. Its filename is ext3-fix-sparse-warnings.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: EXT3: Fix sparse warnings From: Dave Kleikamp <shaggy@xxxxxxxxxxxxxx> Fixing up some endian-ness warnings in preparation to clone ext4 from ext3. Signed-off-by: Dave Kleikamp <shaggy@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- fs/ext3/resize.c | 25 +++++++++++++------------ fs/ext3/super.c | 7 ++++--- fs/jbd/journal.c | 2 +- include/linux/ext3_fs.h | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) diff -puN fs/ext3/resize.c~ext3-fix-sparse-warnings fs/ext3/resize.c --- a/fs/ext3/resize.c~ext3-fix-sparse-warnings +++ a/fs/ext3/resize.c @@ -336,7 +336,7 @@ static int verify_reserved_gdb(struct su unsigned five = 5; unsigned seven = 7; unsigned grp; - __u32 *p = (__u32 *)primary->b_data; + __le32 *p = (__le32 *)primary->b_data; int gdbackups = 0; while ((grp = ext3_list_backups(sb, &three, &five, &seven)) < end) { @@ -380,7 +380,7 @@ static int add_new_gdb(handle_t *handle, struct buffer_head *dind; int gdbackups; struct ext3_iloc iloc; - __u32 *data; + __le32 *data; int err; if (test_opt(sb, DEBUG)) @@ -410,14 +410,14 @@ static int add_new_gdb(handle_t *handle, goto exit_bh; } - data = EXT3_I(inode)->i_data + EXT3_DIND_BLOCK; + data = (__le32 *)(EXT3_I(inode)->i_data + EXT3_DIND_BLOCK); dind = sb_bread(sb, le32_to_cpu(*data)); if (!dind) { err = -EIO; goto exit_bh; } - data = (__u32 *)dind->b_data; + data = (__le32 *)dind->b_data; if (le32_to_cpu(data[gdb_num % EXT3_ADDR_PER_BLOCK(sb)]) != gdblock) { ext3_warning(sb, __FUNCTION__, "new group %u GDT block "E3FSBLK" not reserved", @@ -519,7 +519,7 @@ static int reserve_backup_gdb(handle_t * struct buffer_head *dind; struct ext3_iloc iloc; ext3_fsblk_t blk; - __u32 *data, *end; + __le32 *data, *end; int gdbackups = 0; int res, i; int err; @@ -528,7 +528,7 @@ static int reserve_backup_gdb(handle_t * if (!primary) return -ENOMEM; - data = EXT3_I(inode)->i_data + EXT3_DIND_BLOCK; + data = (__le32 *)(EXT3_I(inode)->i_data + EXT3_DIND_BLOCK); dind = sb_bread(sb, le32_to_cpu(*data)); if (!dind) { err = -EIO; @@ -536,8 +536,8 @@ static int reserve_backup_gdb(handle_t * } blk = EXT3_SB(sb)->s_sbh->b_blocknr + 1 + EXT3_SB(sb)->s_gdb_count; - data = (__u32 *)dind->b_data + EXT3_SB(sb)->s_gdb_count; - end = (__u32 *)dind->b_data + EXT3_ADDR_PER_BLOCK(sb); + data = (__le32 *)dind->b_data + EXT3_SB(sb)->s_gdb_count; + end = (__le32 *)dind->b_data + EXT3_ADDR_PER_BLOCK(sb); /* Get each reserved primary GDT block and verify it holds backups */ for (res = 0; res < reserved_gdb; res++, blk++) { @@ -545,7 +545,8 @@ static int reserve_backup_gdb(handle_t * ext3_warning(sb, __FUNCTION__, "reserved block "E3FSBLK " not at offset %ld", - blk, (long)(data - (__u32 *)dind->b_data)); + blk, + (long)(data - (__le32 *)dind->b_data)); err = -EINVAL; goto exit_bh; } @@ -560,7 +561,7 @@ static int reserve_backup_gdb(handle_t * goto exit_bh; } if (++data >= end) - data = (__u32 *)dind->b_data; + data = (__le32 *)dind->b_data; } for (i = 0; i < reserved_gdb; i++) { @@ -584,7 +585,7 @@ static int reserve_backup_gdb(handle_t * blk = input->group * EXT3_BLOCKS_PER_GROUP(sb); for (i = 0; i < reserved_gdb; i++) { int err2; - data = (__u32 *)primary[i]->b_data; + data = (__le32 *)primary[i]->b_data; /* printk("reserving backup %lu[%u] = %lu\n", primary[i]->b_blocknr, gdbackups, blk + primary[i]->b_blocknr); */ @@ -689,7 +690,7 @@ exit_err: "can't update backup for group %d (err %d), " "forcing fsck on next reboot", group, err); sbi->s_mount_state &= ~EXT3_VALID_FS; - sbi->s_es->s_state &= ~cpu_to_le16(EXT3_VALID_FS); + sbi->s_es->s_state &= cpu_to_le16(~EXT3_VALID_FS); mark_buffer_dirty(sbi->s_sbh); } } diff -puN fs/ext3/super.c~ext3-fix-sparse-warnings fs/ext3/super.c --- a/fs/ext3/super.c~ext3-fix-sparse-warnings +++ a/fs/ext3/super.c @@ -2288,13 +2288,14 @@ static int ext3_remount (struct super_bl ext3_mark_recovery_complete(sb, es); } else { - __le32 ret; - if ((ret = EXT3_HAS_RO_COMPAT_FEATURE(sb, + int ret; + __le32 ret_le; + if ((ret_le = EXT3_HAS_RO_COMPAT_FEATURE(sb, ~EXT3_FEATURE_RO_COMPAT_SUPP))) { printk(KERN_WARNING "EXT3-fs: %s: couldn't " "remount RDWR because of unsupported " "optional features (%x).\n", - sb->s_id, le32_to_cpu(ret)); + sb->s_id, le32_to_cpu(ret_le)); err = -EROFS; goto restore_opts; } diff -puN fs/jbd/journal.c~ext3-fix-sparse-warnings fs/jbd/journal.c --- a/fs/jbd/journal.c~ext3-fix-sparse-warnings +++ a/fs/jbd/journal.c @@ -1094,7 +1094,7 @@ int journal_load(journal_t *journal) /* * Create a slab for this blocksize */ - err = journal_create_jbd_slab(cpu_to_be32(sb->s_blocksize)); + err = journal_create_jbd_slab(be32_to_cpu(sb->s_blocksize)); if (err) return err; diff -puN include/linux/ext3_fs.h~ext3-fix-sparse-warnings include/linux/ext3_fs.h --- a/include/linux/ext3_fs.h~ext3-fix-sparse-warnings +++ a/include/linux/ext3_fs.h @@ -481,7 +481,7 @@ struct ext3_super_block { */ __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ - __u16 s_reserved_gdt_blocks; /* Per group desc for online growth */ + __le16 s_reserved_gdt_blocks; /* Per group desc for online growth */ /* * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set. */ _ Patches currently in -mm which might be from shaggy@xxxxxxxxxxxxxx are git-cifs.patch fs-removing-useless-casts.patch fs-jfs-conversion-to-generic-boolean.patch ext3-more-whitespace-cleanups.patch ext3-fix-sparse-warnings.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html