mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [tip: x86/platform] x86/platform/uv: When searching for minimums, start at INT_MAX not 99999
@ 2023-05-31 22:13 tip-bot2 for Steve Wahl
  0 siblings, 0 replies; only message in thread
From: tip-bot2 for Steve Wahl @ 2023-05-31 22:13 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Steve Wahl, Dave Hansen, x86, linux-kernel

The following commit has been merged into the x86/platform branch of tip:

Commit-ID:     35bd896ccc2fa8dfb20df705a44e9d26665f1085
Gitweb:        https://git.kernel.org/tip/35bd896ccc2fa8dfb20df705a44e9d26665f1085
Author:        Steve Wahl <steve.wahl@hpe.com>
AuthorDate:    Fri, 19 May 2023 14:07:48 -05:00
Committer:     Dave Hansen <dave.hansen@linux.intel.com>
CommitterDate: Wed, 31 May 2023 09:34:59 -07:00

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 <steve.wahl@hpe.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/all/20230519190752.3297140-5-steve.wahl%40hpe.com
---
 arch/x86/kernel/apic/x2apic_uv_x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 6d2739e..2da84be 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -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;
 	unsigned long lgre = 0, gend = 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;
 
 	uv_gre_table = gre;
@@ -1694,7 +1694,7 @@ static void __init uv_system_init_hub(void)
 {
 	struct uv_hub_info_s hub_info = {0};
 	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" :
 		    is_uv4_hub() ? "UV400" :
 		    is_uv3_hub() ? "UV300" :

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-31 22:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-31 22:13 [tip: x86/platform] x86/platform/uv: When searching for minimums, start at INT_MAX not 99999 tip-bot2 for Steve Wahl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®