public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH next] drivers: net: can: c_can: add type cast from 'unsigned int' to 'int'
@ 2013-08-21  9:09 Chen Gang
  2013-08-21  9:45 ` Marc Kleine-Budde
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Gang @ 2013-08-21  9:09 UTC (permalink / raw)
  To: wg, mkl, anilkumar, Tony Lindgren, jg1.han
  Cc: David Miller, linux-can, netdev

'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>
---
 drivers/net/can/c_can/c_can_platform.c |    2 +-
 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 c6f838d..294ced3 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;
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-21 10:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-21  9:09 [PATCH next] drivers: net: can: c_can: add type cast from 'unsigned int' to 'int' Chen Gang
2013-08-21  9:45 ` Marc Kleine-Budde
2013-08-21 10:04   ` Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox