Skip to content

Commit

Permalink
cpufreq: brcmstb-avs-cpufreq: ISO C90 forbids mixed declarations
Browse files Browse the repository at this point in the history
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 <portia.stephens@canonical.com>
Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
  • Loading branch information
Portia Stephens authored and Viresh Kumar committed Apr 25, 2024
1 parent 39eaf52 commit fa7bd98
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/cpufreq/brcmstb-avs-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,12 @@ static bool brcm_avs_is_firmware_loaded(struct private_data *priv)
static unsigned int brcm_avs_cpufreq_get(unsigned int cpu)
{
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
struct private_data *priv;

if (!policy)
return 0;
struct private_data *priv = policy->driver_data;

priv = policy->driver_data;

cpufreq_cpu_put(policy);

Expand Down

0 comments on commit fa7bd98

Please sign in to comment.