From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] sh: remove bogus highest / lowest logic from clock rate rounding
Date: Fri, 25 Jun 2010 09:19:14 +0000 [thread overview]
Message-ID: <20100625091914.GB3133@linux-sh.org> (raw)
In-Reply-To: <Pine.LNX.4.64.1006250918150.1223@axis700.grange>
On Fri, Jun 25, 2010 at 10:27:23AM +0200, Guennadi Liakhovetski wrote:
> On Fri, 25 Jun 2010, Paul Mundt wrote:
>
> > On Fri, Jun 25, 2010 at 09:19:39AM +0200, Guennadi Liakhovetski wrote:
> > > The use of highest and lowest in clk_rate_table_round() is completely bogus
> > > and superfluous. Remove it.
> > >
> > In what way is it bogus or superfluous? They are there to provide
> > high/low rate bounding when we have no idea what sort of frequencies are
> > available for an underlying clock.
>
> Well, firstly initialising lowest to 0 doesn't make sense - there are no
> unsigned integers below it;) It should have been ~0UL. "No idea" you mean
> when the frequency table is empty? But then the highest / lowest checks
> make even less sense - the function would just return 0 ATM. Otherwise
> what they look like they'd have to do, is: in the loop they find max and
> min clock values. If the requested frequency is below min or above max,
> one of them would be used respectively. But that's already done by the
> minimum error check, unless there's a wrap... Am I missing anything?
>
Yes, the lowest initializer is wrong. I suppose we've just been getting
lucky there. The highest/lowest things are used for bounding when probing
the table for the high/low pairs (ie, rounding down from 0xffffffff and
up from 0). I only have a vague memory of writing the code in question
but seem to recall that the rate error calculation itself was not
sufficient for this. Looking at it again though I don't specifically
remember why, so I'll poke at it with your changes and see how it goes.
Given that the lowest thing is already broken it doesn't seem like much
of a stretch to assume that the rate error calculation is already saving
us.
prev parent reply other threads:[~2010-06-25 9:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-25 7:19 [PATCH] sh: remove bogus highest / lowest logic from clock rate Guennadi Liakhovetski
2010-06-25 7:45 ` [PATCH] sh: remove bogus highest / lowest logic from clock rate rounding Paul Mundt
2010-06-25 8:27 ` [PATCH] sh: remove bogus highest / lowest logic from clock rate Guennadi Liakhovetski
2010-06-25 9:19 ` Paul Mundt [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=20100625091914.GB3133@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=linux-sh@vger.kernel.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.