Commit 35bd896c authored by Steve Wahl's avatar Steve Wahl Committed by Dave Hansen

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: default avatarSteve Wahl <steve.wahl@hpe.com>
Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/all/20230519190752.3297140-5-steve.wahl%40hpe.com
parent e4860f03
...@@ -1349,7 +1349,7 @@ static void __init decode_gam_rng_tbl(unsigned long ptr) ...@@ -1349,7 +1349,7 @@ static void __init decode_gam_rng_tbl(unsigned long ptr)
struct uv_gam_range_entry *gre = (struct uv_gam_range_entry *)ptr; struct uv_gam_range_entry *gre = (struct uv_gam_range_entry *)ptr;
unsigned long lgre = 0, gend = 0; unsigned long lgre = 0, gend = 0;
int index = 0; int index = 0;
int sock_min = 999999, pnode_min = 99999; int sock_min = INT_MAX, pnode_min = INT_MAX;
int sock_max = -1, pnode_max = -1; int sock_max = -1, pnode_max = -1;
uv_gre_table = gre; uv_gre_table = gre;
...@@ -1694,7 +1694,7 @@ static void __init uv_system_init_hub(void) ...@@ -1694,7 +1694,7 @@ static void __init uv_system_init_hub(void)
{ {
struct uv_hub_info_s hub_info = {0}; struct uv_hub_info_s hub_info = {0};
int bytes, cpu, nodeid; int bytes, cpu, nodeid;
unsigned short min_pnode = 9999, max_pnode = 0; unsigned short min_pnode = USHRT_MAX, max_pnode = 0;
char *hub = is_uv5_hub() ? "UV500" : char *hub = is_uv5_hub() ? "UV500" :
is_uv4_hub() ? "UV400" : is_uv4_hub() ? "UV400" :
is_uv3_hub() ? "UV300" : is_uv3_hub() ? "UV300" :
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment