[PATCH] fs/qnx4/*: fix sparse warnings

This patch fixes sparse warnings in the qnx4fs (and might even make
qnx4fs work on big-endian boxes)

Signed-off-by: Alexey Dobriyan <adobriyan@mail.ru>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Anders Larsen <al@alarsen.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Alexey Dobriyan and committed by Linus Torvalds 75043cb5 793ae774

+20 -20
+1 -1
fs/qnx4/dir.c
··· 61 61 ino = blknum * QNX4_INODES_PER_BLOCK + ix - 1; 62 62 else { 63 63 le = (struct qnx4_link_info*)de; 64 - ino = ( le->dl_inode_blk - 1 ) * 64 + ino = ( le32_to_cpu(le->dl_inode_blk) - 1 ) * 65 65 QNX4_INODES_PER_BLOCK + 66 66 le->dl_inode_ndx; 67 67 }
+2 -2
fs/qnx4/inode.c
··· 236 236 struct buffer_head *bh = NULL; 237 237 struct qnx4_xblk *xblk = NULL; 238 238 struct qnx4_inode_entry *qnx4_inode = qnx4_raw_inode(inode); 239 - qnx4_nxtnt_t nxtnt = le16_to_cpu(qnx4_inode->di_num_xtnts); 239 + u16 nxtnt = le16_to_cpu(qnx4_inode->di_num_xtnts); 240 240 241 241 if ( iblock < le32_to_cpu(qnx4_inode->di_first_xtnt.xtnt_size) ) { 242 242 // iblock is in the first extent. This is easy. ··· 372 372 printk("qnx4: unable to read the superblock\n"); 373 373 goto outnobh; 374 374 } 375 - if ( le32_to_cpu( *(__u32*)bh->b_data ) != QNX4_SUPER_MAGIC ) { 375 + if ( le32_to_cpup((__le32*) bh->b_data) != QNX4_SUPER_MAGIC ) { 376 376 if (!silent) 377 377 printk("qnx4: wrong fsid in superblock.\n"); 378 378 goto out;
+9 -9
include/linux/qnx4_fs.h
··· 46 46 char di_fname[QNX4_SHORT_NAME_MAX]; 47 47 qnx4_off_t di_size; 48 48 qnx4_xtnt_t di_first_xtnt; 49 - __u32 di_xblk; 50 - __s32 di_ftime; 51 - __s32 di_mtime; 52 - __s32 di_atime; 53 - __s32 di_ctime; 49 + __le32 di_xblk; 50 + __le32 di_ftime; 51 + __le32 di_mtime; 52 + __le32 di_atime; 53 + __le32 di_ctime; 54 54 qnx4_nxtnt_t di_num_xtnts; 55 55 qnx4_mode_t di_mode; 56 56 qnx4_muid_t di_uid; ··· 63 63 64 64 struct qnx4_link_info { 65 65 char dl_fname[QNX4_NAME_MAX]; 66 - __u32 dl_inode_blk; 66 + __le32 dl_inode_blk; 67 67 __u8 dl_inode_ndx; 68 68 __u8 dl_spare[10]; 69 69 __u8 dl_status; 70 70 }; 71 71 72 72 struct qnx4_xblk { 73 - __u32 xblk_next_xblk; 74 - __u32 xblk_prev_xblk; 73 + __le32 xblk_next_xblk; 74 + __le32 xblk_prev_xblk; 75 75 __u8 xblk_num_xtnts; 76 76 __u8 xblk_spare[3]; 77 - __s32 xblk_num_blocks; 77 + __le32 xblk_num_blocks; 78 78 qnx4_xtnt_t xblk_xtnts[QNX4_MAX_XTNTS_PER_XBLK]; 79 79 char xblk_signature[8]; 80 80 qnx4_xtnt_t xblk_first_xtnt;
+8 -8
include/linux/qnxtypes.h
··· 12 12 #ifndef _QNX4TYPES_H 13 13 #define _QNX4TYPES_H 14 14 15 - typedef __u16 qnx4_nxtnt_t; 15 + typedef __le16 qnx4_nxtnt_t; 16 16 typedef __u8 qnx4_ftype_t; 17 17 18 18 typedef struct { 19 - __u32 xtnt_blk; 20 - __u32 xtnt_size; 19 + __le32 xtnt_blk; 20 + __le32 xtnt_size; 21 21 } qnx4_xtnt_t; 22 22 23 - typedef __u16 qnx4_mode_t; 24 - typedef __u16 qnx4_muid_t; 25 - typedef __u16 qnx4_mgid_t; 26 - typedef __u32 qnx4_off_t; 27 - typedef __u16 qnx4_nlink_t; 23 + typedef __le16 qnx4_mode_t; 24 + typedef __le16 qnx4_muid_t; 25 + typedef __le16 qnx4_mgid_t; 26 + typedef __le32 qnx4_off_t; 27 + typedef __le16 qnx4_nlink_t; 28 28 29 29 #endif