From 313312c84b42d7b8ee1fb03ab30befc2bd0db211 Mon Sep 17 00:00:00 2001 From: Min-Hua Chen Date: Sat, 14 Sep 2024 04:17:02 +0800 Subject: [PATCH 1/2] pm: cpupower: rename raw_pylibcpupower.i The raw_pylibcpupower.i is removed unexpectedly after 'make mrproper' We can reproduce the error by performing the following steps: cd linux-next make mrproper cd tools/power/cpupower/bindings/python make We will get an error message: make: *** No rule to make target 'raw_pylibcpupower.i', needed by 'raw_pylibcpupower_wrap.c'. Stop. The root cause: The *.i files are already used for pre-processor output files and the kernel removes all the *.i files by 'make mrproper'. That explains why the raw_pylibcpupower.i is removed by 'make mrproper'. To fix it, Follow John's suggestion to rename raw_pylibcpupower.i to raw_pylibcpupower.swg. See: https://www.swig.org/Doc4.2/SWIG.html Reviewed-by: John B. Wyatt IV Reviewed-by: John B. Wyatt IV Tested-by: John B. Wyatt IV Tested-by: John B. Wyatt IV Signed-off-by: Min-Hua Chen Signed-off-by: Shuah Khan --- tools/power/cpupower/bindings/python/Makefile | 4 ++-- .../python/{raw_pylibcpupower.i => raw_pylibcpupower.swg} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename tools/power/cpupower/bindings/python/{raw_pylibcpupower.i => raw_pylibcpupower.swg} (100%) diff --git a/tools/power/cpupower/bindings/python/Makefile b/tools/power/cpupower/bindings/python/Makefile index dc09c5b66ead..e1ebb1d60cd4 100644 --- a/tools/power/cpupower/bindings/python/Makefile +++ b/tools/power/cpupower/bindings/python/Makefile @@ -20,13 +20,13 @@ _raw_pylibcpupower.so: raw_pylibcpupower_wrap.o raw_pylibcpupower_wrap.o: raw_pylibcpupower_wrap.c $(CC) -fPIC -c raw_pylibcpupower_wrap.c $(PY_INCLUDE) -raw_pylibcpupower_wrap.c: raw_pylibcpupower.i +raw_pylibcpupower_wrap.c: raw_pylibcpupower.swg ifeq ($(HAVE_SWIG),0) $(error "swig was not found. Make sure you have it installed and in the PATH to generate the bindings.") else ifeq ($(HAVE_PYCONFIG),0) $(error "python-config was not found. Make sure you have it installed and in the PATH to generate the bindings.") endif - swig -python raw_pylibcpupower.i + swig -python raw_pylibcpupower.swg # Will only clean the bindings folder; will not clean the actual cpupower folder clean: diff --git a/tools/power/cpupower/bindings/python/raw_pylibcpupower.i b/tools/power/cpupower/bindings/python/raw_pylibcpupower.swg similarity index 100% rename from tools/power/cpupower/bindings/python/raw_pylibcpupower.i rename to tools/power/cpupower/bindings/python/raw_pylibcpupower.swg From 6c56fb4434f59df9c777eded5f77cc812882cef3 Mon Sep 17 00:00:00 2001 From: "John B. Wyatt IV" Date: Thu, 19 Sep 2024 15:56:24 -0400 Subject: [PATCH 2/2] pm: cpupower: Clean up bindings gitignore Add SPDX identifier to the gitignore. Remove the comment and .i file since the file it references was removed in another patch. This patch depends on Min-Hua Chen's 'pm: cpupower: rename raw_pylibcpupower.i'. Signed-off-by: John B. Wyatt IV Signed-off-by: John B. Wyatt IV Signed-off-by: Shuah Khan --- tools/power/cpupower/bindings/python/.gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/power/cpupower/bindings/python/.gitignore b/tools/power/cpupower/bindings/python/.gitignore index 5c9a1f0212dd..51cbb8799c44 100644 --- a/tools/power/cpupower/bindings/python/.gitignore +++ b/tools/power/cpupower/bindings/python/.gitignore @@ -1,8 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0-only __pycache__/ raw_pylibcpupower_wrap.c *.o *.so *.py !test_raw_pylibcpupower.py -# git keeps ignoring this file, use git add -f raw_libcpupower.i -!raw_pylibcpupower.i