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:   Thu, 13 Apr 2017 22:02:25 +0800
From:   Dong Aisheng <dongas86@...il.com>
To:     Leonard Crestez <leonard.crestez@....com>
Cc:     Dong Aisheng <aisheng.dong@....com>, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, kernel@...gutronix.de,
        broonie@...nel.org, yibin.gong@....com, rjw@...ysocki.net,
        viresh.kumar@...aro.org, mturquette@...libre.com,
        sboyd@...eaurora.org, shawnguo@...nel.org, fabio.estevam@....com,
        anson.huang@....com, ping.bai@....com, octavian.purdila@....com,
        linux-clk@...r.kernel.org
Subject: Re: [RFC PATCH 1/3] clk: add clk_bulk_get accessories

On Tue, Apr 11, 2017 at 08:19:19PM +0300, Leonard Crestez wrote:
> On Wed, 2017-04-12 at 12:03 +0800, Dong Aisheng wrote:
> > +/**
> > + * clk_bulk_enable - ungate a bulk of clocks
> > + * @num_clks: the number of clk_bulk_data
> > + * @clks: the clk_bulk_data table being ungated
> > + *
> > + * clk_bulk_enable must not sleep
> > + * Returns 0 on success, -EERROR otherwise.
> > + */
> > +int clk_bulk_enable(int num_clks, struct clk_bulk_data *clks)
> > +{
> > +       int ret;
> > +       int i;
> > +
> > +       for (i = 0; i < num_clks; i++) {
> > +               ret = clk_enable(clks[i].clk);
> > +               if (ret) {
> > +                       pr_err("Failed to enable clk '%s': %d\n",
> > +                               clks[i].id, ret);
> > +                       goto err;
> > +               }
> > +       }
> > +
> > +       return 0;
> > +
> > +err:
> > +       while (--i >= 0)
> > +               clk_put(clks[i].clk);
> 
> Shouldn't this be clk_disable?
> 

Good catch!
Will change in the formal version if Maintainer accepts this idea.

> And you can probably use clk_bulk_disable(i, clks) instead

Probably i'd prefer keep clk_disable to match with clk_enable
to make things more clear.

Thanks

Regards
Dong Aisheng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ