From: Chen Gang <gang.chen@asianux.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org, anilkumar@ti.com, tony@atomide.com,
jg1.han@samsung.com
Subject: Re: [PATCH] can: c_can: fix error checking of priv->instance in probe()
Date: Wed, 21 Aug 2013 17:52:24 +0800 [thread overview]
Message-ID: <52148DD8.3070201@asianux.com> (raw)
In-Reply-To: <1377078508-26713-1-git-send-email-mkl@pengutronix.de>
On 08/21/2013 05:48 PM, Marc Kleine-Budde wrote:
> From: Chen Gang <gang.chen@asianux.com>
>
> 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>
> ---
> Hello Chen Gang,
>
> I've tweaked the commit message a bit. If there a no complains the patch will
> be included in my next pull request to David.
>
Thank you for your tweaking.
> Marc
>
> drivers/net/can/c_can/c_can_platform.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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;
>
Thanks.
--
Chen Gang
prev parent reply other threads:[~2013-08-21 9:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-21 9:48 [PATCH] can: c_can: fix error checking of priv->instance in probe() Marc Kleine-Budde
2013-08-21 9:52 ` Chen Gang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52148DD8.3070201@asianux.com \
--to=gang.chen@asianux.com \
--cc=anilkumar@ti.com \
--cc=jg1.han@samsung.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.