-----Original Message----- From: Conor Dooley conor@kernel.org Sent: Tuesday, August 8, 2023 9:13 PM To: JeeHeng Sia jeeheng.sia@starfivetech.com Cc: Conor Dooley conor.dooley@microchip.com; palmer@dabbelt.com; Paul Walmsley paul.walmsley@sifive.com; Atish Patra atishp@rivosinc.com; Anup Patel apatel@ventanamicro.com; Alexandre Ghiti alexghiti@rivosinc.com; Björn Töpel bjorn@rivosinc.com; Song Shuai suagrfillet@gmail.com; Petr Tesarik petrtesarik@huaweicloud.com; linux- riscv@lists.infradead.org; linux-kernel@vger.kernel.org; stable@vger.kernel.org Subject: Re: [RFT 1/2] RISC-V: handle missing "no-map" properties for OpenSBI's PMP protected regions
On Mon, Aug 07, 2023 at 12:44:07AM +0000, JeeHeng Sia wrote:
+/* SBI implementation IDs */ +#define SBI_IMP_OPENSBI 1
I would suggest to create an enum struct for the SBI Imp ID in the sbi.h file. What do you think?
I'm not really sure what the advantage of doing so is.
The macro SBI_IMP_OPENSBI seems weird (I would read it as "SBI Implementation OpenSBI"). However, if we implement an enum struct for SBI_IMP_ID (There are numerous IDs available), the macro can be abbreviated to OpenSBI. By doing this, the conditional checking of the implementation ID would be more readable, as shown below: if (sbi_firmware_id != OPENSBI)