Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4514314imm; Tue, 11 Sep 2018 13:07:40 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ58rOF2zHQPuH8cg0AdjCl10JEWMPE9oxUucj9paKPaKopdM7Zr5o7kJtthvLpGfDssoS5 X-Received: by 2002:a17:902:18a:: with SMTP id b10-v6mr29082582plb.62.1536696460612; Tue, 11 Sep 2018 13:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536696460; cv=none; d=google.com; s=arc-20160816; b=wpTSkqkJiMjOM7qQHZOWnYvcdk4In+2mXfctDpAYKhHJ6ouQnfZtna9WrCiTsNQ9P2 4wThrJppwvy9Rj1KbUKHLTwVm4gCwyrzm8cipPU0V+OxSs5dravPOeS7xH5JT274cvQ5 7gKsJbTuaxXlx0DAIXAAHyXCbctPbJL+nmzm/5R4DdzcgWGAJbzo5ydQmx8wd2hTmhgh lIUSiVpA0xWMvEa13/1fxmjE1dGi3creu8Y+AC+8ck7YydqhZfZwgmQoheDnUbWLY8uX 5ITNVQNEYdOk4eBuOVoPHTh33Eg6Zdw+uGjmW476KOA91MEmpU0HGjYSMdRXeC09BM6w uEKg== 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=TaxwL1Vn7Zocd74ibZorJmAkmMfRYZgkf5aF8IkDSWb9Rq6T4jTL1pmWz/M8I23P9a E6vufnQIdqKfgMwUE4oxeaYkDCJcLdUEh0Thn6FSABDYRCvHzkXZ1R7yGB0R6E1RFRkF /oCqK0eIoJOYUus9opoCDIzBQgrfHziPKuxHYavovea7pRxIWZYRfohqgwvxZp6HFLX0 DK40cqQMhlBG/yKzSyVINEQfy0kvdc8lYTdC/DL8yCS5/FQ8M2IPU7juFhWydq4OEEdx by60kU/5K8EwdG7co6ET54+17lCWtvaoZaDyslzfUTYz8BVNbFTeRGZqauI4ONnfwBQV ypKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=ZLwcYafk; 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 n184-v6si19926992pga.98.2018.09.11.13.07.23; Tue, 11 Sep 2018 13:07:40 -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=ZLwcYafk; 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 S1728293AbeILBHc (ORCPT + 99 others); Tue, 11 Sep 2018 21:07:32 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:52888 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727806AbeILBGf (ORCPT ); Tue, 11 Sep 2018 21:06:35 -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=1536696343; x=1568232343; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=hHc2LrdBwOBtFq/XX/Lx9EyE7SXlK8+7PHJpwa22/DA=; b=ZLwcYafkDM12At0lLbC3yQly6vTQ2hozPV33Wcg3QNvrN/pppvl7tyQe M0lh2NNk9l/ChvfK++j05qL/VEBhJbSmh1tX7k6Zmufv2qwfb9MDbQF+u +Sz7mt6cJ9FHo4pcEmCCRWBedYTx8UJW9dcP46DOvBb4T5vdau2fIc+gv jq2UVUaGrj1hL926E/GdN3I0pJg6C71SUJn67pzBYwLWBKcoz2Tzr53ZS LVyDAw1NMMtImq48Mi4fwdTKqPdqU7qbB226l3xUBWZc8ScLBEDyKIkFt 9QXBjK2aHpt5ld2b1yDsk2xr8d23S4x27jf0aY3zuqjYcAr9yLQF2ZYX5 Q==; X-IronPort-AV: E=Sophos;i="5.53,361,1531756800"; d="scan'208";a="193728833" 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; 12 Sep 2018 04:05:42 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 11 Sep 2018 12:52:16 -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; 11 Sep 2018 13:05:43 -0700 From: Atish Patra To: palmer@sifive.com, linux-riscv@lists.infradead.org Cc: mark.rutland@arm.com, hch@infradead.org, anup@brainfault.org, 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 Subject: [PATCH v4 07/12] RISC-V: Rename riscv_of_processor_hart to riscv_of_processor_hartid Date: Tue, 11 Sep 2018 13:05:34 -0700 Message-Id: <1536696339-15204-8-git-send-email-atish.patra@wdc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536696339-15204-1-git-send-email-atish.patra@wdc.com> References: <1536696339-15204-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