Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3308221lqo; Tue, 21 May 2024 12:53:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVM9MJulQnzGAs8fxSk4+0J5qOMCBqtYg+W6kEbMJpGnlnBNnFjL23S7KCmwT9RvxJkAK/FIElLTLL2K11n1KUDdlrt9q+tGuYmNV9pSQ== X-Google-Smtp-Source: AGHT+IHXK94MdHKLMR5T8YoAAeCwSATSZLQ8Q52QBfMk9bnWeKtZfBnYBFcQlC3vGxQKSklMgpur X-Received: by 2002:a05:6a20:430a:b0:1a7:7505:ac97 with SMTP id adf61e73a8af0-1b1f87ecc08mr51453637.11.1716321211250; Tue, 21 May 2024 12:53:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716321211; cv=pass; d=google.com; s=arc-20160816; b=x7aL+/vk0dU80/tN4jE+BJQYoCuKU0EiFBCGeLpC2vhANCc7dl3gN8wJzqoLsi0D5o v5gxgddoRBF1vF/tcVxbWjSMyKR9iXI7jgaTpiNdP8Tsp2soDxetA6RwCHFRvMlaD6iJ ca/Dtn76u8ai4hkTOrpzUAr10dsJt+3fZ6Strsymfi7HPgfDa0TY+1fP5i5Q0Wu9s5NS 4MGOJUNt7e43wheaCCLt6E3np1Y5PKEfecpJ6mdVUqd321a6+U+OIQasy3a0N9i15WB4 cO2rPfBwb0V5h/PkkOOTFP9P85kD99ME8XnA8seR+nsrBcH3/UAEWa1ncYtsKZFGHjdF lGhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZbYRpJnrZCfaLu7/cvbOYxvRUcoL0AdzOTF6tviCoZE=; fh=vsy5oOM3jKMPSozjj0Sm6sdsF7YyOk3ebKwRnl/K6ro=; b=n20Rc1Kn//jUoDM8PzPTb3HZ4M8OxyUGrl+81A7qAvFdRRhZU5dAqm7+WGkmWsY4ql yZJV9AQ2dUfeObtm71DUc7gip1pAkdK7DdqxggiDYTyMmZANHC34Z+P6DJ8SQHsaVLRe 9P75gKhXg3FZ5puVoEArFmtdqTkTFZbuovnLDBAan+N358CFaQeZTRRErsGCY/dLlgjM qYTpY6tbuZzCsSIf09Lq5qveO0UaPVeslCQfhAOF+U/C6VK8axVZ88L8hWT+1bg7XGc5 T7i9GK09b0C89LN2p3AIk+zzd4B0jIZZYtVe9/eibnte9sbX7mQ7OjwwS14SYmSRpsWI 3RJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bKAcwqxM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6623d7a2baesi1120432a12.579.2024.05.21.12.53.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 12:53:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bKAcwqxM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D732BB22584 for ; Tue, 21 May 2024 19:50:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B65A149DF1; Tue, 21 May 2024 19:49:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bKAcwqxM" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7652E149C58; Tue, 21 May 2024 19:49:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716320965; cv=none; b=D0qSjb7CAYQGGOAoyxmmsIchK6/NRNqwCPtEd2I/gvwEXv0IHEddz56pKPSgGHj8jMMX4coZAjiWh0Ogzfeovhb2j0l1L9GnuE3XFsI/+I2tCzWL49FK0Hu3n8xxoSAKn9xhbLTtO2emaPvBhnkdZESIf0v6kFsSYFnFO33x7oY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716320965; c=relaxed/simple; bh=5VxfSyKHqzOTEZZXzZT0aLiSoKTpopx0vsuhYEVZU44=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Hwzbzb+96TJdTjoH5+0zfitPjW3uXA6HSvaHE/NC1zIm3FTV1Hxh8fidbhFw8w5QIZV7E0OUNjd7OJinTdHuiKM48jiBdBlAUCLpUHgt+dbM3NYqgFWQguw5VXwZyIy1MO2ndW/JCZJgJblIJIdmP5OjkNEY1XEt4H3jQfB7iU0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bKAcwqxM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDBDAC32782; Tue, 21 May 2024 19:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716320965; bh=5VxfSyKHqzOTEZZXzZT0aLiSoKTpopx0vsuhYEVZU44=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bKAcwqxMdvphissksxBIPo4FGq5KPKX5AEWVVQ7lfMWYqInRJAiv62MhaLPG8X/CJ LPy2sNv63Ns1zkEtgNV5LYXsdZZxw2z9bmmmUBOV3XvxhyUmm4NLiRft4/a/9tvmAd JgFA+/vxMLqr18xEdz4O8WjbWSLTvY6QSkQxiJ6Ch2Kk63BOeNCBoMoSppWHHAC6T4 u73/wl8C6JEKK1Dbz+0RbvlfAn/zKENyT8qj2OlRC6J9rtupS9o2Okfe8K2dsqSxoE zSHmCE6ARjH+EqqoV+acJDZTEK2z5xBLiavm3H8wzLBpW9uDz+1021dqaMh7HmU4Ld opUY8g2tiYyLA== Date: Tue, 21 May 2024 20:49:19 +0100 From: Conor Dooley To: =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= Cc: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Rob Herring , Krzysztof Kozlowski , Anup Patel , Shuah Khan , Atish Patra , linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v5 08/16] riscv: add ISA parsing for Zca, Zcf, Zcd and Zcb Message-ID: <20240521-spiny-undergrad-efa1a391ad3d@spud> References: <20240517145302.971019-1-cleger@rivosinc.com> <20240517145302.971019-9-cleger@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZUPGMxJHsaJik2Qb" Content-Disposition: inline In-Reply-To: <20240517145302.971019-9-cleger@rivosinc.com> --ZUPGMxJHsaJik2Qb Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 17, 2024 at 04:52:48PM +0200, Cl=E9ment L=E9ger wrote: > +static int riscv_ext_zca_depends(const struct riscv_isa_ext_data *data, > + const unsigned long *isa_bitmap) > +{ > + return __riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_ZCA) ?= 0 : -EPROBE_DEFER; > +} > +static int riscv_ext_zcd_validate(const struct riscv_isa_ext_data *data, > + const unsigned long *isa_bitmap) > +{ > + return __riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_ZCA) && > + __riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_d) ? 0= : -EPROBE_DEFER; > +} Could you write the logic in these out normally please? I think they'd be more understandable (particular this second one) broken down and with early return. Otherwise, Reviewed-by: Conor Dooley Cheers, Conor. --ZUPGMxJHsaJik2Qb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZkz6vwAKCRB4tDGHoIJi 0kLvAQCE6VdTKzQsLhuTCAot4T9V9f4Lr+mwFH/JYa+PN4XSawEA4Bpid+JyrYkM 5yKjg6DZQIn95XuoTjrLNnKL0qkRvw0= =XDFW -----END PGP SIGNATURE----- --ZUPGMxJHsaJik2Qb--