* [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
* Re: [PATCH next] drivers: net: can: c_can: add type cast from 'unsigned int' to 'int'
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
0 siblings, 1 reply; 3+ messages in thread
From: Marc Kleine-Budde @ 2013-08-21 9:45 UTC (permalink / raw)
To: Chen Gang
Cc: wg, anilkumar, Tony Lindgren, jg1.han, David Miller, linux-can,
netdev
[-- Attachment #1: Type: text/plain, Size: 642 bytes --]
On 08/21/2013 11:09 AM, Chen Gang wrote:
> '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]
Tnx, I've tweaked the commit message a bit, will send a v2.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH next] drivers: net: can: c_can: add type cast from 'unsigned int' to 'int'
2013-08-21 9:45 ` Marc Kleine-Budde
@ 2013-08-21 10:04 ` Chen Gang
0 siblings, 0 replies; 3+ messages in thread
From: Chen Gang @ 2013-08-21 10:04 UTC (permalink / raw)
To: Marc Kleine-Budde
Cc: wg, anilkumar, Tony Lindgren, jg1.han, David Miller, linux-can,
netdev
On 08/21/2013 05:45 PM, Marc Kleine-Budde wrote:
> On 08/21/2013 11:09 AM, Chen Gang wrote:
>> '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]
>
> Tnx, I've tweaked the commit message a bit, will send a v2.
>
OK, thanks.
> Marc
>
--
Chen Gang
^ permalink raw reply [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