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

Andrew Morton
2008-04-07T22:57:14Z

On Thu, 3 Apr 2008 17:23:29 +0400
Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:

> Provide a generic framework that platform may choose
> to support clocks api. In particular this provides
> platform-independant struct clk definition, a full
> implementation of clocks api and a set of functions
> for registering and unregistering clocks in a safe way.
>
> +static void __maybe_unused clks_unregister(struct clk **clks, size_t num)
> +static int __must_check __maybe_unused clks_register(struct clk **clks, size_t num)
> +static void __maybe_unused clk_free_functions(
> + struct clk_function *funcs,
> + int num)
> +static int __must_check __maybe_unused clk_alloc_functions(
> + struct clk_function *funcs,
> + int num)

What are all these __maybe_unused markers doing here?

> ...
>
> +int __must_check clk_alloc_function(const char *parent, struct clk *clk);

This should be `static int'. I'm surprised the compiler doesn't get
upset.

> + for (i = num - 1; i >= 0; i--) {
> + clk_unregister(&funcs[i].clk);
> + }
>
> ...
>
> + if (rc) {
> + kfree(clk);
> + }

There are a few coding-style glitches in here. Please run
scripts/checkpatch.pl and consider its reportage.