[PATCH] ocfs2: le*_add_cpu conversion
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Tue, 12 Feb 2008 23:06:18 +0000 (00:06 +0100)
committerMark Fasheh <mark.fasheh@oracle.com>
Mon, 3 Mar 2008 23:50:21 +0000 (15:50 -0800)
replace all:
little_endian_variable = cpu_to_leX(leX_to_cpu(little_endian_variable) +
expression_in_cpu_byteorder);
with:
leX_add_cpu(&little_endian_variable, expression_in_cpu_byteorder);
generated with semantic patch

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/dir.c
fs/ocfs2/localalloc.c

index e280833..8a18758 100644 (file)
@@ -390,9 +390,8 @@ static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir,
                                goto bail;
                        }
                        if (pde)
-                               pde->rec_len =
-                                       cpu_to_le16(le16_to_cpu(pde->rec_len) +
-                                                   le16_to_cpu(de->rec_len));
+                               le16_add_cpu(&pde->rec_len,
+                                               le16_to_cpu(de->rec_len));
                        else
                                de->inode = 0;
                        dir->i_version++;
index b1004b0..ab83fd5 100644 (file)
@@ -585,8 +585,7 @@ int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb,
        while(bits_wanted--)
                ocfs2_set_bit(start++, bitmap);
 
-       alloc->id1.bitmap1.i_used = cpu_to_le32(*num_bits +
-                               le32_to_cpu(alloc->id1.bitmap1.i_used));
+       le32_add_cpu(&alloc->id1.bitmap1.i_used, *num_bits);
 
        status = ocfs2_journal_dirty(handle, osb->local_alloc_bh);
        if (status < 0) {