[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080331145515.GA10969@atrey.karlin.mff.cuni.cz>
Date: Mon, 31 Mar 2008 16:55:16 +0200
From: Pavel Machek <pavel@....cz>
To: Dmitry Baryshkov <dbaryshkov@...il.com>
Cc: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
Haavard Skinnemoen <haavard.skinnemoen@...el.com>,
Russell King <rmk+lkml@....linux.org.uk>,
Paul Mundt <lethal@...ux-sh.org>,
pHilipp Zabel <philipp.zabel@...il.com>, tony@...mide.com,
paul@...an.com
Subject: Re: [PATCH 1/6] Clocklib: add generic framework for managing clocks.
> +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--;"
> + clk_unregister(clks[i]);
> + }
> +
> + return ret;
Hmm, clk_unregister is _very_ similar to clks_unregister....
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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