Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1038264imm; Thu, 13 Sep 2018 11:38:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZCyrjaIz8zD0xDqlhw5IZppmI6pE5z+nKeZKUMTOZgZp4LDbEaZpYCXYWQxFqmO4e31BSm X-Received: by 2002:a17:902:4a0c:: with SMTP id w12-v6mr8431042pld.289.1536863900826; Thu, 13 Sep 2018 11:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536863900; cv=none; d=google.com; s=arc-20160816; b=MGvCscLe96UHIF5gdhViDcM62sdGaou8qtAHM6z+SanqdRfuRUGwO3ga4t/Kllvcof iMOXaNVh0b+K4L7w4TqQAFck0ikJDhf7ecuYK+TEUaBeTa+ee0uW1P/zgPldkk9ZyJMg d+EOtC5drAhbKQ1v9Q4zlW+VAHwVDkFgiTApuDdAErP5HAFGl1Xhc1Ou5mqmsvJq67aR 8oxrU6ELJw3CKQclV2iUHhqH8kZ/j2BT+bKOoHriNGRuIn2rgFQvsrqwQD89BPnLXFCg L27vaeXQcYYKAujp2kn89A1pReEGXQVlXgr9prTZJZdlpEnL26H2g9OVY65IHAQe/4gA d7oA== 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=bNFad8pn7BT8s1k75Oql7NSBx3cSDKXZcy1w6nFW95vRPJnRcMIStE+pE27TNgpEnj fGdyw3/zkKvWWjXAODoLp9JkE6zmUBZrbwrb9y2OVKGB3q01KBzHPumU30YzYhNn59zn KPlDnpjWylWBSeV6Y2AmVLD2ympFbNLdGqlhoB7udQY6t0Fi+oU6ENhHwzaGjGfZfwS6 SrklSHOsfawLFdtDjtovWoHdhsmzEq9d3GpZrHn3FgS1Tuj35V0Rn0fgAk0tQ9/jzSHK KjyoTGWpYECvaYP+19KJnKNncZ+jv4EkcSLtRZVVyooOUZgT8kvj6Ws12t3+6IpZOeIG cDzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=p8OfWjMZ; 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 q5-v6si4203908pls.435.2018.09.13.11.38.05; Thu, 13 Sep 2018 11:38:20 -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=p8OfWjMZ; 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 S1728310AbeIMXsW (ORCPT + 99 others); Thu, 13 Sep 2018 19:48:22 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:26981 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728122AbeIMXru (ORCPT ); Thu, 13 Sep 2018 19:47:50 -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=1536863829; x=1568399829; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=hHc2LrdBwOBtFq/XX/Lx9EyE7SXlK8+7PHJpwa22/DA=; b=p8OfWjMZEyPWvJrAev2W3lao5nI1gAbiS+9cpJMqlqhhXtdhmMJuuG1h oybQUgntdkBC/0lep4ENRXbYzNUgsXboV6K8123EdqkbOfIvLAbXM/vE+ yy+oG3ijD5rnxssaW10k9OPpO7Vw3EtJiOU1FHYih6+WXvs3LH73Mx6DY CpLYV9//fjXaEzBf1g8fDNKRs6Vj4Amart4+KUkoky7gsY19aj6g/9FSb BI3k+VpFcc40ifUrJm/oSVzDQYwFNxzTOZ+Xz9feJ55CMuimlLxCJP/I7 B08DcRSosJfmlig6pB92TbdrfVc/lpJgXbLH5YasByP1lFQmImYdFFird g==; X-IronPort-AV: E=Sophos;i="5.53,370,1531756800"; d="scan'208";a="89712022" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 14 Sep 2018 02:37:09 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 13 Sep 2018 11:23:39 -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; 13 Sep 2018 11:37:08 -0700 From: Atish Patra To: palmer@sifive.com, linux-riscv@lists.infradead.org, hch@infradead.org, anup@brainfault.org Cc: mark.rutland@arm.com, atish.patra@wdc.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, Damien.LeMoal@wdc.com, marc.zyngier@arm.com, jeremy.linton@arm.com, gregkh@linuxfoundation.org, jason@lakedaemon.net, catalin.marinas@arm.com, dmitriy@oss-tech.org, ard.biesheuvel@linaro.org, schwab@linux-m68k.org Subject: [PATCH v5 07/12] RISC-V: Rename riscv_of_processor_hart to riscv_of_processor_hartid Date: Thu, 13 Sep 2018 11:37:00 -0700 Message-Id: <1536863825-66808-8-git-send-email-atish.patra@wdc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536863825-66808-1-git-send-email-atish.patra@wdc.com> References: <1536863825-66808-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