Commit 0a7d6cdf authored by Marc Kleine-Budde's avatar Marc Kleine-Budde

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.deAcked-by: default avatarStephane Grosjean <s.grosjean@peak-system.com>
Tested-by: default avatarStephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 5e164a4f
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment