diff mbox series

PM: EM: Fix nr_states warnings in static checks

Message ID 20240221142550.1814055-1-lukasz.luba@arm.com (mailing list archive)
State In Next
Delegated to: Rafael Wysocki
Headers show
Series PM: EM: Fix nr_states warnings in static checks | expand

Commit Message

Lukasz Luba Feb. 21, 2024, 2:25 p.m. UTC
During the static checks nr_states has been mentioned by the kernel test
robot. Fix the warning in those 2 places.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
---
 kernel/power/energy_model.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Rafael J. Wysocki Feb. 22, 2024, 7:26 p.m. UTC | #1
On Wed, Feb 21, 2024 at 3:25 PM Lukasz Luba <lukasz.luba@arm.com> wrote:
>
> During the static checks nr_states has been mentioned by the kernel test
> robot. Fix the warning in those 2 places.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
> ---
>  kernel/power/energy_model.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
> index 7101fa3fa0c0..b686ac0345bd 100644
> --- a/kernel/power/energy_model.c
> +++ b/kernel/power/energy_model.c
> @@ -280,6 +280,7 @@ static int em_compute_costs(struct device *dev, struct em_perf_state *table,
>   * em_dev_compute_costs() - Calculate cost values for new runtime EM table
>   * @dev                : Device for which the EM table is to be updated
>   * @table      : The new EM table that is going to get the costs calculated
> + * @nr_states  : Number of performance states
>   *
>   * Calculate the em_perf_state::cost values for new runtime EM table. The
>   * values are used for EAS during task placement. It also calculates and sets
> @@ -728,7 +729,6 @@ static void em_check_capacity_update(void)
>                 struct cpufreq_policy *policy;
>                 unsigned long em_max_perf;
>                 struct device *dev;
> -               int nr_states;
>
>                 if (cpumask_test_cpu(cpu, cpu_done_mask))
>                         continue;
> @@ -749,7 +749,6 @@ static void em_check_capacity_update(void)
>                 cpumask_or(cpu_done_mask, cpu_done_mask,
>                            em_span_cpus(pd));
>
> -               nr_states = pd->nr_perf_states;
>                 cpu_capacity = arch_scale_cpu_capacity(cpu);
>
>                 rcu_read_lock();
> --

Applied, thanks!
diff mbox series

Patch

diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
index 7101fa3fa0c0..b686ac0345bd 100644
--- a/kernel/power/energy_model.c
+++ b/kernel/power/energy_model.c
@@ -280,6 +280,7 @@  static int em_compute_costs(struct device *dev, struct em_perf_state *table,
  * em_dev_compute_costs() - Calculate cost values for new runtime EM table
  * @dev		: Device for which the EM table is to be updated
  * @table	: The new EM table that is going to get the costs calculated
+ * @nr_states	: Number of performance states
  *
  * Calculate the em_perf_state::cost values for new runtime EM table. The
  * values are used for EAS during task placement. It also calculates and sets
@@ -728,7 +729,6 @@  static void em_check_capacity_update(void)
 		struct cpufreq_policy *policy;
 		unsigned long em_max_perf;
 		struct device *dev;
-		int nr_states;
 
 		if (cpumask_test_cpu(cpu, cpu_done_mask))
 			continue;
@@ -749,7 +749,6 @@  static void em_check_capacity_update(void)
 		cpumask_or(cpu_done_mask, cpu_done_mask,
 			   em_span_cpus(pd));
 
-		nr_states = pd->nr_perf_states;
 		cpu_capacity = arch_scale_cpu_capacity(cpu);
 
 		rcu_read_lock();