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] [day] [month] [year] [list]
Message-ID: <CAMuHMdXeB2Qu83sKbjG_WuT1MaHcrFb-h3TT3wrMHGaG9OAa8w@mail.gmail.com>
Date:	Tue, 2 Jun 2015 09:16:59 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Dinh Nguyen <dinguyen@...nsource.altera.com>
Cc:	Stephen Boyd <sboyd@...eaurora.org>,
	Mike Turquette <mturquette@...aro.org>,
	Dinh Nguyen <dinh.linux@...il.com>, linux-clk@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC/PATCHv1 1/2] clk: of: helper for filling parent clock array
 and return num of parents

On Mon, Jun 1, 2015 at 11:46 PM,  <dinguyen@...nsource.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@...ux-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
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ