CLKDEV: return from clk_find as soon as we get maching clk
PATCH v2 1/1 CLKDEV: return from clk_find as soon as we get maching clk
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
--- arch/arm/common/clkdev.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
arch/arm/common/clkdev.c +4 -3
@@ -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;
Signature · 1 line
1.6.0.2
PATCH v2 1/1 CLKDEV: return from clk_find as soon as we get maching clk
Hello,
Quoted 7 lines · Viresh KUMAR
clk_findfunction looks for clock with matchingdev_idandcon_id. We should return fromclk_findas soon as we get a clock with matchingdev_idandcon_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
...
Quoted 3 lines
Signed-off-by Viresh Kumar <[email protected]>---
... 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
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH v2 1/1 CLKDEV: return from clk_find as soon as we get maching clk
Hello,
Quoted 10 lines · Uwe Kleine-K?nig
Quoted 7 lines · Viresh KUMAR
clk_findfunction looks for clock with matchingdev_idandcon_id. We should return fromclk_findas soon as we get a clock with matchingdev_idandcon_id. This can be done by comparing variable "match" with 3.v2:
- remove if (match == 0), check.
- move match==3 in if (match > best) conditioncan you take the changes since v1 out of the changelog. They usually go
...
OK.
Quoted 4 lines
Quoted 3 lines
Signed-off-by Viresh Kumar <[email protected]>---
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 ?
Quoted 2 lines
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
PATCH v2 1/1 CLKDEV: return from clk_find as soon as we get maching clk
Hello,
Quoted 5 lines
Quoted 1 line
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.
Quoted 7 lines
Russell, Am I getting it correctly ?
Quoted 2 lines
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,
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |