* [PATCH] cpufreq: armada-8k: make both cpu masks static
@ 2025-06-20 11:14 Arnd Bergmann
2025-06-23 5:23 ` Viresh Kumar
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2025-06-20 11:14 UTC (permalink / raw)
To: Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Rafael J. Wysocki, Viresh Kumar, Rob Herring (Arm)
Cc: Arnd Bergmann, Jacky Bai, Sudeep Holla, linux-arm-kernel,
linux-pm, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
An earlier patch marked one of the two CPU masks as 'static' to reduce stack
usage, but if CONFIG_NR_CPUS is large enough, the function still produces
a warning for compile testing:
drivers/cpufreq/armada-8k-cpufreq.c: In function 'armada_8k_cpufreq_init':
drivers/cpufreq/armada-8k-cpufreq.c:203:1: error: the frame size of 1416 bytes is larger than 1408 bytes [-Werror=frame-larger-than=]
Normally this should be done using alloc_cpumask_var(), but since the
driver already has a static mask and the probe function is not called
concurrently, use the same trick for both.
Fixes: 1ffec650d07f ("cpufreq: armada-8k: Avoid excessive stack usage")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/cpufreq/armada-8k-cpufreq.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/cpufreq/armada-8k-cpufreq.c b/drivers/cpufreq/armada-8k-cpufreq.c
index 5a3545bd0d8d..006f4c554dd7 100644
--- a/drivers/cpufreq/armada-8k-cpufreq.c
+++ b/drivers/cpufreq/armada-8k-cpufreq.c
@@ -132,7 +132,7 @@ static int __init armada_8k_cpufreq_init(void)
int ret = 0, opps_index = 0, cpu, nb_cpus;
struct freq_table *freq_tables;
struct device_node *node;
- static struct cpumask cpus;
+ static struct cpumask cpus, shared_cpus;
node = of_find_matching_node_and_match(NULL, armada_8k_cpufreq_of_match,
NULL);
@@ -154,7 +154,6 @@ static int __init armada_8k_cpufreq_init(void)
* divisions of it).
*/
for_each_cpu(cpu, &cpus) {
- struct cpumask shared_cpus;
struct device *cpu_dev;
struct clk *clk;
--
2.39.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cpufreq: armada-8k: make both cpu masks static
2025-06-20 11:14 [PATCH] cpufreq: armada-8k: make both cpu masks static Arnd Bergmann
@ 2025-06-23 5:23 ` Viresh Kumar
0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2025-06-23 5:23 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Rafael J. Wysocki, Rob Herring (Arm), Arnd Bergmann, Jacky Bai,
Sudeep Holla, linux-arm-kernel, linux-pm, linux-kernel
On 20-06-25, 13:14, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> An earlier patch marked one of the two CPU masks as 'static' to reduce stack
> usage, but if CONFIG_NR_CPUS is large enough, the function still produces
> a warning for compile testing:
>
> drivers/cpufreq/armada-8k-cpufreq.c: In function 'armada_8k_cpufreq_init':
> drivers/cpufreq/armada-8k-cpufreq.c:203:1: error: the frame size of 1416 bytes is larger than 1408 bytes [-Werror=frame-larger-than=]
>
> Normally this should be done using alloc_cpumask_var(), but since the
> driver already has a static mask and the probe function is not called
> concurrently, use the same trick for both.
>
> Fixes: 1ffec650d07f ("cpufreq: armada-8k: Avoid excessive stack usage")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/cpufreq/armada-8k-cpufreq.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Applied. Thanks.
--
viresh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-23 5:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-20 11:14 [PATCH] cpufreq: armada-8k: make both cpu masks static Arnd Bergmann
2025-06-23 5:23 ` Viresh Kumar
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).