]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PM: EM: Documentation: Fix bug in example code snippet
authorPatrick Little <plittle@gmail.com>
Wed, 28 Jan 2026 22:33:12 +0000 (16:33 -0600)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 30 Jan 2026 19:23:01 +0000 (20:23 +0100)
A semicolon was mistakenly placed at the end of 'if' statements.

If example is copied as-is, it would lead to the subsequent return
being executed unconditionally, which is incorrect, and the rest of the
function would never be reached.

Signed-off-by: Patrick Little <plittle@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
[ rjw: Subject adjustment ]
Link: https://patch.msgid.link/20260128-documentation-fix-grammar-v1-2-39238dc471f9@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Documentation/power/energy-model.rst

index 65133187f2ad4e9601d98d6447749b108d71a46c..0d4644d72767817e879a28c992918ac673fb54ab 100644 (file)
@@ -308,12 +308,12 @@ EM framework::
   05
   06           /* Use the 'foo' protocol to ceil the frequency */
   07           freq = foo_get_freq_ceil(dev, *KHz);
-  08           if (freq < 0);
+  08           if (freq < 0)
   09                   return freq;
   10
   11           /* Estimate the power cost for the dev at the relevant freq. */
   12           power = foo_estimate_power(dev, freq);
-  13           if (power < 0);
+  13           if (power < 0)
   14                   return power;
   15
   16           /* Return the values to the EM framework */