Skip to content

Commit

Permalink
sysv: [bl]e*_add_cpu conversion
Browse files Browse the repository at this point in the history
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: Christoph Hellwig <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mslusarz authored and torvalds committed Apr 30, 2008
1 parent e3592b1 commit 0713292
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/sysv/sysv.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ static inline __fs32 fs32_add(struct sysv_sb_info *sbi, __fs32 *n, int d)
if (sbi->s_bytesex == BYTESEX_PDP)
*(__u32*)n = PDP_swab(PDP_swab(*(__u32*)n)+d);
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
*(__be32*)n = cpu_to_be32(be32_to_cpu(*(__be32*)n)+d);
be32_add_cpu((__be32 *)n, d);
return *n;
}

Expand All @@ -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)
{
if (sbi->s_bytesex != BYTESEX_BE)
*(__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);
return *n;
}

Expand Down

0 comments on commit 0713292

Please sign in to comment.