Skip to content

Commit e4e365b

Browse files
spandruvadajwrdegoede
authored andcommitted
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 <[email protected]> Suggested-by: Andy Shevchenko <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 9d1d362 commit e4e365b

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
@@ -531,8 +531,7 @@ static struct tpmi_per_power_domain_info *get_instance(int pkg_id, int power_dom
531531
struct tpmi_sst_struct *sst_inst;
532532
u8 part;
533533

534-
if (pkg_id < 0 || pkg_id > isst_common.max_index ||
535-
pkg_id >= topology_max_packages())
534+
if (!in_range(pkg_id, 0, topology_max_packages()) || pkg_id > isst_common.max_index)
536535
return NULL;
537536

538537
sst_inst = isst_common.sst_inst[pkg_id];

0 commit comments

Comments
 (0)