linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] CLKDEV: return from clk_find as soon as we get maching clk
@ 2010-03-03  6:48 Viresh KUMAR
  2010-03-03 10:33 ` Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Viresh KUMAR @ 2010-03-03  6:48 UTC (permalink / raw)
  To: linux-arm-kernel

clk_find function looks for clock with matching dev_id and con_id.
We should return from clk_find as soon as we get a clock with matching dev_id
and con_id. This can be done by comparing variable "match" with 3.

v2:
	- remove if (match == 0), check.
	- move match==3 in if (match > best) condition

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
 arch/arm/common/clkdev.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c
index aae5bc0..efd53f7 100644
--- a/arch/arm/common/clkdev.c
+++ b/arch/arm/common/clkdev.c
@@ -52,12 +52,13 @@ static struct clk *clk_find(const char *dev_id, const char *con_id)
 				continue;
 			match += 1;
 		}
-		if (match == 0)
-			continue;
 
 		if (match > best) {
 			clk = p->clk;
-			best = match;
+			if (match != 3)
+				best = match;
+			else
+				break;
 		}
 	}
 	return clk;
-- 
1.6.0.2

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

* [PATCH v2] CLKDEV: return from clk_find as soon as we get maching clk
  2010-03-03  6:48 [PATCH v2] CLKDEV: return from clk_find as soon as we get maching clk Viresh KUMAR
@ 2010-03-03 10:33 ` Uwe Kleine-König
  2010-03-03 12:01   ` Viresh KUMAR
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2010-03-03 10:33 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Wed, Mar 03, 2010 at 12:18:27PM +0530, Viresh KUMAR wrote:
> clk_find function looks for clock with matching dev_id and con_id.
> We should return from clk_find as soon as we get a clock with matching dev_id
> and con_id. This can be done by comparing variable "match" with 3.
> 
> v2:
> 	- remove if (match == 0), check.
> 	- move match==3 in if (match > best) condition
can you take the changes since v1 out of the changelog.  They usually go
...
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
> ---
... here.

Does this mean you understood Russell's hint?

Did you test the differences your patch results in for the generated
code?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH v2] CLKDEV: return from clk_find as soon as we get maching clk
  2010-03-03 10:33 ` Uwe Kleine-König
@ 2010-03-03 12:01   ` Viresh KUMAR
  2010-03-04  9:29     ` Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Viresh KUMAR @ 2010-03-03 12:01 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On 3/3/2010 4:03 PM, Uwe Kleine-K?nig wrote:
> On Wed, Mar 03, 2010 at 12:18:27PM +0530, Viresh KUMAR wrote:
>> clk_find function looks for clock with matching dev_id and con_id.
>> We should return from clk_find as soon as we get a clock with matching dev_id
>> and con_id. This can be done by comparing variable "match" with 3.
>>
>> v2:
>> 	- remove if (match == 0), check.
>> 	- move match==3 in if (match > best) condition
> can you take the changes since v1 out of the changelog.  They usually go
> ...

OK.

>>
>> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
>> ---
> Does this mean you understood Russell's hint?

Truly speaking i didn't get it completely, but i think Russsell is 
referring to multiple return points from a function.

Russell, Am I getting it correctly ?

> Did you test the differences your patch results in for the generated
> code?

I think they are essentially same, we now just have a single return point
in the new patch.

regards,
viresh

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

* [PATCH v2] CLKDEV: return from clk_find as soon as we get maching clk
  2010-03-03 12:01   ` Viresh KUMAR
@ 2010-03-04  9:29     ` Uwe Kleine-König
  0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2010-03-04  9:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

> > Does this mean you understood Russell's hint?
> 
> Truly speaking i didn't get it completely, but i think Russsell is 
> referring to multiple return points from a function.
> 
> Russell, Am I getting it correctly ?
> 
> > Did you test the differences your patch results in for the generated
> > code?
> 
> I think they are essentially same, we now just have a single return point
> in the new patch.
Well then,

Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

end of thread, other threads:[~2010-03-04  9:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-03  6:48 [PATCH v2] CLKDEV: return from clk_find as soon as we get maching clk Viresh KUMAR
2010-03-03 10:33 ` Uwe Kleine-König
2010-03-03 12:01   ` Viresh KUMAR
2010-03-04  9:29     ` Uwe Kleine-König

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).