Skip to content

Commit 35bd896

Browse files
swahlhpehansendc
authored andcommitted
x86/platform/uv: When searching for minimums, start at INT_MAX not 99999
Using a starting value of INT_MAX rather than 999999 or 99999 means this algorithm won't fail should the numbers being compared ever exceed this value. Signed-off-by: Steve Wahl <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Link: https://lore.kernel.org/all/20230519190752.3297140-5-steve.wahl%40hpe.com
1 parent e4860f0 commit 35bd896

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ static void __init decode_gam_rng_tbl(unsigned long ptr)
13491349
struct uv_gam_range_entry *gre = (struct uv_gam_range_entry *)ptr;
13501350
unsigned long lgre = 0, gend = 0;
13511351
int index = 0;
1352-
int sock_min = 999999, pnode_min = 99999;
1352+
int sock_min = INT_MAX, pnode_min = INT_MAX;
13531353
int sock_max = -1, pnode_max = -1;
13541354

13551355
uv_gre_table = gre;
@@ -1694,7 +1694,7 @@ static void __init uv_system_init_hub(void)
16941694
{
16951695
struct uv_hub_info_s hub_info = {0};
16961696
int bytes, cpu, nodeid;
1697-
unsigned short min_pnode = 9999, max_pnode = 0;
1697+
unsigned short min_pnode = USHRT_MAX, max_pnode = 0;
16981698
char *hub = is_uv5_hub() ? "UV500" :
16991699
is_uv4_hub() ? "UV400" :
17001700
is_uv3_hub() ? "UV300" :

0 commit comments

Comments
 (0)