Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7427159imm; Tue, 28 Aug 2018 11:52:27 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdaie2Hot2V42Kb1nq8tlAoGsTJs8DThyz4p7ZUxdus/4OHb/g7GF0hhwsK8p6J4ZhpGDBdy X-Received: by 2002:a17:902:7086:: with SMTP id z6-v6mr2718951plk.266.1535482347927; Tue, 28 Aug 2018 11:52:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535482347; cv=none; d=google.com; s=arc-20160816; b=Agw+yOvsiehOoODgdffIMcNYxAy6GOiUsMc/wt4icpXwgM01paGbXQ2Mm3BeFLv8X7 cK0WuBGKE6QMoa7oP4Bbij40po03+l8Grhl+wJPlS0GtmmUjg39JykqeTyt5GjI4Mk3f RqH1fYcwfU5Z59zxpUO9Y47Vz6XKcXI97cmdxtEqsuBMot4wv0i5utzsE7HBFeKjSvcp oq5y4Xw0njrZ18/iMgm3eCVEjGap+932PJB4MWNl0JJvEda0DJRClSq5ieGFJGxnIQoj EjoOsewdEHphg/oYH/PyczjLYwCsdlKicVrrcMfG3e8Kk6neBY0B1gpq13CNML3JRosu tp4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=G85NTam8W7fiXEj/gP/XVCcvKghgv4VB3UiALeaR934=; b=BMat9OM1RKiG5HZdZt8u491uai1JCAXkAvk9GRRRYNSHk60dEGbyXrMuLwuRGKhFkZ hSGwojKAFn1FkXWutp8ubMCEW86HG2d9lGsetyAvnW2XJD2OWOW1MESeYQYcuvcFN+oG Di0y3KtndwnGdjUMWTXp1FKQ3isSt14WX9h039SWP58qStyLDwbOajme/VD8IlAUVpO5 MrfWHaIcwDTXMf7IiE5QlCG4Cm1ZAiboDJUwPCCFwmva4JsOkxZOVlTKxXnD6FWIgqkg u/KQ+3MMCIu5rxH9WomtamKTFg1J+u9sw7v7PJTsGNgO+GtNxbrkdC9syPjR7NjbAjsw uUiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="PmXJF/lQ"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3-v6si1550343plb.418.2018.08.28.11.52.12; Tue, 28 Aug 2018 11:52:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="PmXJF/lQ"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727185AbeH1WnS (ORCPT + 99 others); Tue, 28 Aug 2018 18:43:18 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:1551 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726807AbeH1WnS (ORCPT ); Tue, 28 Aug 2018 18:43:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1535482222; x=1567018222; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=aszJt4UfxD+mQxsuCwoH67L0LDwBWKIiA5IEctGg+Lg=; b=PmXJF/lQ87CEVATBaVdFfzBydgI9XS/Z0ijDVjjI7zKQOtbuEij8e4Ii O28drGI8kN1p2V95u6L+pOm6WrlbR6Ir5fejgm7qW1+Mx5Jh3te9MpdQs un7QT6LWeKgnjlm8UhrcQr97vfWpSH6JlMCUr7lrOX1jVOm/A/BE/Y/Yh X8mliJ9193Cbf+p9Iyao5WifFsYmtnaEf4TsF4U6CtfrfsljG4uWvWX/0 kQu8FdFvvb+gS680Z7/IwtMYUcpFQayX+XesbqMajK0kX+NYzOXxbTRIc KrtAOSz+hHRrywp4bL/SC7qcefOPziSrs3sdYjAmp5ZUKMS/Rt/whEEMX w==; X-IronPort-AV: E=Sophos;i="5.53,300,1531756800"; d="scan'208";a="92573367" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 29 Aug 2018 02:50:22 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 28 Aug 2018 11:37:36 -0700 Received: from 6pnzp12.ad.shared (HELO [10.86.61.94]) ([10.86.61.94]) by uls-op-cesaip02.wdc.com with ESMTP; 28 Aug 2018 11:50:21 -0700 Subject: Re: [PATCH 3/8] RISC-V: Rename riscv_of_processor_hart to riscv_of_processor_hartid To: Palmer Dabbelt , "linux-riscv@lists.infradead.org" Cc: "aou@eecs.berkeley.edu" , "daniel.lezcano@linaro.org" , "tglx@linutronix.de" , "jason@lakedaemon.net" , "marc.zyngier@arm.com" , "dmitriy@oss-tech.org" , "catalin.marinas@arm.com" , "ard.biesheuvel@linaro.org" , Greg KH , "jeremy.linton@arm.com" , "linux-kernel@vger.kernel.org" References: <20180827184243.25344-1-palmer@sifive.com> <20180827184243.25344-4-palmer@sifive.com> From: Atish Patra Message-ID: <6d213376-5e00-48a9-35a2-a83807f2e481@wdc.com> Date: Tue, 28 Aug 2018 11:50:20 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180827184243.25344-4-palmer@sifive.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/27/18 11:58 AM, Palmer Dabbelt wrote: > It's a bit confusing exactly what this function does: it actually > returns the hartid of an OF processor node, failing with -1 on invalid > nodes. I've changed the name to _hartid() in order to make that a bit > more clear, as well as adding a comment. > > Signed-off-by: Palmer Dabbelt > --- > arch/riscv/include/asm/processor.h | 4 +++- > arch/riscv/kernel/cpu.c | 2 +- > arch/riscv/kernel/smpboot.c | 2 +- > drivers/clocksource/riscv_timer.c | 2 +- > drivers/irqchip/irq-sifive-plic.c | 2 +- > 5 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/arch/riscv/include/asm/processor.h b/arch/riscv/include/asm/processor.h > index 3fe4af8147d2..9d32670d84a4 100644 > --- a/arch/riscv/include/asm/processor.h > +++ b/arch/riscv/include/asm/processor.h > @@ -88,7 +88,9 @@ static inline void wait_for_interrupt(void) > } > > struct device_node; > -extern int riscv_of_processor_hart(struct device_node *node); > +/* Returns the hart ID of the given device tree node, or -1 if the device tree > + * node isn't a RISC-V hart. */ I think multi-line commenting format should be: /* * */ Otherwise, Reviewed-by: Atish Patra > +extern int riscv_of_processor_hartid(struct device_node *node); > > extern void riscv_fill_hwcap(void); > > diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c > index ca6c81e54e37..19e98c1710dd 100644 > --- a/arch/riscv/kernel/cpu.c > +++ b/arch/riscv/kernel/cpu.c > @@ -16,7 +16,7 @@ > #include > > /* Return -1 if not a valid hart */ > -int riscv_of_processor_hart(struct device_node *node) > +int riscv_of_processor_hartid(struct device_node *node) > { > const char *isa, *status; > u32 hart; > diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c > index 56abab6a9812..5f29f8562cf6 100644 > --- a/arch/riscv/kernel/smpboot.c > +++ b/arch/riscv/kernel/smpboot.c > @@ -53,7 +53,7 @@ void __init setup_smp(void) > int hart, im_okay_therefore_i_am = 0; > > while ((dn = of_find_node_by_type(dn, "cpu"))) { > - hart = riscv_of_processor_hart(dn); > + hart = riscv_of_processor_hartid(dn); > if (hart >= 0) { > set_cpu_possible(hart, true); > set_cpu_present(hart, true); > diff --git a/drivers/clocksource/riscv_timer.c b/drivers/clocksource/riscv_timer.c > index 4e8b347e43e2..ad7453fc3129 100644 > --- a/drivers/clocksource/riscv_timer.c > +++ b/drivers/clocksource/riscv_timer.c > @@ -84,7 +84,7 @@ void riscv_timer_interrupt(void) > > static int __init riscv_timer_init_dt(struct device_node *n) > { > - int cpu_id = riscv_of_processor_hart(n), error; > + int cpu_id = riscv_of_processor_hartid(n), error; > struct clocksource *cs; > > if (cpu_id != smp_processor_id()) > diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c > index 532e9d68c704..c55eaa31cde2 100644 > --- a/drivers/irqchip/irq-sifive-plic.c > +++ b/drivers/irqchip/irq-sifive-plic.c > @@ -176,7 +176,7 @@ static int plic_find_hart_id(struct device_node *node) > { > for (; node; node = node->parent) { > if (of_device_is_compatible(node, "riscv")) > - return riscv_of_processor_hart(node); > + return riscv_of_processor_hartid(node); > } > > return -1; >