From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 99144C63697 for ; Thu, 26 Nov 2020 17:29:56 +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 4E3CE21D7E for ; Thu, 26 Nov 2020 17:29:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MzH6UhAV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E3CE21D7E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9/BlZiMq3eJjQ6xXQz4sngS3pjj1dy4pX5J77XaDzg0=; b=MzH6UhAVRt/zlVXG9Dg9/fDSl fv+NwiNWVyKjO0XsqyzUgjUeQYA7xjkJGhVE8z0cew244mr8RbXJ8ZZQDjr2omZVvFV1verdbC9pD SVzPywpiGxFSRsq5CvlNkbiYE80Gpo122Ety2k1cBYfTZt0Idx1/KnSu+q3EC9ZybqTM3kXts2+EO VJL2cS90ESRQrFvhryp0fNGXbiqdZo2I5SZb5Z/SCY9Ir9HOXUddJj/iumHYPFaiE1PicF2ERj8Ul hHcICzfRt+gnqnAtctdctgZUWN6pI2sN/sdPHpUEeeoJOSEvPoP6Da0IPcIdDWab2GAsqoqyuUjfn yAwDMUMow==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiL4Z-0008RV-Rr; Thu, 26 Nov 2020 17:28:47 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiL4X-0008Qq-Ko for linux-arm-kernel@lists.infradead.org; Thu, 26 Nov 2020 17:28:46 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8BE7331B; Thu, 26 Nov 2020 09:28:44 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.30.234]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EA92C3F23F; Thu, 26 Nov 2020 09:28:40 -0800 (PST) Date: Thu, 26 Nov 2020 17:28:38 +0000 From: Mark Rutland To: David Brazdil Subject: Re: [PATCH v3 03/23] arm64: Make cpu_logical_map() take unsigned int Message-ID: <20201126172838.GD38486@C02TD0UTHF1T.local> References: <20201126155421.14901-1-dbrazdil@google.com> <20201126155421.14901-4-dbrazdil@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201126155421.14901-4-dbrazdil@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201126_122845_781631_F056D781 X-CRM114-Status: GOOD ( 21.74 ) 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: Lorenzo Pieralisi , kernel-team@android.com, Jonathan Corbet , Catalin Marinas , Suzuki K Poulose , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Sudeep Holla , James Morse , linux-arm-kernel@lists.infradead.org, Marc Zyngier , Tejun Heo , Dennis Zhou , Christoph Lameter , Will Deacon , kvmarm@lists.cs.columbia.edu, Julien Thierry Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 26, 2020 at 03:54:01PM +0000, David Brazdil wrote: > CPU index should never be negative. Change the signature of > (set_)cpu_logical_map to take an unsigned int. > > Signed-off-by: David Brazdil Is there a function problem here, or is this just cleanup from inspection? Core code including the cpuhp_*() callbacks uses an int, so if there's a strong justification to change this, it suggests there's some treewide cleanup that should be done. I don't have strong feelings on the matter, but I'd like to understand the rationale. Thanks, Mark. > --- > 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel