summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChen Gang <gang.chen@asianux.com>2013-08-21 17:09:33 +0800
committerMarc Kleine-Budde <mkl@pengutronix.de>2013-08-22 09:40:19 +0200
commit6439fbce1075dedfe23165c136f19f44c00ca132 (patch)
tree0dc63bd51ab0d28490bf0c45fbbab94acd1497a9 /drivers
parentf8825669b3165bbf4380eabfd641f693d02af866 (diff)
can: c_can: fix error checking of priv->instance in probe()
This patch adds a type cast from 'unsigned int' to 'int'. 'priv->instance' may less than zero, so need a type cast, the related warnings (allmodconfig, "EXTRA_CFLAGS=-W"): drivers/net/can/c_can/c_can_platform.c:198:3: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] Signed-off-by: Chen Gang <gang.chen@asianux.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/can/c_can/c_can_platform.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index c6f838d922a..294ced3cc22 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -195,7 +195,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
priv->raminit_ctrlreg = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0)
+ if (IS_ERR(priv->raminit_ctrlreg) || (int)priv->instance < 0)
dev_info(&pdev->dev, "control memory is not used for raminit\n");
else
priv->raminit = c_can_hw_raminit;