diff mbox series

[v2,2/4] Implement dummy function for SWIG to accept the full library definitions

Message ID 20240827062438.71809-3-jwyatt@redhat.com
State New
Headers show
Series Add SWIG Bindings to libcpupower | expand

Commit Message

John B. Wyatt IV Aug. 27, 2024, 6:24 a.m. UTC
There was a symbol listed in the powercap.h file that was not implemented
that caused SWIG to give a symbol not found error, despite not being
used.

As suggested, implement a dummy function that returns 0 so SWIG accepts
the .o files.

Suggested-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: John B. Wyatt IV <jwyatt@redhat.com>
Signed-off-by: John B. Wyatt IV <sageofredondo@gmail.com>
---

Changes in v2:
	- Implemented the function so SWIG will accept the header
	  definition

---
 tools/power/cpupower/lib/powercap.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/tools/power/cpupower/lib/powercap.c b/tools/power/cpupower/lib/powercap.c
index a7a59c6bacda..94a0c69e55ef 100644
--- a/tools/power/cpupower/lib/powercap.c
+++ b/tools/power/cpupower/lib/powercap.c
@@ -77,6 +77,14 @@  int powercap_get_enabled(int *mode)
 	return sysfs_get_enabled(path, mode);
 }
 
+/*
+ * TODO: implement function. Returns 0 for now.
+ */
+int powercap_set_enabled(int mode)
+{
+	return 0;
+}
+
 /*
  * Hardcoded, because rapl is the only powercap implementation
 - * this needs to get more generic if more powercap implementations