From: Ben Dooks <ben.dooks@codethink.co.uk>
To: "Thorsten Blum" <thorsten.blum@linux.dev>,
"Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Björn Töpel" <bjorn@rivosinc.com>,
"Conor Dooley" <conor.dooley@microchip.com>,
"Nam Cao" <namcao@linutronix.de>,
"Kuan-Wei Chiu" <visitorckw@gmail.com>,
"Klara Modin" <klarasmodin@gmail.com>,
"Han Gao" <rabenda.cn@gmail.com>, "Pu Lehui" <pulehui@huawei.com>
Cc: Alexandre Ghiti <alexghiti@rivosinc.com>,
Yu-Chun Lin <eleanor.lin@realtek.com>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: propagate insert_resource result from add_resource
Date: Tue, 12 May 2026 13:49:56 +0100 [thread overview]
Message-ID: <7ba94699-33a1-471a-9cfa-12f214d6b5e4@codethink.co.uk> (raw)
In-Reply-To: <20260512124628.300360-3-thorsten.blum@linux.dev>
On 12/05/2026 13:46, Thorsten Blum wrote:
> Currently, add_resource() returns 1 on success, even though its callers
> only check for negative values. Instead, propagate the insert_resource()
> result from add_resource() to align with standard kernel return-value
> conventions (0 on success, negative errno on failure).
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> arch/riscv/kernel/setup.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
> index c89cc272440b..6e3d8acae71a 100644
> --- a/arch/riscv/kernel/setup.c
> +++ b/arch/riscv/kernel/setup.c
> @@ -71,16 +71,14 @@ static struct resource *standard_resources;
> static int __init add_resource(struct resource *parent,
> struct resource *res)
> {
> - int ret = 0;
> + int ret;
>
> ret = insert_resource(parent, res);
> - if (ret < 0) {
> + if (ret < 0)
> pr_err("Failed to add a %s resource at %llx\n",
> res->name, (unsigned long long) res->start);
Maybe just use %pR for the resource start/end here and avoid
the casting.
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
https://www.codethink.co.uk/privacy.html
prev parent reply other threads:[~2026-05-12 12:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 12:46 Thorsten Blum
2026-05-12 12:49 ` Ben Dooks [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7ba94699-33a1-471a-9cfa-12f214d6b5e4@codethink.co.uk \
--to=ben.dooks@codethink.co.uk \
--cc=alex@ghiti.fr \
--cc=alexghiti@rivosinc.com \
--cc=aou@eecs.berkeley.edu \
--cc=bjorn@rivosinc.com \
--cc=conor.dooley@microchip.com \
--cc=eleanor.lin@realtek.com \
--cc=klarasmodin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=namcao@linutronix.de \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=pulehui@huawei.com \
--cc=rabenda.cn@gmail.com \
--cc=thorsten.blum@linux.dev \
--cc=visitorckw@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®