Skip to contentSkip to conversation

Documentation: EM: Fix typos in example driver code

PATCH In review Atul Kumar Pant 2 participants 2 messages May 11, 2025 – May 22, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: EM: Fix typos in example driver code

Fix the API name to free the allocated table in the example driver code that modifies the EM. Also fix the passing of correct table when updating the cost.

---
 Documentation/power/energy-model.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/power/energy-model.rst +3 -3
index ada4938c3..29388f6d1 100644
@@ -381,17 +381,17 @@ up periodically to check the temperature and modify the EM data::
   26		rcu_read_unlock();
   27
   28		/* Calculate 'cost' values for EAS */
-  29		ret = em_dev_compute_costs(dev, table, pd->nr_perf_states);
+  29		ret = em_dev_compute_costs(dev, new_table, pd->nr_perf_states);
   30		if (ret) {
   31			dev_warn(dev, "EM: compute costs failed %d\n", ret);
-  32			em_free_table(em_table);
+  32			em_table_free(em_table);
   33			return;
   34		}
   35
   36		ret = em_dev_update_perf_domain(dev, em_table);
   37		if (ret) {
   38			dev_warn(dev, "EM: update failed %d\n", ret);
-  39			em_free_table(em_table);
+  39			em_table_free(em_table);
   40			return;
   41		}
   42
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Atul Kumar Pant

Fix the API name to free the allocated table in the example driver code that modifies the EM. Also fix the passing of correct table when updating the cost.

---
  Documentation/power/energy-model.rst | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/power/energy-model.rst +2 -2
index ada4938c3..29388f6d1 100644
@@ -381,17 +381,17 @@ up periodically to check the temperature and modify the EM data::
    26		rcu_read_unlock();
    27
    28		/* Calculate 'cost' values for EAS */
-  29		ret = em_dev_compute_costs(dev, table, pd->nr_perf_states);
+  29		ret = em_dev_compute_costs(dev, new_table, pd->nr_perf_states);
    30		if (ret) {
    31			dev_warn(dev, "EM: compute costs failed %d\n", ret);
-  32			em_free_table(em_table);
+  32			em_table_free(em_table);
    33			return;

Documentation/power/energy-model.rst up periodically to check the temperature and modify the EM data:: · line 397

Quoted 10 lines
Documentation/power/energy-model.rst +1 -1
    34		}
    35
    36		ret = em_dev_update_perf_domain(dev, em_table);
    37		if (ret) {
    38			dev_warn(dev, "EM: update failed %d\n", ret);
-  39			em_free_table(em_table);
+  39			em_table_free(em_table);
    40			return;
    41		}
    42

Thanks for having a look at this, LGTM.