Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3173190imu; Fri, 18 Jan 2019 06:07:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN7vmJ0Tsdj1zb5yl8gh/3Ct0ID9yfSTN6hsXJSX7Pdj2NSL2latPjwQORtRWXKR3B8TkG8g X-Received: by 2002:a17:902:45:: with SMTP id 63mr18657018pla.272.1547820434998; Fri, 18 Jan 2019 06:07:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547820434; cv=none; d=google.com; s=arc-20160816; b=tIg04TsGDQfS+M6ZYHLjbJUYiUPTjBNb5jjkiTCxYCOhJo3o5yfNKbJwvhw+0XkB/J DiaHOBxuhwaqrceu7aftAuCanAkMqNmM+kZmQdOnDd0e+X6o8UwAvNjqnIrrGfJE+Gve gOZoqNN6LgW33xwbUpmvtQ4PAXwtwyGZeqN1wOj8h5jHocSOqTt3tadFIKtYp4XlT5Ij JzZ5gwLzSG60BdvDCKwLGvdMYnq4CIHMEbxdPQVWyqxlIsmZTVZWg4Ep0XvLnYq+1fY8 XdHlaVl0PmcwXzsM5Ti23foO6x2VeY3asG1CO1mI1T4/gOib/U13b6tIsRN8BCg8Ea0B 11/Q== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=edUxdz3ce3gWnciU4XX+2JLaYdCsYRbrNsJxn6e+a2w=; b=eqcDgZ/m6KWJlc8TANEoyxlnfR1bV57ifRoUB25tLciqPovqIzpnLl7+SsPhO4DDAv RP3xn/7BTsvYo9TFjqQNKCli1NAxtaFxfV5aJjuzPgnfCWruu9htLHGnW3CqVIZ5Q2N1 7YmN2Tv8MTOtAwScHwQQJBwVAD346pRwXsQvjDJnwK2YBFyCMMuDllS3QNIt4YfWx9DA yTMNgwSYU0GCcppVaiau4fnliBGE/ZwrQQMJiyPjfYG+hDT04D63vG0/RlQNlp7fWNwa 4PP67OdNYAb718nq6syjW5vioUIvvvSjcvtwoDS0nZANFzuip+eqDjyP/7xoiWYKYthD FI9g== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l186si4641694pge.205.2019.01.18.06.06.53; Fri, 18 Jan 2019 06:07:14 -0800 (PST) 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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727826AbfAROEu (ORCPT + 99 others); Fri, 18 Jan 2019 09:04:50 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:42082 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727404AbfAROEo (ORCPT ); Fri, 18 Jan 2019 09:04:44 -0500 Received: by mail-lf1-f65.google.com with SMTP id l10so10558553lfh.9 for ; Fri, 18 Jan 2019 06:04:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=edUxdz3ce3gWnciU4XX+2JLaYdCsYRbrNsJxn6e+a2w=; b=eKdwabdmA+DxmsyxDFPXlaCFW03UswE+cjH4YbDqpNwHOqNNf+AhBbHJTdfy/3mhZ8 nQ8JaftSHsuLA6yZEY22038e7tXoTiDuRcJ1WwKxhSBOUIJF9yKURPVT4x0dftxLOB3w HGHP/LI1nFJoIElSl+tOFtLWKGpazhpaVNR+3vtct7U0sEP8a8bHYWoCNLp717RCA2K4 4yW5M7WO1W9W/UPE+RldQJtKc9kQkpsFtw43YMHxXEaudKW/9M2QqSFhKpGUVd92v4I2 A9kIRpjAyznL8cvEqIoe5cHSdY4QGVLWrvu4w7tDrm4g91tstPZ9G0FWaXWB3IOxBqgr jVhQ== X-Gm-Message-State: AJcUuke+wXuUF0L1FND6AbSduNrivPk27skibQFb6g+V09QphHwa/yJb pTRrw4sXx6yYtWuWQsWSJDU= X-Received: by 2002:a19:4287:: with SMTP id p129mr13239723lfa.135.1547820281776; Fri, 18 Jan 2019 06:04:41 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id z9sm797530lfj.79.2019.01.18.06.04.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 06:04:39 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gkUlB-0002W0-BQ; Fri, 18 Jan 2019 15:04:37 +0100 From: Johan Hovold To: Palmer Dabbelt Cc: Albert Ou , Andreas Schwab , Atish Patra , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 3/5] riscv: fix riscv_of_processor_hartid() comment Date: Fri, 18 Jan 2019 15:03:06 +0100 Message-Id: <20190118140308.9599-4-johan@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190118140308.9599-1-johan@kernel.org> References: <20190118140308.9599-1-johan@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The riscv_of_processor_hartid() helper returns -ENODEV when the specified node isn't an enabled and valid RISC-V hart node. Also drop the unnecessary parenthesis around errno defines. Signed-off-by: Johan Hovold --- arch/riscv/kernel/cpu.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 11ba67f010e7..974d374fd36b 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -17,8 +17,8 @@ #include /* - * Returns the hart ID of the given device tree node, or -1 if the device tree - * node isn't a RISC-V hart. + * Returns the hart ID of the given device tree node, or -ENODEV if the node + * isn't an enabled and valid RISC-V hart node. */ int riscv_of_processor_hartid(struct device_node *node) { @@ -27,34 +27,34 @@ int riscv_of_processor_hartid(struct device_node *node) if (!of_device_is_compatible(node, "riscv")) { pr_warn("Found incompatible CPU\n"); - return -(ENODEV); + return -ENODEV; } if (of_property_read_u32(node, "reg", &hart)) { pr_warn("Found CPU without hart ID\n"); - return -(ENODEV); + return -ENODEV; } if (hart >= NR_CPUS) { pr_info("Found hart ID %d, which is above NR_CPUs. Disabling this hart\n", hart); - return -(ENODEV); + return -ENODEV; } if (of_property_read_string(node, "status", &status)) { pr_warn("CPU with hartid=%d has no \"status\" property\n", hart); - return -(ENODEV); + return -ENODEV; } if (strcmp(status, "okay")) { pr_info("CPU with hartid=%d has a non-okay status of \"%s\"\n", hart, status); - return -(ENODEV); + return -ENODEV; } if (of_property_read_string(node, "riscv,isa", &isa)) { pr_warn("CPU with hartid=%d has no \"riscv,isa\" property\n", hart); - return -(ENODEV); + return -ENODEV; } if (isa[0] != 'r' || isa[1] != 'v') { pr_warn("CPU with hartid=%d has an invalid ISA of \"%s\"\n", hart, isa); - return -(ENODEV); + return -ENODEV; } return hart; -- 2.20.1