aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/swab.h
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-04-28 05:16:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:45 -0400
commit3c5afae2bac974fe2c15cd9439f921526b3ea2d7 (patch)
tree10a79737e1e07d4202cfd4fa86bd616de8bca478 /fs/ufs/swab.h
parent08fc99bfc39d5b394aa27498ac5f14df0ef8e52a (diff)
ufs: [bl]e*_add_cpu conversion
replace all: big/little_endian_variable = cpu_to_[bl]eX([bl]eX_to_cpu(big/little_endian_variable) + expression_in_cpu_byteorder); with: [bl]eX_add_cpu(&big/little_endian_variable, expression_in_cpu_byteorder); generated with semantic patch Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ufs/swab.h')
-rw-r--r--fs/ufs/swab.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ufs/swab.h b/fs/ufs/swab.h
index 1683d2bee614..a4340d0267bb 100644
--- a/fs/ufs/swab.h
+++ b/fs/ufs/swab.h
@@ -80,18 +80,18 @@ static inline void
80fs32_add(struct super_block *sbp, __fs32 *n, int d) 80fs32_add(struct super_block *sbp, __fs32 *n, int d)
81{ 81{
82 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) 82 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
83 *(__le32 *)n = cpu_to_le32(le32_to_cpu(*(__le32 *)n)+d); 83 le32_add_cpu((__le32 *)n, d);
84 else 84 else
85 *(__be32 *)n = cpu_to_be32(be32_to_cpu(*(__be32 *)n)+d); 85 be32_add_cpu((__be32 *)n, d);
86} 86}
87 87
88static inline void 88static inline void
89fs32_sub(struct super_block *sbp, __fs32 *n, int d) 89fs32_sub(struct super_block *sbp, __fs32 *n, int d)
90{ 90{
91 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) 91 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
92 *(__le32 *)n = cpu_to_le32(le32_to_cpu(*(__le32 *)n)-d); 92 le32_add_cpu((__le32 *)n, -d);
93 else 93 else
94 *(__be32 *)n = cpu_to_be32(be32_to_cpu(*(__be32 *)n)-d); 94 be32_add_cpu((__be32 *)n, -d);
95} 95}
96 96
97static inline u16 97static inline u16
@@ -116,18 +116,18 @@ static inline void
116fs16_add(struct super_block *sbp, __fs16 *n, int d) 116fs16_add(struct super_block *sbp, __fs16 *n, int d)
117{ 117{
118 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) 118 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
119 *(__le16 *)n = cpu_to_le16(le16_to_cpu(*(__le16 *)n)+d); 119 le16_add_cpu((__le16 *)n, d);
120 else 120 else
121 *(__be16 *)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)+d); 121 be16_add_cpu((__be16 *)n, d);
122} 122}
123 123
124static inline void 124static inline void
125fs16_sub(struct super_block *sbp, __fs16 *n, int d) 125fs16_sub(struct super_block *sbp, __fs16 *n, int d)
126{ 126{
127 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) 127 if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
128 *(__le16 *)n = cpu_to_le16(le16_to_cpu(*(__le16 *)n)-d); 128 le16_add_cpu((__le16 *)n, -d);
129 else 129 else
130 *(__be16 *)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)-d); 130 be16_add_cpu((__be16 *)n, -d);
131} 131}
132 132
133#endif /* _UFS_SWAB_H */ 133#endif /* _UFS_SWAB_H */