Skip to content

Commit dc80d00

Browse files
mslusarztorvalds
authored andcommitted
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 <[email protected]> Cc: Evgeniy Dushistov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> --- yaml --- svn_rev: 94239 current_ref: refs/heads/rpi-3.12.y current_commit: 3c5afae head_branch: refs/heads/rpi-3.12.y migrated_from: v3
1 parent 196df26 commit dc80d00

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/rpi-3.12.y: 08fc99bfc39d5b394aa27498ac5f14df0ef8e52a
2+
refs/heads/rpi-3.12.y: 3c5afae2bac974fe2c15cd9439f921526b3ea2d7

trunk/fs/ufs/swab.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,18 @@ static inline void
8080
fs32_add(struct super_block *sbp, __fs32 *n, int d)
8181
{
8282
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);
8484
else
85-
*(__be32 *)n = cpu_to_be32(be32_to_cpu(*(__be32 *)n)+d);
85+
be32_add_cpu((__be32 *)n, d);
8686
}
8787

8888
static inline void
8989
fs32_sub(struct super_block *sbp, __fs32 *n, int d)
9090
{
9191
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);
9393
else
94-
*(__be32 *)n = cpu_to_be32(be32_to_cpu(*(__be32 *)n)-d);
94+
be32_add_cpu((__be32 *)n, -d);
9595
}
9696

9797
static inline u16
@@ -116,18 +116,18 @@ static inline void
116116
fs16_add(struct super_block *sbp, __fs16 *n, int d)
117117
{
118118
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);
120120
else
121-
*(__be16 *)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)+d);
121+
be16_add_cpu((__be16 *)n, d);
122122
}
123123

124124
static inline void
125125
fs16_sub(struct super_block *sbp, __fs16 *n, int d)
126126
{
127127
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);
129129
else
130-
*(__be16 *)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)-d);
130+
be16_add_cpu((__be16 *)n, -d);
131131
}
132132

133133
#endif /* _UFS_SWAB_H */

0 commit comments

Comments
 (0)