From patchwork Mon Jul 18 06:42:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 12920716 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F939C43334 for ; Mon, 18 Jul 2022 04:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8esun2gGwHJxlKoJzjh3g6U5aIwr4RmsLwRQz8IforA=; b=s2urGmJ9BWoBJS MRXHDoWP7E6XTpHn1Go1D6V0VjTjhU+fI7AR5YgHho+Vvy0VAbb728lhRclEmzHEFbIT7FvsnznLa x/BUhCdEz0h02p7kCKNI/0uCgI1BXmeSKNnvr1FhfFrDbwI/eXA/yyaOAmMwLzqfsPXaNHul5h8vF 2VqWNa6OAxsRGsTo7bR2hYn0WNdgV4ayz2QAbVR2vKv0J7Zcn45GcJIvltFDW9LU6b3w9zIaL7kH6 OgCHrb+cQzBAPYLA5bRBtrzqz+wOWJ5B2bNzn4/QQYjx2fcqR6IDD+34+YmFe1on9vPilizEXuJ5K 9iEDZA6uvkLpylzfASbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDId0-00Auq5-Gs; Mon, 18 Jul 2022 04:45:06 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDIcx-00Auok-1M for linux-arm-kernel@lists.infradead.org; Mon, 18 Jul 2022 04:45:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658119500; h=from:from: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=PJGZghyUiQePHBonFW3MIUSnC6/CE48ju67sSDQu/Pk=; b=gxkppIDkNQ3ZOMuL1Sbtw5iAFVcfUtKjWWrQuEnuZIoD6lILY0KCdHrYslAbK1+B4yEbNy WvXDBiCSjd2NL/W/2rFUprUb9kKOg1c0/fDQMJiZDoC+2iLMDWZjZQMOPXeV7NXUtHy8b3 SzWkxjSHwCyiOt3R9Tv/YCUzogb8nDI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-250-hm-2lRIaPqGlawZ9S1fbHg-1; Mon, 18 Jul 2022 00:43:05 -0400 X-MC-Unique: hm-2lRIaPqGlawZ9S1fbHg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ACEFD3C0CD42; Mon, 18 Jul 2022 04:43:04 +0000 (UTC) Received: from gshan.redhat.com (vpn2-54-37.bne.redhat.com [10.64.54.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C3F11121314; Mon, 18 Jul 2022 04:43:02 +0000 (UTC) From: Gavin Shan To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, shan.gavin@gmail.com Subject: [PATCH] arm64: numa: Don't check node against MAX_NUMNODES Date: Mon, 18 Jul 2022 14:42:32 +0800 Message-Id: <20220718064232.3464373-1-gshan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220717_214503_262046_1CB53FE5 X-CRM114-Status: GOOD ( 13.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When the NUMA nodes are sorted by checking ACPI SRAT (GICC AFFINITY) sub-table, it's impossible for acpi_map_pxm_to_node() to return any value, which is greater than or equal to MAX_NUMNODES. Lets drop the unnecessary check in acpi_numa_gicc_affinity_init(). No functional change intended. Signed-off-by: Gavin Shan --- arch/arm64/kernel/acpi_numa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c index fdfecf0991ce..e51535a5f939 100644 --- a/arch/arm64/kernel/acpi_numa.c +++ b/arch/arm64/kernel/acpi_numa.c @@ -109,7 +109,7 @@ void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) pxm = pa->proximity_domain; node = acpi_map_pxm_to_node(pxm); - if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) { + if (node == NUMA_NO_NODE) { pr_err("SRAT: Too many proximity domains %d\n", pxm); bad_srat(); return;