From patchwork Wed May 31 22:13:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 101604 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3216012vqr; Wed, 31 May 2023 15:27:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5eEIk/I2pmrSp8qKNNSoKB7YV22QaVdlfZyTLhZb6cCBGB8eSeNssH//Erjx9H3LNMqM50 X-Received: by 2002:a25:be04:0:b0:bab:f4bb:9402 with SMTP id h4-20020a25be04000000b00babf4bb9402mr7485481ybk.46.1685572076616; Wed, 31 May 2023 15:27:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685572076; cv=none; d=google.com; s=arc-20160816; b=RnAOKiy0wQ71tcTyIfHGl3YUicdgexxp75h5HUrbFpE6ukZPLVHHvx/3LaQyUNxWn2 YMqr4PHnGcd6PG5K9G89U4h4gsRFTAHLwfxrWP36PFKoWUfE3CONht9Rh7T6EZadcfb/ Vd38tbk3T1DKNdmo7hIzYc5Bl76nuCbN/NC8Iuvocnkk9pk+qxRvAab9nLi8cLToSB5Q 55XC6ph3wAhK2c9kS+QGf/VpV9oOVl60SEMBOsmMP8GbzQIrHRtrPL5BgSH+gNKscfCM yR2jCrFbvMhFzuWumZvX/HrELEwBplNsZaryF8LjILfY3AX6b/ZZGlklFs4v9ubk6D5L fuNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=YrgTPga6J61LSfCLS2B6c+/0p6QnQhXRIHUc2Gpyhtw=; b=pcvhjlRmkO+AXv3f0j/X12uDaoj853LPfxADXvOzjtMqYQugtO1ilBT9AnIVa7PZim V+otj+H37mOp2ofV4NbFCGoAwm9sAZrN0zQPZSZNDMh0a+w0OBzk0drnD+iztyHssr0K NkhniDHnfYgc/rFLMWmq0UbVaakVsplDw1XBHwyDOgqbKx5+a1pFQQa0iD71E6bygtRS I8nlBATU5DZAALLHwJG2TPnyBThxkLH8NFzASbhR/Vw+S3Y/IVwuYmSAI21qJdo67ols +h7Qawz6AlvFGSV3M8GnrCas1yxaqITlu6lvJUm4Pze0QZhQPfhBByH6JYzIKFF5jHKs IH0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="ySC/4oie"; dkim=neutral (no key) header.i=@linutronix.de header.b=e3sODbde; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x2-20020a170902ea8200b001b03df75986si1693107plb.94.2023.05.31.15.27.43; Wed, 31 May 2023 15:27:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="ySC/4oie"; dkim=neutral (no key) header.i=@linutronix.de header.b=e3sODbde; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230497AbjEaWOS (ORCPT + 99 others); Wed, 31 May 2023 18:14:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230491AbjEaWOM (ORCPT ); Wed, 31 May 2023 18:14:12 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2174619A; Wed, 31 May 2023 15:13:52 -0700 (PDT) Date: Wed, 31 May 2023 22:13:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685571218; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YrgTPga6J61LSfCLS2B6c+/0p6QnQhXRIHUc2Gpyhtw=; b=ySC/4oie/aRAggRZSV7nLpi4+YnIrxHpBpuCCg5H/lOWd9jHODUFYddXF0pz4RaouflFHO BedlzetsNbl+DMamH4cc/slFigJIzGaMZdwX9NE1MfeaiKrC2C6ap2x+i2HoK5FcWTXTEO kPTJts0vrGlNtANBVvRDzL/V/+4Xf4hbQTfufMvLzNg4UuxZ2VMZya3b/RXmyouVNauakT 2TJjp/cKUw+5MtAY/Z6aTpS9HmAu2JT2z1lhCXAMXoWu4+8D2LoBUMgXCroPlsU+LruwVl eGxvaggFGXeOOjR1E2CBhHiFRw6kMq/mlyqqCcdmYaURhrTtiJDkpfNsQ705jQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685571218; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YrgTPga6J61LSfCLS2B6c+/0p6QnQhXRIHUc2Gpyhtw=; b=e3sODbdebME0czWAKdqcVDWV8t46o/zrxTLj3CTFTNL5Vm9BIAw9lqdIIGXL2cGNDi36LY wh2E18XaOl6YH5CQ== From: "tip-bot2 for Steve Wahl" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/platform] x86/platform/uv: When searching for minimums, start at INT_MAX not 99999 Cc: Steve Wahl , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <168557121766.404.495395130492579199.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767450425810933149?= X-GMAIL-MSGID: =?utf-8?q?1767450425810933149?= 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 AuthorDate: Fri, 19 May 2023 14:07:48 -05:00 Committer: Dave Hansen 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 Signed-off-by: Dave Hansen 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" :