Skip to content

Commit fa7bd98

Browse files
Portia Stephensvireshk
authored andcommitted
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: f661017 ("cpufreq: brcmstb-avs-cpufreq: add check for cpufreq_cpu_get's return value") Signed-off-by: Portia Stephens <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent 39eaf52 commit fa7bd98

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/cpufreq/brcmstb-avs-cpufreq.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,12 @@ static bool brcm_avs_is_firmware_loaded(struct private_data *priv)
481481
static unsigned int brcm_avs_cpufreq_get(unsigned int cpu)
482482
{
483483
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
484+
struct private_data *priv;
485+
484486
if (!policy)
485487
return 0;
486-
struct private_data *priv = policy->driver_data;
488+
489+
priv = policy->driver_data;
487490

488491
cpufreq_cpu_put(policy);
489492

0 commit comments

Comments
 (0)