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>
This commit is contained in:
Marc Kleine-Budde 2021-04-05 13:49:45 +02:00
parent 5e164a4f0a
commit 0a7d6cdf90
1 changed files with 2 additions and 6 deletions

View File

@ -368,12 +368,8 @@ static int pcan_usb_get_serial(struct peak_usb_device *dev, u32 *serial_number)
if (err) if (err)
return err; return err;
if (serial_number) { if (serial_number)
__le32 tmp32; *serial_number = le32_to_cpup((__le32 *)args);
memcpy(&tmp32, args, 4);
*serial_number = le32_to_cpu(tmp32);
}
return 0; return 0;
} }