can: peak_usb: pcan_usb_get_serial(): unconditionally assign serial_number
authorMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 5 Apr 2021 17:52:19 +0000 (19:52 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 13 Apr 2021 08:15:44 +0000 (10:15 +0200)
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>
drivers/net/can/usb/peak_usb/pcan_usb.c

index ffb01c3a38272a54f8da42d510ecd7a847b18b81..929cc1b05aa2eaf32066b23aed97ca84ec668b6c 100644 (file)
@@ -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;
 }