summaryrefslogtreecommitdiff
path: root/drivers/net/can
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2021-04-05 19:52:19 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2021-04-13 10:15:44 +0200
commitb7a29d35a9849e898232111ec083e382fb1adf25 (patch)
tree3aaaaf52ecfde086f705c84af89286475834fca0 /drivers/net/can
parent0a7d6cdf90c0f10fd62b1b2d80fbaeb7e0172c13 (diff)
can: peak_usb: pcan_usb_get_serial(): unconditionally assign serial_number
The function serial_number is only called from one location with a valid serial_number pointer. Remove not needed NULL pointer check. Link: https://lore.kernel.org/r/20210406111622.1874957-10-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.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c
index ffb01c3a3827..929cc1b05aa2 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb.c
@@ -367,9 +367,7 @@ static int pcan_usb_get_serial(struct peak_usb_device *dev, u32 *serial_number)
err = pcan_usb_wait_rsp(dev, PCAN_USB_CMD_SN, PCAN_USB_GET, args);
if (err)
return err;
-
- if (serial_number)
- *serial_number = le32_to_cpup((__le32 *)args);
+ *serial_number = le32_to_cpup((__le32 *)args);
return 0;
}