omfs: convert to use beXX_add_cpu()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 5 Oct 2012 00:16:53 +0000 (17:16 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 Oct 2012 18:05:31 +0000 (03:05 +0900)
Convert cpu_to_beXX(beXX_to_cpu(E1) + E2) to use beXX_add_cpu().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/omfs/file.c

index 2c6d95257a4d5c7a61bf39b895c5ebbd647cc49b..77e3cb2962b46e58a982cce170e9716dfc8880df 100644 (file)
@@ -146,8 +146,7 @@ static int omfs_grow_extent(struct inode *inode, struct omfs_extent *oe,
                        be64_to_cpu(entry->e_blocks);
 
                if (omfs_allocate_block(inode->i_sb, new_block)) {
-                       entry->e_blocks =
-                               cpu_to_be64(be64_to_cpu(entry->e_blocks) + 1);
+                       be64_add_cpu(&entry->e_blocks, 1);
                        terminator->e_blocks = ~(cpu_to_be64(
                                be64_to_cpu(~terminator->e_blocks) + 1));
                        goto out;
@@ -177,7 +176,7 @@ static int omfs_grow_extent(struct inode *inode, struct omfs_extent *oe,
                be64_to_cpu(~terminator->e_blocks) + (u64) new_count));
 
        /* write in new entry */
-       oe->e_extent_count = cpu_to_be32(1 + be32_to_cpu(oe->e_extent_count));
+       be32_add_cpu(&oe->e_extent_count, 1);
 
 out:
        *ret_block = new_block;