summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/xilinx_can.c
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2014-11-18 14:47:07 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2014-11-18 17:47:49 +0100
commitfb3ec7ba5a665c280f7299a36460449038fc1083 (patch)
tree5abdbadb2ba03aeb6373c978d50874d4b853d1f2 /drivers/net/can/xilinx_can.c
parentcan: remove unused variable (diff)
downloadlinux-fb3ec7ba5a665c280f7299a36460449038fc1083.tar.xz
linux-fb3ec7ba5a665c280f7299a36460449038fc1083.zip
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: Sudip Mukherjee <sudip@vectorindia.org> Reviewed-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/xilinx_can.c')
-rw-r--r--drivers/net/can/xilinx_can.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
index 5e8b5609c067..47b2f801d127 100644
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
@@ -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 */