Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpufreq: brcmstb-avs-cpufreq: ISO C90 forbids mixed declarations

There is a compile warning because a NULL pointer check was added before
a struct was declared. This moves the NULL pointer check to after the
struct is declared and moves the struct assignment to after the NULL
pointer check.

Fixes: f661017e6d32 ("cpufreq: brcmstb-avs-cpufreq: add check for cpufreq_cpu_get's return value")
Signed-off-by: Portia Stephens <portia.stephens@canonical.com>
Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

authored by

Portia Stephens and committed by
Viresh Kumar
fa7bd98f 39eaf521

+4 -1
+4 -1
drivers/cpufreq/brcmstb-avs-cpufreq.c
··· 481 481 static unsigned int brcm_avs_cpufreq_get(unsigned int cpu) 482 482 { 483 483 struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); 484 + struct private_data *priv; 485 + 484 486 if (!policy) 485 487 return 0; 486 - struct private_data *priv = policy->driver_data; 488 + 489 + priv = policy->driver_data; 487 490 488 491 cpufreq_cpu_put(policy); 489 492