Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1690499imm; Tue, 2 Oct 2018 12:17:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV63xrg1XQYOtpnQ/n1fmX7V60TgOfzvv9V/QqD/pQefWGDX0K3FPc+vPA7ut4EMj6/cXptYD X-Received: by 2002:a17:902:8d94:: with SMTP id v20-v6mr18053119plo.20.1538507825380; Tue, 02 Oct 2018 12:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538507825; cv=none; d=google.com; s=arc-20160816; b=VJ07GtyvVGvX8LZDcDvCFTIGSqR+TthfktSJyxisg7zgLzDONs+ZqB8sP7grarlpbc UaB8rnIeQTTS6D7Eo+cGvSSksH/qx6yhj+J3t0GciXaLMvljej+g7B9/qWtfFN2R+xxf 7XRgeVmrH61U5Uhv5m42kSZv6rH9BVQIWkpWNV9Bog5J4754WvLpEVN21A9NmXqwEwAN ISKr87CNu1c3T7dRW8fRbC57W8Ere1wvNvFqLfMcEyFraIUVl/WXuhRVWSf1jhtCpDNX 0Dq+210KrCkPpmrnrAkV6BEcCU9w6OBq53+1jGoc2BZURyuPj6gtqEurxI49naE7quHu 2Rew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=bgGdj+iROglUuc4FX1J6g7FTyMGIAGP6uby0p8ghYjQ=; b=SzMFj9coYU5JeRTW8Qpgxk+qYghe9IchV8rZk6z65Ob0ot4bPl9a8sLMQqz5Bplk9J m7uuCQb1R5Ff8y2IFIcuYvcaZVzaq2hMBTyKKu9BYFQ99smDib/ZjUe5JxMYf4MQxyXt HasXyqjOxdOnNIUyqXquW2Cr++mBjuMr7GWa4akuYusSBo1xoKE5j8OTsnil8wTCNW49 o12f1j5GsBEGgeuYJ4LwMT5+bQauXrFs4NuAJALZ+fnbgrYUHEM96l8zKuXZpl8uMW+L W+jksonSFYEFZbAZqV3S73lO0X8K7Iap554YxYxiwIT0qBOm+QjIw0iEDuj4xq6z/PM4 aD8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="E3yLW/Hw"; 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 o125-v6si1390474pgo.302.2018.10.02.12.16.50; Tue, 02 Oct 2018 12:17:05 -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="E3yLW/Hw"; 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 S1727807AbeJCCAB (ORCPT + 99 others); Tue, 2 Oct 2018 22:00:01 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:42347 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726781AbeJCCAB (ORCPT ); Tue, 2 Oct 2018 22:00:01 -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=1538507710; x=1570043710; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=hHc2LrdBwOBtFq/XX/Lx9EyE7SXlK8+7PHJpwa22/DA=; b=E3yLW/HwypPYutamF31jelFaF50EOEy3K8ZCk1MhEz/Z+9dYL20BidmW tpUK9C8QItr2uUxgyyy9Pwzyi42BEP/KyeVg/PqGnriF9bN8R6hbS3sBW Tcz+L5MPlAGwIBati+ueSnnpXW6s6sPbJDA0jv5HPcYDDqpUguNu453GU l5+4zyfq1Z2oRSipFq/FE3CavanQd98fBDqJtxR2b/xyrio9I2L7m/pHg Nb+jCBKljPHOmF1MpIssxqji8aPSIiBX7r3+nJ+xy+Ng0TTFCSunAaF+x ZXbDsHAugQis+t70kivOu+gRfT6dPuOAHCfEcmSzw4EB8kMD4J31DKKR2 w==; X-IronPort-AV: E=Sophos;i="5.54,332,1534780800"; d="scan'208";a="92732900" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 03 Oct 2018 03:15:10 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 02 Oct 2018 12:00:50 -0700 Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip02.wdc.com with ESMTP; 02 Oct 2018 12:15:10 -0700 From: Atish Patra To: linux-riscv@lists.infradead.org, palmer@sifive.com Cc: anup@brainfault.org, hch@infradead.org, linux-kernel@vger.kernel.org, atish.patra@wdc.com Subject: [PATCH v6 07/14] RISC-V: Rename riscv_of_processor_hart to riscv_of_processor_hartid Date: Tue, 2 Oct 2018 12:15:00 -0700 Message-Id: <1538507707-22299-8-git-send-email-atish.patra@wdc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538507707-22299-1-git-send-email-atish.patra@wdc.com> References: <1538507707-22299-1-git-send-email-atish.patra@wdc.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Palmer Dabbelt 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 [Atish: code comment formatting update] Signed-off-by: Atish Patra Reviewed-by: Christoph Hellwig --- arch/riscv/include/asm/processor.h | 2 +- arch/riscv/kernel/cpu.c | 7 +++++-- arch/riscv/kernel/smpboot.c | 2 +- drivers/clocksource/riscv_timer.c | 2 +- drivers/irqchip/irq-sifive-plic.c | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/riscv/include/asm/processor.h b/arch/riscv/include/asm/processor.h index 3fe4af81..50de774d 100644 --- a/arch/riscv/include/asm/processor.h +++ b/arch/riscv/include/asm/processor.h @@ -88,7 +88,7 @@ static inline void wait_for_interrupt(void) } struct device_node; -extern int riscv_of_processor_hart(struct device_node *node); +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 1c0bf662..4723e235 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -15,8 +15,11 @@ #include #include -/* Return -1 if not a valid hart */ -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. + */ +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 670749ec..cfb0b02d 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 4e8b347e..ad7453fc 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 532e9d68..c55eaa31 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; -- 2.7.4