summaryrefslogtreecommitdiff
path: root/drivers/net/can
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2021-04-05 13:49:45 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2021-04-13 10:15:44 +0200
commit0a7d6cdf90c0f10fd62b1b2d80fbaeb7e0172c13 (patch)
treee2368d16bc2babcbf2d7d96b7986d889e5189ed2 /drivers/net/can
parent5e164a4f0aaee1b604e920a8cf99878c06fe3f11 (diff)
can: peak_usb: pcan_usb_get_serial(): make use of le32_to_cpup()
This patch replaces the memcpy() + le32_to_cpu() by le32_to_cpup(). Link: https://lore.kernel.org/r/20210406111622.1874957-9-mkl@pengutronix.de Acked-by: Stephane Grosjean <s.grosjean@peak-system.com> Tested-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/usb/peak_usb/pcan_usb.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c
index fd5ea95fd55d..ffb01c3a3827 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb.c
@@ -368,12 +368,8 @@ static int pcan_usb_get_serial(struct peak_usb_device *dev, u32 *serial_number)
if (err)
return err;
- if (serial_number) {
- __le32 tmp32;
-
- memcpy(&tmp32, args, 4);
- *serial_number = le32_to_cpu(tmp32);
- }
+ if (serial_number)
+ *serial_number = le32_to_cpup((__le32 *)args);
return 0;
}