提交 07132922 编写于 作者: M Marcin Slusarz 提交者: Linus Torvalds

sysv: [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: NMarcin Slusarz <marcin.slusarz@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 e3592b12
...@@ -217,9 +217,9 @@ static inline __fs32 fs32_add(struct sysv_sb_info *sbi, __fs32 *n, int d) ...@@ -217,9 +217,9 @@ static inline __fs32 fs32_add(struct sysv_sb_info *sbi, __fs32 *n, int d)
if (sbi->s_bytesex == BYTESEX_PDP) if (sbi->s_bytesex == BYTESEX_PDP)
*(__u32*)n = PDP_swab(PDP_swab(*(__u32*)n)+d); *(__u32*)n = PDP_swab(PDP_swab(*(__u32*)n)+d);
else if (sbi->s_bytesex == BYTESEX_LE) else if (sbi->s_bytesex == BYTESEX_LE)
*(__le32*)n = cpu_to_le32(le32_to_cpu(*(__le32*)n)+d); le32_add_cpu((__le32 *)n, d);
else else
*(__be32*)n = cpu_to_be32(be32_to_cpu(*(__be32*)n)+d); be32_add_cpu((__be32 *)n, d);
return *n; return *n;
} }
...@@ -242,9 +242,9 @@ static inline __fs16 cpu_to_fs16(struct sysv_sb_info *sbi, __u16 n) ...@@ -242,9 +242,9 @@ static inline __fs16 cpu_to_fs16(struct sysv_sb_info *sbi, __u16 n)
static inline __fs16 fs16_add(struct sysv_sb_info *sbi, __fs16 *n, int d) static inline __fs16 fs16_add(struct sysv_sb_info *sbi, __fs16 *n, int d)
{ {
if (sbi->s_bytesex != BYTESEX_BE) if (sbi->s_bytesex != BYTESEX_BE)
*(__le16*)n = cpu_to_le16(le16_to_cpu(*(__le16 *)n)+d); le16_add_cpu((__le16 *)n, d);
else else
*(__be16*)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)+d); be16_add_cpu((__be16 *)n, d);
return *n; return *n;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册