From: Mason <slash.tmp@free.fr>
To: Stephen Boyd <sboyd@codeaurora.org>,
Michael Turquette <mturquette@baylibre.com>
Cc: linux-clk@vger.kernel.org, Chen-Yu Tsai <wens@csie.org>,
Maxime Ripard <maxime.ripard@free-electrons.com>
Subject: Re: [PATCH] clk: sunxi: Remove use of VLAIS
Date: Tue, 8 Mar 2016 13:26:30 +0100 [thread overview]
Message-ID: <56DEC4F6.1090107@free.fr> (raw)
In-Reply-To: <1456878048-23393-1-git-send-email-sboyd@codeaurora.org>
On 02/03/2016 01:20, Stephen Boyd wrote:
> Using an array allocated on the stack may lead to stack overflows
> and other problems. Furthermore, VLAIS doesn't work well with
> LLVM compilers, so move the allocation to the heap and avoid the
> use of VLAIS here.
What are the symptoms of LLVM's incomplete support?
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
> drivers/clk/sunxi/clk-sun8i-mbus.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/sunxi/clk-sun8i-mbus.c b/drivers/clk/sunxi/clk-sun8i-mbus.c
> index 3aaa9cbef791..8e7128e69823 100644
> --- a/drivers/clk/sunxi/clk-sun8i-mbus.c
> +++ b/drivers/clk/sunxi/clk-sun8i-mbus.c
> @@ -33,7 +33,7 @@ static DEFINE_SPINLOCK(sun8i_a23_mbus_lock);
> static void __init sun8i_a23_mbus_setup(struct device_node *node)
> {
> int num_parents = of_clk_get_parent_count(node);
> - const char *parents[num_parents];
> + const char **parents;
Is num_parents ever greater than 8?
Dynamically allocating such a small array seems wasteful.
const char *parents[8]; /* 32 bytes on Cortex A7 */
if (num_parents >= 8) return EINVAL;
... rest of the code unchanged ...
Regards.
next prev parent reply other threads:[~2016-03-08 12:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 19:48 [GIT PULL] arm: Allwinner clocks changes for 4.6 Maxime Ripard
2016-03-02 0:20 ` [PATCH] clk: sunxi: Remove use of VLAIS Stephen Boyd
2016-03-03 18:07 ` Chen-Yu Tsai
2016-03-03 19:16 ` Stephen Boyd
2016-03-04 15:27 ` Maxime Ripard
2016-03-04 17:18 ` Stephen Boyd
2016-03-08 22:13 ` Maxime Ripard
2016-03-15 22:16 ` Stephen Boyd
2016-03-16 8:51 ` Mason
2016-03-16 20:30 ` Stephen Boyd
2016-03-16 20:44 ` Mason
2016-03-18 17:47 ` Maxime Ripard
2016-03-08 12:26 ` Mason [this message]
2016-03-02 1:46 ` [GIT PULL] arm: Allwinner clocks changes for 4.6 Stephen Boyd
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=56DEC4F6.1090107@free.fr \
--to=slash.tmp@free.fr \
--cc=linux-clk@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
--cc=mturquette@baylibre.com \
--cc=sboyd@codeaurora.org \
--cc=wens@csie.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).