]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Convert cpu_to_le32(le32_to_cpu(E1) + E2) to use le32_add_cpu().
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Sun, 14 Oct 2012 22:39:19 +0000 (09:39 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sun, 14 Oct 2012 22:39:19 +0000 (09:39 +1100)
dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/persistent-data/dm-space-map-common.c

index d77602d63c83f8b98e341dd07c1dd50c397986e4..f3a9af8cdec3514448ae3f6ce9cb12ecca7f20ae 100644 (file)
@@ -434,14 +434,14 @@ int sm_ll_insert(struct ll_disk *ll, dm_block_t b,
        if (ref_count && !old) {
                *ev = SM_ALLOC;
                ll->nr_allocated++;
-               ie_disk.nr_free = cpu_to_le32(le32_to_cpu(ie_disk.nr_free) - 1);
+               le32_add_cpu(&ie_disk.nr_free, -1);
                if (le32_to_cpu(ie_disk.none_free_before) == bit)
                        ie_disk.none_free_before = cpu_to_le32(bit + 1);
 
        } else if (old && !ref_count) {
                *ev = SM_FREE;
                ll->nr_allocated--;
-               ie_disk.nr_free = cpu_to_le32(le32_to_cpu(ie_disk.nr_free) + 1);
+               le32_add_cpu(&ie_disk.nr_free, 1);
                ie_disk.none_free_before = cpu_to_le32(min(le32_to_cpu(ie_disk.none_free_before), bit));
        }