Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] cpufreq: brcmstb-avs-cpufreq: ISO C90 forbids mixed declarations
@ 2024-04-24  5:02 Portia Stephens
  2024-04-24 15:01 ` Florian Fainelli
  2024-04-25  5:07 ` Viresh Kumar
  0 siblings, 2 replies; 3+ messages in thread
From: Portia Stephens @ 2024-04-24  5:02 UTC (permalink / raw)
  To: mmayer, bcm-kernel-feedback-list, rafael
  Cc: viresh.kumar, florian.fainelli, abelova, linux-pm,
	linux-arm-kernel, linux-kernel, stephensportia

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 delcared 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>
---
 drivers/cpufreq/brcmstb-avs-cpufreq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c
index 1a1857b0a6f4..ea8438550b49 100644
--- a/drivers/cpufreq/brcmstb-avs-cpufreq.c
+++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c
@@ -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);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpufreq: brcmstb-avs-cpufreq: ISO C90 forbids mixed declarations
  2024-04-24  5:02 [PATCH] cpufreq: brcmstb-avs-cpufreq: ISO C90 forbids mixed declarations Portia Stephens
@ 2024-04-24 15:01 ` Florian Fainelli
  2024-04-25  5:07 ` Viresh Kumar
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2024-04-24 15:01 UTC (permalink / raw)
  To: Portia Stephens, mmayer, bcm-kernel-feedback-list, rafael
  Cc: viresh.kumar, abelova, linux-pm, linux-arm-kernel, linux-kernel,
	stephensportia

[-- Attachment #1: Type: text/plain, Size: 1357 bytes --]



On 4/23/2024 10:02 PM, Portia Stephens wrote:
> 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 delcared 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")

No need for a newline between the Fixes: and Signed-off-by: tags, FWIW

> 
> Signed-off-by: Portia Stephens <portia.stephens@canonical.com>

Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>

> ---
>   drivers/cpufreq/brcmstb-avs-cpufreq.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c
> index 1a1857b0a6f4..ea8438550b49 100644
> --- a/drivers/cpufreq/brcmstb-avs-cpufreq.c
> +++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c
> @@ -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);
>   

-- 
Florian

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpufreq: brcmstb-avs-cpufreq: ISO C90 forbids mixed declarations
  2024-04-24  5:02 [PATCH] cpufreq: brcmstb-avs-cpufreq: ISO C90 forbids mixed declarations Portia Stephens
  2024-04-24 15:01 ` Florian Fainelli
@ 2024-04-25  5:07 ` Viresh Kumar
  1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2024-04-25  5:07 UTC (permalink / raw)
  To: Portia Stephens
  Cc: mmayer, bcm-kernel-feedback-list, rafael, florian.fainelli,
	abelova, linux-pm, linux-arm-kernel, linux-kernel, stephensportia

On 24-04-24, 15:02, Portia Stephens wrote:
> 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 delcared and moves the struct assignment to after the NULL

            declared

> 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>
> ---
>  drivers/cpufreq/brcmstb-avs-cpufreq.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Applied. Thanks.

-- 
viresh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-25  5:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-24  5:02 [PATCH] cpufreq: brcmstb-avs-cpufreq: ISO C90 forbids mixed declarations Portia Stephens
2024-04-24 15:01 ` Florian Fainelli
2024-04-25  5:07 ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox