From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from imap4.hz.codethink.co.uk (imap4.hz.codethink.co.uk [188.40.203.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDC293ADBBF for ; Tue, 12 May 2026 12:50:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=188.40.203.114 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778590249; cv=none; b=NiaRvi5AJ797p+Bohox6W+Aa/WJs50lf7vfoY5AIncFk/oycHv+WA/IxXzgQsvHOCbywr0nfroylMZmCIt1Kq2VUXFc+4uf6hbd1j+7zECgUUZ+ubagLdX2OeXi4nKds6Q7xPs5BbDHkaPDcgX5w6sZdDvwVQo3oQolfws5upfY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778590249; c=relaxed/simple; bh=0HsVIeqwq0NB32kMIX+Ko4ZnuTvmz8ytLE3OKbUt0IA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tVEuS0mQZc6AybEtzKWaXL/+/60p56qio2Va5thqchpZ017tEUwVILXTbGv5EguPVVNyma1WlIOeXg7eUiWodGqF9a9793KJx6r4vzO/qk4ccJDlKvMB0mu/BxTRkqKrub7ZTnyuW7SP8SPHcTBHtNZUQ5t3ALwU+mn4YnqZHI8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=codethink.co.uk; spf=pass smtp.mailfrom=codethink.co.uk; dkim=pass (2048-bit key) header.d=codethink.co.uk header.i=@codethink.co.uk header.b=iJY29+f8; arc=none smtp.client-ip=188.40.203.114 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=codethink.co.uk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=codethink.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=codethink.co.uk header.i=@codethink.co.uk header.b="iJY29+f8" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codethink.co.uk; s=imap4-20230908; h=Sender:Content-Transfer-Encoding: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID: Reply-To; bh=xqp9ISv23ekp1QjAZQxuydHpiWlMqt/FMfh3u7T4RJg=; b=iJY29+f8g3KLW7kS PuHFcowUUSSPesShf2xoKmpV1gm/XSTyUt2IwON9rBhUVUibpkKttyFT3KSDNp1UMOBx8okBleKQl rtzLzfoGc1V1M1LoEF6AyUq+sd+rX1CYFRnPtbPE5/aeZrdcVLODwcSYVcc6BlfO9z/bMMO3E4PfP M9SfsA26zEkM8jR/mY06uwjNExqTAOibfvMvQAN6vlgwzD0GhBiDX0ZF7qI9hEnITuHjiieyRYBMs BgAMNJPcP1SBRDSLjzf1hraaZLtaUx4HRwxGOxU4UBBE2QxyB9hpvDEl+2NYwK4x/FgIYUhpDS9CT zSVlRflswRdu+jDJnw==; Received: from [63.135.74.212] (helo=[192.168.1.241]) by imap4.hz.codethink.co.uk with esmtpsa (Exim 4.94.2 #2 (Debian)) id 1wMmYk-0002Lo-H8; Tue, 12 May 2026 13:50:02 +0100 Message-ID: <7ba94699-33a1-471a-9cfa-12f214d6b5e4@codethink.co.uk> Date: Tue, 12 May 2026 13:49:56 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] riscv: propagate insert_resource result from add_resource To: Thorsten Blum , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Conor Dooley , Nam Cao , Kuan-Wei Chiu , Klara Modin , Han Gao , Pu Lehui Cc: Alexandre Ghiti , Yu-Chun Lin , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260512124628.300360-3-thorsten.blum@linux.dev> Content-Language: en-GB From: Ben Dooks Organization: Codethink Limited. In-Reply-To: <20260512124628.300360-3-thorsten.blum@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: ben.dooks@codethink.co.uk 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 > --- > 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