Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Marcin Slusarz and committed by
Linus Torvalds
3c5afae2 08fc99bf

+8 -8
+8 -8
fs/ufs/swab.h
··· 80 80 fs32_add(struct super_block *sbp, __fs32 *n, int d) 81 81 { 82 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 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 88 88 static inline void 89 89 fs32_sub(struct super_block *sbp, __fs32 *n, int d) 90 90 { 91 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 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 97 97 static inline u16 ··· 116 116 fs16_add(struct super_block *sbp, __fs16 *n, int d) 117 117 { 118 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 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 124 124 static inline void 125 125 fs16_sub(struct super_block *sbp, __fs16 *n, int d) 126 126 { 127 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 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 133 #endif /* _UFS_SWAB_H */