From patchwork Mon Nov 16 20:42:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Brazdil X-Patchwork-Id: 11910791 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EE10C2D0A3 for ; Mon, 16 Nov 2020 20:45:31 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CDEE72222E for ; Mon, 16 Nov 2020 20:45:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="s/lHAgyV"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="VBVxPuFz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDEE72222E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IfmBAHFYN/E6FsZPDtVGXZFRo9t3IMKHytXWAZZNXfM=; b=s/lHAgyVcT+kJfIUwDIW/jp84 p14Pw9d7WOQX0cFfgUDiOKLpEYB1u10HRNvyksz+sky/SU7Ex5uy60aGSGRbFE1vNNMARvaezM2Iy NLUGR912/7HGBVOR7hM8T7B0gifcMrxpZDeGjmASBNGqgAa05N/jIE4rXS9znk8mqR4tmOR1UmLvn nI9naXqaTVjtlRhpLmEtjXe9Fp8KlizV4brJ5ISjIDJw65Ul35DEDDk/3xihN/GJ/iDeaDmqaU2VK 2mWt0rZ+1JO++H0SUWbfai0Ai1q3YktG3pDkrnEIBAtGJN/xeBPRUR9hEXHZyZiBnVg/CbFK7/Ahq 0icVg5lWw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kelLi-0007h8-HF; Mon, 16 Nov 2020 20:43:42 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kelLW-0007e1-GG for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2020 20:43:31 +0000 Received: by mail-wr1-x442.google.com with SMTP id l1so20262202wrb.9 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=Twfg7i3IFOdCdYAWXqeB6XpQXsOE1lzktpOCF8HwJtY2JgJ/8+DAn7wmbwrqVgtD3/ pCOayS+7s+gHKM5RKMjhpEdcwDzgaoNLsTCec0pKKo2GAAZzS+/8hzF4LBeZmXTGix3E Xp16jiKYw80pSaeTz58mwEkL1F30vruDwWaLO+3YFTBJNSmezX6Mc9KA23Y75oxfhNz/ kYGr/ZmU/vOwOHDRmhJyb5wNDp1ujk/owp0I0E87jNTqpytZBxZuh3WRmBX0mWa44hKW Ig4n0eBjnJj9nuS2yOrQAqeMJ2gD9jEZ1hsQkMexvl1wQE/nbnVq3bQfnHyzxnzo+p7a ++jw== X-Gm-Message-State: AOAM531Gx6GRkC3JLgJ/E/gV28XOYlEGYOq/1uBBT3GZXrXxohNJT6Vw U3Ta1/TsrotSKw06PiXLCEoaIQ== X-Google-Smtp-Source: ABdhPJwo5wX54x3EI1cjb6V0hNUDo7O9qMuKIAu7Wtf6d+0psErzZX0pP09b5KCMiJdBDam8PwHRaA== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201116_154330_613703_27BA7471 X-CRM114-Status: GOOD ( 14.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , kernel-team@android.com, Lorenzo Pieralisi , Andrew Walbran , Suzuki K Poulose , Marc Zyngier , Quentin Perret , linux-kernel@vger.kernel.org, James Morse , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Tejun Heo , Dennis Zhou , Christoph Lameter , David Brazdil , Will Deacon , Julien Thierry , Andrew Scull Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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]; }