Re: [PATCH 1/6] Clocklib: add generic framework for managing clocks.

From: Dmitry
Date: Mon Mar 31 2008 - 12:19:19 EST


2008/3/31, Pavel Machek <pavel@xxxxxx>:
>
> > +int __must_check clk_register(struct clk *clk);
> > +void clk_unregister(struct clk *clk);
> > +static void __maybe_unused clks_unregister(struct clk **clks, size_t num)
> > +{
> > + int i;
> > + for (i = num - 1; i >= 0; i++) {
> > + clk_unregister(clks[i]);
> > + }
> > +}
> > +
> > +static int __must_check __maybe_unused clks_register(struct clk **clks, size_t num)
> > +{
> > + int i;
> > + int ret;
> > + for (i = 0; i < num; i++) {
> > + ret = clk_register(clks[i]);
> > + if (ret != 0)
> > + goto cleanup;
> > + }
> > +
> > + return 0;
> > +
> > +cleanup:
> > + clks_unregister(clks, i);
> > +
> > + for (i -- ; i >= 0; i--) {
>
>
> "for (i--;"

ack

>
> > + clk_unregister(clks[i]);
> > + }
> > +
> > + return ret;
>
>
> Hmm, clk_unregister is _very_ similar to clks_unregister....

oops :)

--
With best wishes
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/