提交 75043cb5 编写于 作者: A Alexey Dobriyan 提交者: Linus Torvalds

[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: NAlexey Dobriyan <adobriyan@mail.ru>
Signed-off-by: NDomen Puncer <domen@coderock.org>
Signed-off-by: NAnders Larsen <al@alarsen.net>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 793ae774
...@@ -61,7 +61,7 @@ static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -61,7 +61,7 @@ static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir)
ino = blknum * QNX4_INODES_PER_BLOCK + ix - 1; ino = blknum * QNX4_INODES_PER_BLOCK + ix - 1;
else { else {
le = (struct qnx4_link_info*)de; le = (struct qnx4_link_info*)de;
ino = ( le->dl_inode_blk - 1 ) * ino = ( le32_to_cpu(le->dl_inode_blk) - 1 ) *
QNX4_INODES_PER_BLOCK + QNX4_INODES_PER_BLOCK +
le->dl_inode_ndx; le->dl_inode_ndx;
} }
......
...@@ -236,7 +236,7 @@ unsigned long qnx4_block_map( struct inode *inode, long iblock ) ...@@ -236,7 +236,7 @@ unsigned long qnx4_block_map( struct inode *inode, long iblock )
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
struct qnx4_xblk *xblk = NULL; struct qnx4_xblk *xblk = NULL;
struct qnx4_inode_entry *qnx4_inode = qnx4_raw_inode(inode); struct qnx4_inode_entry *qnx4_inode = qnx4_raw_inode(inode);
qnx4_nxtnt_t nxtnt = le16_to_cpu(qnx4_inode->di_num_xtnts); u16 nxtnt = le16_to_cpu(qnx4_inode->di_num_xtnts);
if ( iblock < le32_to_cpu(qnx4_inode->di_first_xtnt.xtnt_size) ) { if ( iblock < le32_to_cpu(qnx4_inode->di_first_xtnt.xtnt_size) ) {
// iblock is in the first extent. This is easy. // iblock is in the first extent. This is easy.
...@@ -372,7 +372,7 @@ static int qnx4_fill_super(struct super_block *s, void *data, int silent) ...@@ -372,7 +372,7 @@ static int qnx4_fill_super(struct super_block *s, void *data, int silent)
printk("qnx4: unable to read the superblock\n"); printk("qnx4: unable to read the superblock\n");
goto outnobh; goto outnobh;
} }
if ( le32_to_cpu( *(__u32*)bh->b_data ) != QNX4_SUPER_MAGIC ) { if ( le32_to_cpup((__le32*) bh->b_data) != QNX4_SUPER_MAGIC ) {
if (!silent) if (!silent)
printk("qnx4: wrong fsid in superblock.\n"); printk("qnx4: wrong fsid in superblock.\n");
goto out; goto out;
......
...@@ -46,11 +46,11 @@ struct qnx4_inode_entry { ...@@ -46,11 +46,11 @@ struct qnx4_inode_entry {
char di_fname[QNX4_SHORT_NAME_MAX]; char di_fname[QNX4_SHORT_NAME_MAX];
qnx4_off_t di_size; qnx4_off_t di_size;
qnx4_xtnt_t di_first_xtnt; qnx4_xtnt_t di_first_xtnt;
__u32 di_xblk; __le32 di_xblk;
__s32 di_ftime; __le32 di_ftime;
__s32 di_mtime; __le32 di_mtime;
__s32 di_atime; __le32 di_atime;
__s32 di_ctime; __le32 di_ctime;
qnx4_nxtnt_t di_num_xtnts; qnx4_nxtnt_t di_num_xtnts;
qnx4_mode_t di_mode; qnx4_mode_t di_mode;
qnx4_muid_t di_uid; qnx4_muid_t di_uid;
...@@ -63,18 +63,18 @@ struct qnx4_inode_entry { ...@@ -63,18 +63,18 @@ struct qnx4_inode_entry {
struct qnx4_link_info { struct qnx4_link_info {
char dl_fname[QNX4_NAME_MAX]; char dl_fname[QNX4_NAME_MAX];
__u32 dl_inode_blk; __le32 dl_inode_blk;
__u8 dl_inode_ndx; __u8 dl_inode_ndx;
__u8 dl_spare[10]; __u8 dl_spare[10];
__u8 dl_status; __u8 dl_status;
}; };
struct qnx4_xblk { struct qnx4_xblk {
__u32 xblk_next_xblk; __le32 xblk_next_xblk;
__u32 xblk_prev_xblk; __le32 xblk_prev_xblk;
__u8 xblk_num_xtnts; __u8 xblk_num_xtnts;
__u8 xblk_spare[3]; __u8 xblk_spare[3];
__s32 xblk_num_blocks; __le32 xblk_num_blocks;
qnx4_xtnt_t xblk_xtnts[QNX4_MAX_XTNTS_PER_XBLK]; qnx4_xtnt_t xblk_xtnts[QNX4_MAX_XTNTS_PER_XBLK];
char xblk_signature[8]; char xblk_signature[8];
qnx4_xtnt_t xblk_first_xtnt; qnx4_xtnt_t xblk_first_xtnt;
......
...@@ -12,18 +12,18 @@ ...@@ -12,18 +12,18 @@
#ifndef _QNX4TYPES_H #ifndef _QNX4TYPES_H
#define _QNX4TYPES_H #define _QNX4TYPES_H
typedef __u16 qnx4_nxtnt_t; typedef __le16 qnx4_nxtnt_t;
typedef __u8 qnx4_ftype_t; typedef __u8 qnx4_ftype_t;
typedef struct { typedef struct {
__u32 xtnt_blk; __le32 xtnt_blk;
__u32 xtnt_size; __le32 xtnt_size;
} qnx4_xtnt_t; } qnx4_xtnt_t;
typedef __u16 qnx4_mode_t; typedef __le16 qnx4_mode_t;
typedef __u16 qnx4_muid_t; typedef __le16 qnx4_muid_t;
typedef __u16 qnx4_mgid_t; typedef __le16 qnx4_mgid_t;
typedef __u32 qnx4_off_t; typedef __le32 qnx4_off_t;
typedef __u16 qnx4_nlink_t; typedef __le16 qnx4_nlink_t;
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册