提交 fb3ec7ba 编写于 作者: S Sudip Mukherjee 提交者: Marc Kleine-Budde

can: xilinx_can: fix comparison of unsigned variable

The variable err was of the type u32. It was being compared with < 0, and being
an unsigned variable the comparison would have been always false.

Moreover, err was getting the return value from set_reset_mode() and
xcan_set_bittiming(), and both are returning int.
Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: NMichal Simek <michal.simek@xilinx.com>
Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
上级 4e2061b1
......@@ -300,7 +300,8 @@ static int xcan_set_bittiming(struct net_device *ndev)
static int xcan_chip_start(struct net_device *ndev)
{
struct xcan_priv *priv = netdev_priv(ndev);
u32 err, reg_msr, reg_sr_mask;
u32 reg_msr, reg_sr_mask;
int err;
unsigned long timeout;
/* Check if it is in reset mode */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册