From: Zhang Rui Date: Thu, 12 Jan 2023 06:43:33 +0000 (+0800) Subject: tools/power/x86/intel-speed-select: Remove wrong check in set_isst_id() X-Git-Tag: v6.6.17~5511^2~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=507fa17a6c46c111f6b0d2bc483c1b3563fd16c5;p=platform%2Fkernel%2Flinux-rpi.git tools/power/x86/intel-speed-select: Remove wrong check in set_isst_id() struct isst_id *id is a pointer, comparing it with less than zero is wrong. The check is there to make sure the id->pkg and id->die is set to -1, when it is illegal or unavailable. Here comparing with MAX_PACKAGE_COUNT and MAX_DIE_PER_PACKAGE is sufficient. Hence remove the wrong check. Signed-off-by: Zhang Rui [srinivas.pandruvada@linux.intel.com: Subject and changelog edits] Signed-off-by: Srinivas Pandruvada Signed-off-by: Hans de Goede --- diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c index a160bad..b5822ee 100644 --- a/tools/power/x86/intel-speed-select/isst-config.c +++ b/tools/power/x86/intel-speed-select/isst-config.c @@ -383,11 +383,11 @@ void set_isst_id(struct isst_id *id, int cpu) id->cpu = cpu; id->pkg = get_physical_package_id(cpu); - if (id < 0 || id->pkg >= MAX_PACKAGE_COUNT) + if (id->pkg >= MAX_PACKAGE_COUNT) id->pkg = -1; id->die = get_physical_die_id(cpu); - if (id < 0 || id->die >= MAX_DIE_PER_PACKAGE) + if (id->die >= MAX_DIE_PER_PACKAGE) id->die = -1; }