Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp642869pxu; Thu, 26 Nov 2020 07:57:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJy73F8ul+kLv4sG7iQm2KdTWuuPGWd6zK/bmGauUROPI9Fb0ModyuRjCahpFBJSOheNZL70 X-Received: by 2002:aa7:ce8c:: with SMTP id y12mr3196402edv.185.1606406247026; Thu, 26 Nov 2020 07:57:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606406247; cv=none; d=google.com; s=arc-20160816; b=Pj+estnJbg3OVdW3G+7/C9IrTfcBGS8SC601Wdhjp2jX5+//1C4SQPs3CwqR1ZCReY JO2AhtBnIxj+EmukGWdkQwcCrBDD3OT2vpqSyPW+Gog6tNwXDAGz5/mjavNQxEE80qq0 HNGEmLA/q7RXxS6QmJ1M1Xm6wwxw44MwOpkkobgmgcPLMDF0bEjBk/0WUo7SuEevJLgL vvyaI+cyAu22sDtfZRfdrIQcsadwGDIHTIpaLNVYWEjuRmWqJ3+ojVChHAKSVRt8V9RL tZ9SyfBgxIwzI/+97KGDHIy+RIzt/2rRwlMk/WYA3HKPyswxgwJOSE0oe3O5sdJlp5iw ciOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=t3ZEYk2Uf0v1klDyIVNllC4hj8a8TzhOU5HlrW3d3XY=; b=GB9VovNKjRR7XBClNQnQYrXmYmYpvVuRGxixS+r2ZNAOqN4feazKfSAPvGAAYF9RVe E9NYgQu8DUFSjZ93PaoWnEg7bAKyM3kURA48770Qg31Dyo48zfR+uQQSlq324dv7RmgU u7yHBBKLjn48nucrT7vFIQgQoKp/rvyVj86mS570/n+JE3FH4h2PXrkOJlRZM7dMcbC8 DFDUMD/brjJbAXTQFid+H7DFg4298YWaSMiu6GgjRun6YrE/A/0ulE4GPmFlvaIKe4PK KjMo/PeqYfVQnYdxQw664WA6VOKFL6ACgmpVkmV8zcvQTLmqaG1/GAePUH1pADmkNecd B3Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WB708Y6Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si3413120edq.543.2020.11.26.07.57.04; Thu, 26 Nov 2020 07:57:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WB708Y6Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391369AbgKZPyf (ORCPT + 99 others); Thu, 26 Nov 2020 10:54:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391361AbgKZPye (ORCPT ); Thu, 26 Nov 2020 10:54:34 -0500 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6021EC0613D4 for ; Thu, 26 Nov 2020 07:54:34 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id a3so2852538wmb.5 for ; Thu, 26 Nov 2020 07:54:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t3ZEYk2Uf0v1klDyIVNllC4hj8a8TzhOU5HlrW3d3XY=; b=WB708Y6ZQsVTnPDe3k8SGt1N+Zi1ArG5DNJ8Ikjx+GwIsVyKkyANitm+7v9D8STbCN 4sIx6XZ9WxtYX8XP7V/bVY64iZPta0oEQJhY5JctNUzEqp/siO8Mh7MOaSHI9jTKRX/G ba18CMjyRpguJUKBwLVRI8k5AHvlNVRnB1DKj5K2COahoTLJrC8pp74gWQmVJtRJ8ivp fJffW03dFEtg1jOc/x7+J4NtCy/6j6euZgUM7vcZ5okmBEc+hu9CLbAHOr83RhZZ7PAd Ya9qvceAHvZJLaq5R4L/3OTpAnWZot8Djf5EA45iNDBN22H7c4JKiI1EzSkX09tYRLsS Ahyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t3ZEYk2Uf0v1klDyIVNllC4hj8a8TzhOU5HlrW3d3XY=; b=s9J7qmfzFECZj6W1BdXMk4M1o6hDxoaKmZeflaHPGRUgbjwzZ3DXHF+5Fnu6HkzJG2 GGaIWGpoc6FMM4bz+bJS4oUX5QwOmuls/y2ZzRqfOLGvXV3KbsZEbayk/YSKxPLjqPey 13xwsTBK3DZp12rD1TjoN8c6X5eZDBoIYen4vMz1w9C+zCSSqwoFbmNBbQ0gRxG/APUD oGofqPf5nXbEirEIShjeMCNAuTp11mmoMYOAjnhZuCB76ufrYUkU6pqyUi3wcUrAg/Vs ntYdgglPyuJ5ZkfZ/kjP8YvBzSqNMOQW6JtwWkfhnK2tEJiOu4vEuSUsybXmfS2HPmOd KQBw== X-Gm-Message-State: AOAM531FAF9Re4c1ORSK+Tv6WGYibWk5lkurvHCBPYvIZ26+KAMwHA6N ZvlX/efA7yCK9+jcgCg94vAMAg== X-Received: by 2002:a1c:3b07:: with SMTP id i7mr4113356wma.118.1606406072986; Thu, 26 Nov 2020 07:54:32 -0800 (PST) Received: from localhost ([2a01:4b00:8523:2d03:f008:704d:8d4b:9951]) by smtp.gmail.com with ESMTPSA id d8sm8607196wmb.11.2020.11.26.07.54.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Nov 2020 07:54:32 -0800 (PST) From: David Brazdil To: kvmarm@lists.cs.columbia.edu Cc: Jonathan Corbet , Catalin Marinas , Will Deacon , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Dennis Zhou , Tejun Heo , Christoph Lameter , Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com, David Brazdil Subject: [PATCH v3 03/23] arm64: Make cpu_logical_map() take unsigned int Date: Thu, 26 Nov 2020 15:54:01 +0000 Message-Id: <20201126155421.14901-4-dbrazdil@google.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201126155421.14901-1-dbrazdil@google.com> References: <20201126155421.14901-1-dbrazdil@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CPU index should never be negative. Change the signature of (set_)cpu_logical_map to take an unsigned int. Signed-off-by: David Brazdil --- arch/arm64/include/asm/smp.h | 4 ++-- arch/arm64/kernel/setup.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/smp.h b/arch/arm64/include/asm/smp.h index 2e7f529ec5a6..bcb01ca15325 100644 --- a/arch/arm64/include/asm/smp.h +++ b/arch/arm64/include/asm/smp.h @@ -46,9 +46,9 @@ DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number); * Logical CPU mapping. */ extern u64 __cpu_logical_map[NR_CPUS]; -extern u64 cpu_logical_map(int cpu); +extern u64 cpu_logical_map(unsigned int cpu); -static inline void set_cpu_logical_map(int cpu, u64 hwid) +static inline void set_cpu_logical_map(unsigned int cpu, u64 hwid) { __cpu_logical_map[cpu] = hwid; } diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 133257ffd859..2f2973bc67c7 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -276,7 +276,7 @@ arch_initcall(reserve_memblock_reserved_regions); u64 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID }; -u64 cpu_logical_map(int cpu) +u64 cpu_logical_map(unsigned int cpu) { return __cpu_logical_map[cpu]; } -- 2.29.2.454.gaff20da3a2-goog