Skip to content

Commit db16391

Browse files
author
Al Stone
committed
can: kvaser_usb: kvaser_usb_set_bittiming(): fix redundant initialization warning for err
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2071839 Tested: This is one of a series of patch sets to enable Arm SystemReady IR support. This set updates the CAN driver subsystem. This set has been tested on NXP imx8mm and NV Jetson Xavier NX via simple boot tests, using cansend/candump from can-utils to pass messages through a virtual CAN interface, and of course the CI loop. commit cce2d7d Author: Marc Kleine-Budde <mkl@pengutronix.de> Date: Mon Oct 31 12:26:24 2022 +0100 can: kvaser_usb: kvaser_usb_set_bittiming(): fix redundant initialization warning for err The variable err is initialized, but the initialized value is Overwritten before it is read. Fix the warning by not initializing the variable err at all. Fixes: 39d3df6 ("can: kvaser_usb: Compare requested bittiming parameters with actual parameters in do_set_{,data}_bittiming") Cc: Jimmy Assarsson <extja@kvaser.com> Cc: Anssi Hannula <anssi.hannula@bitwise.fi> Link: https://lore.kernel.org/all/20221031114513.81214-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> (cherry picked from commit cce2d7d) Signed-off-by: Al Stone <ahs3@redhat.com>
1 parent d6ae2d6 commit db16391

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ static int kvaser_usb_set_bittiming(struct net_device *netdev)
540540
int tseg1 = bt->prop_seg + bt->phase_seg1;
541541
int tseg2 = bt->phase_seg2;
542542
int sjw = bt->sjw;
543-
int err = -EOPNOTSUPP;
543+
int err;
544544

545545
busparams.bitrate = cpu_to_le32(bt->bitrate);
546546
busparams.sjw = (u8)sjw;

0 commit comments

Comments
 (0)