Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3423707pxb; Mon, 16 Nov 2020 14:27:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRaWtlmkUgOMeo2J4Sgr5hvt8Q+HMiGIPGzLfkYVzsdQGG6LbNqnSeN1ncoq2WRXTre6PE X-Received: by 2002:a50:ee97:: with SMTP id f23mr18705453edr.333.1605565630851; Mon, 16 Nov 2020 14:27:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605565630; cv=none; d=google.com; s=arc-20160816; b=I4Gr92ZrQBYie9RTxmhQIbZJlfnAfm3Va0sUAOZMRnAUNUqUUErVpYcPmFNAH1CP/e 3kIfS2lMCNgqNVGHwEFvOB7+0RRmbePvteKdlwz1cF8zSH/lh2ofPmvFLVf6jl5UZKWj W/Q4fuvSiEvhcKU09GGX7uhvyZ0mwjvehGOt0qvJCB7xG+LydDjq22OQ9GJ6Z4s9VRBV sDXgUaazUL3VsF1VUQlmrpEz/AdxcRw8HZH/66KcbG6RJVT/R4t+Fsu1NnXW86sT+gHT Ui3/RS8GYcKWh14yPEfIhFxyZ3D4ALJinN37V0lQCY7J/V0YqGs1tnpsEJIFSMnoi0B2 IpEg== 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=i1OvP2q61CHl1qszot5RZrAZIRY6eLpATjvcLw+mVNU=; b=glU1uX8GeoJF9IL5E9i9LOtAKB20EqjCacq8Emr4NW7d/vlDHL06vNd8tPXqzMDcB2 qoII0OpiUbDKkkKrhmbZzU0IBWTkKbZcoQ6LDXIJyNXEDfDfYYgEr0RS/NVJ1WCa/Bix jv0tlKqtYMNRmjG6bh65XUQXBSvOTo7nl0Uuc47mNPX2cMXXKWatyrQE/Qdzh0u4ynux CdntghaIAIVAEgd/ydsa6L3NkuG67D2z8KPk1lz4jC3bZOKjRH8iaihCpppdc9UYTyFj Gq46Tkxhs0qpdE5E06V71GqOZsqt6N/oXXJ3j1tPLurnFm+8t2PfISE7JU3vxAuq+sm8 +ZYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VBVxPuFz; 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 a10si13466192edq.316.2020.11.16.14.26.48; Mon, 16 Nov 2020 14:27:10 -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=VBVxPuFz; 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 S1733306AbgKPUnb (ORCPT + 99 others); Mon, 16 Nov 2020 15:43:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbgKPUna (ORCPT ); Mon, 16 Nov 2020 15:43:30 -0500 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7069C0613CF for ; Mon, 16 Nov 2020 12:43:30 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id s8so20251655wrw.10 for ; Mon, 16 Nov 2020 12:43:30 -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=i1OvP2q61CHl1qszot5RZrAZIRY6eLpATjvcLw+mVNU=; b=VBVxPuFz0v1VTxIhWc+Lrxy25SeJfCOpJAG27XQAFG1IjlE2oXtGlzk3400Z+kESsc 6V/4SHdSfdtr5e6x8XvFe0sKbm3FkQOw0FUMSTcQhpXIp23sO5VzwOQrvHR/FjNr+e+8 q5UKiuLIqgP1GIvawt3LAxo1d314xttGEOemqAuZMnRmQ/mAjvi//QdMK5UQqUAoppoG GWMpUTAcZJlaL5EgsnZm2+vljkdDsttYq7vJ5k23DOVdeVbCzxHVWWYd4kItMa1gFkI4 pomXJMJSspC0SOuZwKwAkSVw+xfZQALrUWVWGtsi8G9v4nuZyZxlLczAM4n2uo0dg8mX Av0Q== 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=i1OvP2q61CHl1qszot5RZrAZIRY6eLpATjvcLw+mVNU=; b=fXYmqYQ4hvaItNVNpYBWaeaPSn0kY2+eFew8M/7Hcs1L2s6LmaYh/jKiTL4+nqdliO QDlEwKC4X33qfPCd6K1qF66zDgOWpG7OrvRY2YEO84MaVTiQsYH+BRuIJK6LuWGu+z63 LrOgh3+nSUrxp6cUcthvb5/KMG/tQ3ZOKwOIztwKg+Q1//S+hT8kKoXSEJ4oftrqC2y7 tqIUAlu2u2ZHd4UJL3OFOao+Ackluduxhv54imeHgxpkN36fgyZbimnKRaNOgd99/J1z KfYn6bk8d37FjxST0uHngSEvZvEy/cUNai+DpHpVgvNzsMhBCBaRBdLjeTl+xItuus0c V81Q== X-Gm-Message-State: AOAM5314wqB0MRVXtAthw5PHg/XZBc9wFILM68rIDA5OWEaSNAWu/x7G ZV6PAm6GU86KNEbaAyu3eJQp+Q== X-Received: by 2002:adf:f5c8:: with SMTP id k8mr22225271wrp.2.1605559409325; Mon, 16 Nov 2020 12:43:29 -0800 (PST) Received: from localhost ([2a01:4b00:8523:2d03:bc40:bd71:373a:1b33]) by smtp.gmail.com with ESMTPSA id z3sm23263951wrw.87.2020.11.16.12.43.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Nov 2020 12:43:28 -0800 (PST) From: David Brazdil To: kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Catalin Marinas , Will Deacon , Dennis Zhou , Tejun Heo , Christoph Lameter , Mark Rutland , Lorenzo Pieralisi , Quentin Perret , Andrew Scull , Andrew Walbran , kernel-team@android.com, David Brazdil Subject: [PATCH v2 03/24] arm64: Make cpu_logical_map() take unsigned int Date: Mon, 16 Nov 2020 20:42:57 +0000 Message-Id: <20201116204318.63987-4-dbrazdil@google.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201116204318.63987-1-dbrazdil@google.com> References: <20201116204318.63987-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.299.gdc1121823c-goog