From: Dan Carpenter <dan.carpenter@oracle.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [patch] clk: vt8500: several forever loops
Date: Wed, 02 Apr 2014 11:26:53 +0000 [thread overview]
Message-ID: <20140402112653.GK18506@mwanda> (raw)
In-Reply-To: <CAKv+Gu9R7Y5OKy+P62FAyE2_zf7f=reiLQy-++XziXahbSM15A@mail.gmail.com>
On Wed, Apr 02, 2014 at 01:19:19PM +0200, Ard Biesheuvel wrote:
> On 2 April 2014 13:04, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > This patch is still needed in linux-next. It was Acked by Tony Prisk in
> > a private email.
> >
> > Acked-by: Tony Prisk <linux@prisktech.co.nz>
> >
> > regards,
> > dan carpenter
> >
> > On Mon, Aug 26, 2013 at 07:02:33PM +0300, Dan Carpenter wrote:
> >> This does a bunch of looping like this:
> >>
> >> for (div2 = 7; div2 >= 0; div2--)
> >>
> >> But unsigned values are always greater than or equal to zero so it just
> >> loops and loops. Really "mul", "div1" and "div2" should all be declared
> >> as int for cleanliness sake.
> >>
>
> Apologies if this is a silly question from someone who is utterly
> uninformed, but are values = 0 even legal for divisors?
> It seems that, at least in some cases, 'div - 1' is or'ed into a
> register value (WM8850_BITS_TO_VAL), and I don't think you are
> expecting negative values there.
> So perhaps instead, change the test to '> 0' ??
Those seem like totally valid points. The truth is that I almost am
"utterly uninformed" about this code. Perhaps someone who knows more
than the both of us could take a look?
Please give Ard and me reported by tags when you fix this.
regards,
dan carpenter
WARNING: multiple messages have this Message-ID (diff)
From: dan.carpenter@oracle.com (Dan Carpenter)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch] clk: vt8500: several forever loops
Date: Wed, 2 Apr 2014 14:26:53 +0300 [thread overview]
Message-ID: <20140402112653.GK18506@mwanda> (raw)
In-Reply-To: <CAKv+Gu9R7Y5OKy+P62FAyE2_zf7f=reiLQy-++XziXahbSM15A@mail.gmail.com>
On Wed, Apr 02, 2014 at 01:19:19PM +0200, Ard Biesheuvel wrote:
> On 2 April 2014 13:04, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > This patch is still needed in linux-next. It was Acked by Tony Prisk in
> > a private email.
> >
> > Acked-by: Tony Prisk <linux@prisktech.co.nz>
> >
> > regards,
> > dan carpenter
> >
> > On Mon, Aug 26, 2013 at 07:02:33PM +0300, Dan Carpenter wrote:
> >> This does a bunch of looping like this:
> >>
> >> for (div2 = 7; div2 >= 0; div2--)
> >>
> >> But unsigned values are always greater than or equal to zero so it just
> >> loops and loops. Really "mul", "div1" and "div2" should all be declared
> >> as int for cleanliness sake.
> >>
>
> Apologies if this is a silly question from someone who is utterly
> uninformed, but are values == 0 even legal for divisors?
> It seems that, at least in some cases, 'div - 1' is or'ed into a
> register value (WM8850_BITS_TO_VAL), and I don't think you are
> expecting negative values there.
> So perhaps instead, change the test to '> 0' ??
Those seem like totally valid points. The truth is that I almost am
"utterly uninformed" about this code. Perhaps someone who knows more
than the both of us could take a look?
Please give Ard and me reported by tags when you fix this.
regards,
dan carpenter
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Mike Turquette <mturquette@linaro.org>,
kernel-janitors@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [patch] clk: vt8500: several forever loops
Date: Wed, 2 Apr 2014 14:26:53 +0300 [thread overview]
Message-ID: <20140402112653.GK18506@mwanda> (raw)
In-Reply-To: <CAKv+Gu9R7Y5OKy+P62FAyE2_zf7f=reiLQy-++XziXahbSM15A@mail.gmail.com>
On Wed, Apr 02, 2014 at 01:19:19PM +0200, Ard Biesheuvel wrote:
> On 2 April 2014 13:04, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > This patch is still needed in linux-next. It was Acked by Tony Prisk in
> > a private email.
> >
> > Acked-by: Tony Prisk <linux@prisktech.co.nz>
> >
> > regards,
> > dan carpenter
> >
> > On Mon, Aug 26, 2013 at 07:02:33PM +0300, Dan Carpenter wrote:
> >> This does a bunch of looping like this:
> >>
> >> for (div2 = 7; div2 >= 0; div2--)
> >>
> >> But unsigned values are always greater than or equal to zero so it just
> >> loops and loops. Really "mul", "div1" and "div2" should all be declared
> >> as int for cleanliness sake.
> >>
>
> Apologies if this is a silly question from someone who is utterly
> uninformed, but are values == 0 even legal for divisors?
> It seems that, at least in some cases, 'div - 1' is or'ed into a
> register value (WM8850_BITS_TO_VAL), and I don't think you are
> expecting negative values there.
> So perhaps instead, change the test to '> 0' ??
Those seem like totally valid points. The truth is that I almost am
"utterly uninformed" about this code. Perhaps someone who knows more
than the both of us could take a look?
Please give Ard and me reported by tags when you fix this.
regards,
dan carpenter
next prev parent reply other threads:[~2014-04-02 11:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-26 16:02 [patch] clk: vt8500: several forever loops Dan Carpenter
2013-08-26 16:02 ` Dan Carpenter
2013-08-26 16:02 ` Dan Carpenter
2014-04-02 11:04 ` Dan Carpenter
2014-04-02 11:04 ` Dan Carpenter
2014-04-02 11:04 ` Dan Carpenter
2014-04-02 11:19 ` Ard Biesheuvel
2014-04-02 11:19 ` Ard Biesheuvel
2014-04-02 11:19 ` Ard Biesheuvel
2014-04-02 11:26 ` Dan Carpenter [this message]
2014-04-02 11:26 ` Dan Carpenter
2014-04-02 11:26 ` Dan Carpenter
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=20140402112653.GK18506@mwanda \
--to=dan.carpenter@oracle.com \
--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.