can: xilinx_can: fix comparison of unsigned variable
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Tue, 18 Nov 2014 13:47:07 +0000 (19:17 +0530)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 18 Nov 2014 16:47:49 +0000 (17:47 +0100)
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: Sudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/xilinx_can.c

index 5e8b5609c067c53c2283a94dacd820fac8f1c565..47b2f801d127888bab9e7cc9f08bfeae351b7eab 100644 (file)
@@ -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 */