linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>,
	Mike Turquette <mturquette@linaro.org>,
	Dinh Nguyen <dinh.linux@gmail.com>,
	linux-clk@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC/PATCHv1 1/2] clk: of: helper for filling parent clock array and return num of parents
Date: Tue, 2 Jun 2015 09:16:59 +0200	[thread overview]
Message-ID: <CAMuHMdXeB2Qu83sKbjG_WuT1MaHcrFb-h3TT3wrMHGaG9OAa8w@mail.gmail.com> (raw)
In-Reply-To: <1433195186-14867-2-git-send-email-dinguyen@opensource.altera.com>

On Mon, Jun 1, 2015 at 11:46 PM,  <dinguyen@opensource.altera.com> wrote:
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -3060,6 +3060,26 @@ const char *of_clk_get_parent_name(struct device_node *np, int index)
>  }
>  EXPORT_SYMBOL_GPL(of_clk_get_parent_name);
>
> +/*
> + * of_clk_parent_fill(): Helper clock function that will fill the parent
> + * clock's array and return the number of parents it found.
> + * @np: Device node pointer associated with clock provider
> + * @parents: pointer to char array that hold the parent's name
> + * @size: size of the parents array
> + *
> + * Returns number of parents for the clock node.
> + */
> +int of_clk_parent_fill(struct device_node *np, const char **parents, int size)

I'd say "unsigned int size", but of_clk_get_parent_name(),
of_parse_phandle_with_args(), and of_property_read_string_index() also take
"int" :-(

> +{
> +       int i = 0;

If "size" becomes "unsigned int", "i" should be "unsigned int", too.

> +
> +       while (i < size && (parents[i] = of_clk_get_parent_name(np, i)) != NULL)
> +               i++;
> +
> +       return i;

Return type "int" is OK, though...

> +}

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2015-06-02  7:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 21:46 [RFC/PATCHv1 0/2] clk: of: add helper function to fill parent clock array dinguyen
2015-06-01 21:46 ` [RFC/PATCHv1 1/2] clk: of: helper for filling parent clock array and return num of parents dinguyen
2015-06-02  7:16   ` Geert Uytterhoeven [this message]
2015-06-01 21:46 ` [RFC/PATCHv1 2/2] clk: socfpga: make use of of_clk_parent_fill helper function dinguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdXeB2Qu83sKbjG_WuT1MaHcrFb-h3TT3wrMHGaG9OAa8w@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=dinguyen@opensource.altera.com \
    --cc=dinh.linux@gmail.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=sboyd@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).