linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: rcar: remove sign-compare flaw
@ 2014-09-20 10:07 Wolfram Sang
  2014-09-28 23:15 ` Laurent Pinchart
  2014-09-29 20:44 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2014-09-20 10:07 UTC (permalink / raw)
  To: linux-i2c
  Cc: linux-sh, Wolfram Sang, Magnus Damm, Simon Horman,
	Laurent Pinchart, Geert Uytterhoeven, Sergei Shtylyov

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

gcc rightfully says:

drivers/i2c/busses/i2c-rcar.c:198:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/busses/i2c-rcar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 4c6fa78063fb..1eed463662c4 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -195,7 +195,7 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv,
 	 */
 	rate = clk_get_rate(priv->clk);
 	cdf = rate / 20000000;
-	if (cdf >= 1 << cdf_width) {
+	if (cdf >= 1U << cdf_width) {
 		dev_err(dev, "Input clock %lu too high\n", rate);
 		return -EIO;
 	}
-- 
2.0.0


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

* Re: [PATCH] i2c: rcar: remove sign-compare flaw
  2014-09-20 10:07 [PATCH] i2c: rcar: remove sign-compare flaw Wolfram Sang
@ 2014-09-28 23:15 ` Laurent Pinchart
  2014-09-29 20:44 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2014-09-28 23:15 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, linux-sh, Magnus Damm, Simon Horman,
	Geert Uytterhoeven, Sergei Shtylyov

Hi Wolfram,

Thank you for the patch.

On Saturday 20 September 2014 12:07:37 Wolfram Sang wrote:
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> gcc rightfully says:
> 
> drivers/i2c/busses/i2c-rcar.c:198:10: warning: comparison between signed and
> unsigned integer expressions [-Wsign-compare]
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/i2c/busses/i2c-rcar.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
> index 4c6fa78063fb..1eed463662c4 100644
> --- a/drivers/i2c/busses/i2c-rcar.c
> +++ b/drivers/i2c/busses/i2c-rcar.c
> @@ -195,7 +195,7 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv
> *priv, */
>  	rate = clk_get_rate(priv->clk);
>  	cdf = rate / 20000000;
> -	if (cdf >= 1 << cdf_width) {
> +	if (cdf >= 1U << cdf_width) {
>  		dev_err(dev, "Input clock %lu too high\n", rate);
>  		return -EIO;
>  	}

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH] i2c: rcar: remove sign-compare flaw
  2014-09-20 10:07 [PATCH] i2c: rcar: remove sign-compare flaw Wolfram Sang
  2014-09-28 23:15 ` Laurent Pinchart
@ 2014-09-29 20:44 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2014-09-29 20:44 UTC (permalink / raw)
  To: linux-i2c
  Cc: linux-sh, Magnus Damm, Simon Horman, Laurent Pinchart,
	Geert Uytterhoeven, Sergei Shtylyov

[-- Attachment #1: Type: text/plain, Size: 382 bytes --]

On Sat, Sep 20, 2014 at 12:07:37PM +0200, Wolfram Sang wrote:
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> gcc rightfully says:
> 
> drivers/i2c/busses/i2c-rcar.c:198:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Applied to for-next, thanks!


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2014-09-29 20:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-20 10:07 [PATCH] i2c: rcar: remove sign-compare flaw Wolfram Sang
2014-09-28 23:15 ` Laurent Pinchart
2014-09-29 20:44 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).