X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Fufs%2Fswab.h;h=8d974c4fd18b1eea45ddc849803f01904f7b8abb;hb=6f1e94031f5891e8b375e5ff5d48672c250be353;hp=1683d2bee614249a40d91d79af64db3295857d88;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=linux-2.6-omap-h63xx.git diff --git a/fs/ufs/swab.h b/fs/ufs/swab.h index 1683d2bee61..8d974c4fd18 100644 --- a/fs/ufs/swab.h +++ b/fs/ufs/swab.h @@ -40,25 +40,7 @@ cpu_to_fs64(struct super_block *sbp, u64 n) return (__force __fs64)cpu_to_be64(n); } -static __inline u32 -fs64_add(struct super_block *sbp, u32 *n, int d) -{ - if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return *n = cpu_to_le64(le64_to_cpu(*n)+d); - else - return *n = cpu_to_be64(be64_to_cpu(*n)+d); -} - -static __inline u32 -fs64_sub(struct super_block *sbp, u32 *n, int d) -{ - if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return *n = cpu_to_le64(le64_to_cpu(*n)-d); - else - return *n = cpu_to_be64(be64_to_cpu(*n)-d); -} - -static __inline u32 +static inline u32 fs32_to_cpu(struct super_block *sbp, __fs32 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) @@ -80,18 +62,18 @@ static inline void fs32_add(struct super_block *sbp, __fs32 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - *(__le32 *)n = cpu_to_le32(le32_to_cpu(*(__le32 *)n)+d); + le32_add_cpu((__le32 *)n, d); else - *(__be32 *)n = cpu_to_be32(be32_to_cpu(*(__be32 *)n)+d); + be32_add_cpu((__be32 *)n, d); } static inline void fs32_sub(struct super_block *sbp, __fs32 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - *(__le32 *)n = cpu_to_le32(le32_to_cpu(*(__le32 *)n)-d); + le32_add_cpu((__le32 *)n, -d); else - *(__be32 *)n = cpu_to_be32(be32_to_cpu(*(__be32 *)n)-d); + be32_add_cpu((__be32 *)n, -d); } static inline u16 @@ -116,18 +98,18 @@ static inline void fs16_add(struct super_block *sbp, __fs16 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - *(__le16 *)n = cpu_to_le16(le16_to_cpu(*(__le16 *)n)+d); + le16_add_cpu((__le16 *)n, d); else - *(__be16 *)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)+d); + be16_add_cpu((__be16 *)n, d); } static inline void fs16_sub(struct super_block *sbp, __fs16 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - *(__le16 *)n = cpu_to_le16(le16_to_cpu(*(__le16 *)n)-d); + le16_add_cpu((__le16 *)n, -d); else - *(__be16 *)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)-d); + be16_add_cpu((__be16 *)n, -d); } #endif /* _UFS_SWAB_H */