All of lore.kernel.org
 help / color / mirror / Atom feed
From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clk: hisilicon: fix warning from smatch
Date: Thu, 20 Mar 2014 20:12:56 -0700	[thread overview]
Message-ID: <20140321031256.21989.67304@quantum> (raw)
In-Reply-To: <1394422400-17639-1-git-send-email-zhangfei.gao@linaro.org>

Quoting Zhangfei Gao (2014-03-09 20:33:20)
> drivers/clk/hisilicon/clk-hi3620.c:338
> mmc_clk_delay() warn: always true condition '(para >= 0) => (0-u32max >= 0)'
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>

Taken into clk-next.

Regards,
Mike

> ---
>  drivers/clk/hisilicon/clk-hi3620.c |   15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clk/hisilicon/clk-hi3620.c b/drivers/clk/hisilicon/clk-hi3620.c
> index 38faa469d288..e75f742ca422 100644
> --- a/drivers/clk/hisilicon/clk-hi3620.c
> +++ b/drivers/clk/hisilicon/clk-hi3620.c
> @@ -335,15 +335,14 @@ static u32 mmc_clk_delay(u32 val, u32 para, u32 off, u32 len)
>  {
>         u32 i;
>  
> -       if (para >= 0) {
> -               for (i = 0; i < len; i++) {
> -                       if (para % 2)
> -                               val |= 1 << (off + i);
> -                       else
> -                               val &= ~(1 << (off + i));
> -                       para = para >> 1;
> -               }
> +       for (i = 0; i < len; i++) {
> +               if (para % 2)
> +                       val |= 1 << (off + i);
> +               else
> +                       val &= ~(1 << (off + i));
> +               para = para >> 1;
>         }
> +
>         return val;
>  }
>  
> -- 
> 1.7.9.5
> 

      reply	other threads:[~2014-03-21  3:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-10  3:33 [PATCH] clk: hisilicon: fix warning from smatch Zhangfei Gao
2014-03-21  3:12 ` Mike Turquette [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=20140321031256.21989.67304@quantum \
    --to=mturquette@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.