]> err.no Git - linux-2.6/commitdiff
IB/mthca: Convert to use be16_add_cpu()
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Tue, 12 Feb 2008 23:06:08 +0000 (00:06 +0100)
committerRoland Dreier <rolandd@cisco.com>
Wed, 13 Feb 2008 15:47:47 +0000 (07:47 -0800)
replace:

big_endian_variable = cpu_to_beX(beX_to_cpu(big_endian_variable) +
expression_in_cpu_byteorder);

with:

beX_add_cpu(&big_endian_variable, expression_in_cpu_byteorder);

Generated with a semantic patch.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mthca/mthca_cq.c

index 6bd9f1393349c1d8e92e1c23bda605e14fa46846..1e1e336d3ef9715897088322e3452d5dd366379f 100644 (file)
@@ -473,7 +473,7 @@ static void handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq,
        if (!(new_wqe & cpu_to_be32(0x3f)) || (!cqe->db_cnt && dbd))
                return;
 
-       cqe->db_cnt   = cpu_to_be16(be16_to_cpu(cqe->db_cnt) - dbd);
+       be16_add_cpu(&cqe->db_cnt, -dbd);
        cqe->wqe      = new_wqe;
        cqe->syndrome = SYNDROME_WR_FLUSH_ERR;