lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251020084429.230322-2-changwoo@igalia.com>
Date: Mon, 20 Oct 2025 17:44:29 +0900
From: Changwoo Min <changwoo@...lia.com>
To: lukasz.luba@....com,
	rafael@...nel.org,
	len.brown@...el.com,
	pavel@...nel.org
Cc: christian.loehle@....com,
	tj@...nel.org,
	kernel-dev@...lia.com,
	linux-pm@...r.kernel.org,
	sched-ext@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	Changwoo Min <changwoo@...lia.com>,
	kernel test robot <lkp@...el.com>
Subject: [PATCH 2/2] PM: EM: Include the iterator/accessor code for the performance domain conditionally

When CONFIG_ENERGY_MODEL is set but CONFIG_NET is not set, the following
errors are raised:

>> kernel/power/energy_model.c:1003:5: error: redefinition of
   'for_each_em_perf_domain'

>> kernel/power/energy_model.c:1022:24: error: redefinition of
   'em_perf_domain_get_by_id'

That is because these two functions are defined in em_netlink.h (empty
function body) and energy_model.c (actual implementation).

To avoid the compilation errors, conditionally include the actual function
implementations in energy_model.c when both CONFIG_ENERGY_MODEL and
CONFIG_NET are set.

Reported-by: kernel test robot <lkp@...el.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202510151232.UNZ2J7TZ-lkp@intel.com/
Signed-off-by: Changwoo Min <changwoo@...lia.com>
---
 kernel/power/energy_model.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
index 92c12b5983ed..e669d5057fca 100644
--- a/kernel/power/energy_model.c
+++ b/kernel/power/energy_model.c
@@ -1006,6 +1006,7 @@ void em_rebuild_sched_domains(void)
 	schedule_work(&rebuild_sd_work);
 }
 
+#if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_NET)
 int for_each_em_perf_domain(int (*cb)(struct em_perf_domain*, void *),
 			    void *data)
 {
@@ -1039,3 +1040,4 @@ struct em_perf_domain *em_perf_domain_get_by_id(int id)
 
 	return NULL;
 }
+#endif
-- 
2.51.1.dirty


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ