lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 27 May 2015 21:09:19 -0700
From:	Michael Turquette <mturquette@...aro.org>
To:	Dong Aisheng <aisheng.dong@...escale.com>,
	linux-clk@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, sboyd@...eaurora.org,
	shawn.guo@...aro.org, b29396@...escale.com,
	linux-arm-kernel@...ts.infradead.org,
	Ranjani.Vaidyanathan@...escale.com, b20596@...escale.com,
	r64343@...escale.com, b20788@...escale.com
Subject: Re: [PATCH v2 1/5] clk: remove duplicated code with __clk_set_parent_after

Quoting Dong Aisheng (2015-05-14 06:28:59)
> __clk_set_parent_after() actually used the second argument then we
> could put this duplicate logic in there and call it with a different
> order of arguments in the success vs. error paths in this function.
> 
> Cc: Mike Turquette <mturquette@...aro.org>
> Cc: Stephen Boyd <sboyd@...eaurora.org>
> Suggested-by: Stephen Boyd <sboyd@...eaurora.org>
> Signed-off-by: Dong Aisheng <aisheng.dong@...escale.com>

Patch looks good to me.

Also just noticed that the second argument to __clk_set_parent_after is
never used :-(

Regards,
Mike

> ---
>  drivers/clk/clk.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 659f2b0..0e813ea 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -1159,14 +1159,8 @@ static int __clk_set_parent(struct clk_core *core, struct clk_core *parent,
>                 flags = clk_enable_lock();
>                 clk_reparent(core, old_parent);
>                 clk_enable_unlock(flags);
> +               __clk_set_parent_after(core, old_parent, parent);
>  
> -               if (core->prepare_count) {
> -                       flags = clk_enable_lock();
> -                       clk_core_disable(core);
> -                       clk_core_disable(parent);
> -                       clk_enable_unlock(flags);
> -                       clk_core_unprepare(parent);
> -               }
>                 return ret;
>         }
>  
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ