[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240423204619.3946901-9-srinivas.pandruvada@linux.intel.com>
Date: Tue, 23 Apr 2024 13:46:17 -0700
From: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
To: hdegoede@...hat.com,
ilpo.jarvinen@...ux.intel.com
Cc: platform-driver-x86@...r.kernel.org,
linux-kernel@...r.kernel.org,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH 08/10] 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@...ux.intel.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
---
drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
index b8da6847622b..e75fb9eba598 100644
--- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
+++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
@@ -531,8 +531,7 @@ static struct tpmi_per_power_domain_info *get_instance(int pkg_id, int power_dom
struct tpmi_sst_struct *sst_inst;
u8 part;
- if (pkg_id < 0 || pkg_id > isst_common.max_index ||
- pkg_id >= topology_max_packages())
+ if (!in_range(pkg_id, 0, topology_max_packages()) || pkg_id > isst_common.max_index)
return NULL;
sst_inst = isst_common.sst_inst[pkg_id];
--
2.40.1
Powered by blists - more mailing lists