]> git.baikalelectronics.ru Git - kernel.git/commitdiff
can: peak_usb: convert to use le32_add_cpu()
authorLiu Shixin <liushixin2@huawei.com>
Mon, 14 Sep 2020 04:17:44 +0000 (12:17 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 21 Sep 2020 08:13:18 +0000 (10:13 +0200)
Convert cpu_to_le32(le32_to_cpu(E1) + E2) to use le32_add_cpu().

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Link: https://lore.kernel.org/r/20200914041744.3701840-1-liushixin2@huawei.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/peak_usb/pcan_usb_pro.c

index f85b560e05db72da87c109980d12a0f878494e53..c7564773fb2b8310b436f2fa49f5cbf1d9ad2d95 100644 (file)
@@ -186,7 +186,7 @@ static int pcan_msg_add_rec(struct pcan_usb_pro_msg *pm, int id, ...)
 
        len = pc - pm->rec_ptr;
        if (len > 0) {
-               *pm->u.rec_cnt = cpu_to_le32(le32_to_cpu(*pm->u.rec_cnt) + 1);
+               le32_add_cpu(pm->u.rec_cnt, 1);
                *pm->rec_ptr = id;
 
                pm->rec_ptr = pc;