Skip to content

Commit 86216ca

Browse files
committed
platform/x86: ISST: Use in_range() to check package ID validity
JIRA: https://issues.redhat.com/browse/RHEL-79669 commit e4e365b Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Date: Tue Apr 23 13:46:17 2024 -0700 platform/x86: ISST: Use in_range() to check package ID validity Use in_range() macro to simplify range check. No functional impact is expected. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20240423204619.3946901-9-srinivas.pandruvada@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: David Arcari <darcari@redhat.com>
1 parent 047ec97 commit 86216ca

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,7 @@ static struct tpmi_per_power_domain_info *get_instance(int pkg_id, int power_dom
533533
struct tpmi_sst_struct *sst_inst;
534534
u8 part;
535535

536-
if (pkg_id < 0 || pkg_id > isst_common.max_index ||
537-
pkg_id >= topology_max_packages())
536+
if (!in_range(pkg_id, 0, topology_max_packages()) || pkg_id > isst_common.max_index)
538537
return NULL;
539538

540539
sst_inst = isst_common.sst_inst[pkg_id];

0 commit comments

Comments
 (0)