From 8219937eae8a4ef90351f2982bb9af98d8f65238 Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Tue, 16 Jul 2024 15:21:47 +0800 Subject: [PATCH] Update to release 0.0.6 - Update to release 0.0.6 - A patch fixed the compiler "above array bound" error Resolves: RHEL-45136 --- .gitignore | 1 + ...Fix-compiler-above-array-bound-error.patch | 51 +++++++++++++++++++ 22.patch | 32 ------------ intel-lpmd.spec | 13 +++-- sources | 2 +- 5 files changed, 61 insertions(+), 38 deletions(-) create mode 100644 0001-lpmd_cpu-Fix-compiler-above-array-bound-error.patch delete mode 100644 22.patch diff --git a/.gitignore b/.gitignore index e7cf50c..0919bcb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /intel-lpmd-0.0.2.tar.gz /intel-lpmd-0.0.3.tar.gz +/intel-lpmd-0.0.6.tar.gz diff --git a/0001-lpmd_cpu-Fix-compiler-above-array-bound-error.patch b/0001-lpmd_cpu-Fix-compiler-above-array-bound-error.patch new file mode 100644 index 0000000..e24985d --- /dev/null +++ b/0001-lpmd_cpu-Fix-compiler-above-array-bound-error.patch @@ -0,0 +1,51 @@ +From 1918cd77f5f26eeb4f9288ed45072068e1b4da34 Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Tue, 16 Jul 2024 11:31:00 +0800 +Subject: [PATCH] lpmd_cpu: Fix compiler above array bound error +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +n file included from /usr/include/glib-2.0/glib.h:64, + from src/lpmd.h:48, + from src/lpmd_cpu.c:52: +src/lpmd_cpu.c: In function ‘add_cpu’: +src/lpmd_cpu.c:408:66: error: array subscript 8 is above array bounds of ‘struct lpm_cpus[7]’ [-Werror=array-bounds=] + 408 | lpmd_log_debug ("\tDetected %s CPU%d\n", cpumasks[idx].name, cpu); + | ~~~~~~~~^~~~~ +src/lpmd_cpu.c:67:24: note: while referencing ‘cpumasks’ + 67 | static struct lpm_cpus cpumasks[CPUMASK_MAX] = { + | ^~~~~~~~ +cc1: all warnings being treated as errors +make[2]: *** [Makefile:686: src/intel_lpmd-lpmd_cpu.o] Error 1 +make[1]: *** [Makefile:868: all-recursive] Error 1 +make: *** [Makefile:459: all] Error 2 +--- + src/lpmd_cpu.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/src/lpmd_cpu.c b/src/lpmd_cpu.c +index 310bf65..808ae4b 100644 +--- a/src/lpmd_cpu.c ++++ b/src/lpmd_cpu.c +@@ -402,10 +402,14 @@ int add_cpu(int cpu, enum cpumask_idx idx) + if (idx & (CPUMASK_HFI | CPUMASK_HFI_SUV | CPUMASK_HFI_BANNED)) + return 0; + +- if (idx == CPUMASK_LPM_DEFAULT) ++ if (idx == CPUMASK_LPM_DEFAULT) { + lpmd_log_info ("\tDetected %s CPU%d\n", cpumasks[idx].name, cpu); +- else +- lpmd_log_debug ("\tDetected %s CPU%d\n", cpumasks[idx].name, cpu); ++ } else { ++ if (idx < CPUMASK_MAX) ++ lpmd_log_debug ("\tDetected %s CPU%d\n", cpumasks[idx].name, cpu); ++ else ++ lpmd_log_debug ("\tIncorrect CPU ID for CPU%d\n", cpu); ++ } + + return 0; + } +-- +2.45.2 + diff --git a/22.patch b/22.patch deleted file mode 100644 index b38b186..0000000 --- a/22.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 3717c7186895951f58b429d67b954e23a1986b05 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ali=20Erdin=C3=A7=20K=C3=B6ro=C4=9Flu?= - -Date: Fri, 9 Feb 2024 17:17:09 +0200 -Subject: [PATCH] Update lpmd_cpu.c - -Werror unused-variable fixes ---- - src/lpmd_cpu.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/src/lpmd_cpu.c b/src/lpmd_cpu.c -index f4dec42..bddd3a7 100644 ---- a/src/lpmd_cpu.c -+++ b/src/lpmd_cpu.c -@@ -804,7 +804,7 @@ static int detect_lpm_cpus_cmd(char *cmd) - */ - static int is_cpu_atom(int cpu) - { -- unsigned int eax, ebx, ecx, edx, subleaf; -+ unsigned int eax, ebx, ecx, edx; - unsigned int type; - - if (cpu_migrate(cpu) < 0) { -@@ -906,7 +906,6 @@ static int detect_cpu_l3(int cpu) - */ - static int detect_lpm_cpus_l3(void) - { -- char path[MAX_STR_LENGTH]; - int i; - - for (i = 0; i < topo_max_cpus; i++) { diff --git a/intel-lpmd.spec b/intel-lpmd.spec index 60bcac2..35c03da 100644 --- a/intel-lpmd.spec +++ b/intel-lpmd.spec @@ -1,24 +1,24 @@ %global daemon_name intel_lpmd Name: intel-lpmd -Version: 0.0.3 -Release: 2%{?dist} +Version: 0.0.6 +Release: 1%{?dist} Summary: Intel Low Power Mode Daemon License: GPL-2.0-or-later URL: https://github.com/intel/intel-lpmd Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -# https://patch-diff.githubusercontent.com/raw/intel/intel-lpmd/pull/22.patch -Patch0: 22.patch +# Fix "above array bound" compiler error +Patch0: 0001-lpmd_cpu-Fix-compiler-above-array-bound-error.patch ExclusiveArch: x86_64 BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc +BuildRequires: glib2-devel BuildRequires: gtk-doc -BuildRequires: dbus-glib-devel BuildRequires: libnl3-devel BuildRequires: libxml2-devel BuildRequires: libtool @@ -74,6 +74,9 @@ install -D -p -m 644 src/%{daemon_name}_dbus_interface.xml %{buildroot}/%{_datad %{_mandir}/man8/%{daemon_name}.8* %changelog +* Tue Jul 16 2024 Kate Hsuan - 0.0.6-1 +- Update to upstream release 0.0.6 + * Wed May 29 2024 Kate Hsuan - 0.0.3-2 - Rebuild for RHEL-9.5 - Resolves: RHEL-20167 diff --git a/sources b/sources index 0c912b5..9d90131 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (intel-lpmd-0.0.3.tar.gz) = 1de0ec7ef316d3b8052e487578acb2f70f9d65af866a48ff6fff10528882f619b0700fb986f44f8b6504a0f0a17a40a7e963085d85bc4723ef81e93454e65bfa +SHA512 (intel-lpmd-0.0.6.tar.gz) = b29e4525aa76b169f4d246903f8b3d500d936e14085ba12ce3f31a0c6dfb80bebdd9adfd92ef5db9a5d2ee772c7fe8d6c9662f19de6346ef5354a082b4cb63dc