[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3931cc7932e644bd88f9baf2beddd00d@EXMBX066.cuchost.com>
Date: Wed, 9 Aug 2023 10:24:57 +0000
From: JeeHeng Sia <jeeheng.sia@...rfivetech.com>
To: Conor Dooley <conor@...nel.org>
CC: Conor Dooley <conor.dooley@...rochip.com>,
"palmer@...belt.com" <palmer@...belt.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Atish Patra <atishp@...osinc.com>,
Anup Patel <apatel@...tanamicro.com>,
Alexandre Ghiti <alexghiti@...osinc.com>,
Björn Töpel <bjorn@...osinc.com>,
Song Shuai <suagrfillet@...il.com>,
Petr Tesarik <petrtesarik@...weicloud.com>,
"linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: RE: [RFT 1/2] RISC-V: handle missing "no-map" properties for
OpenSBI's PMP protected regions
> -----Original Message-----
> From: Conor Dooley <conor@...nel.org>
> Sent: Tuesday, August 8, 2023 9:13 PM
> To: JeeHeng Sia <jeeheng.sia@...rfivetech.com>
> Cc: Conor Dooley <conor.dooley@...rochip.com>; palmer@...belt.com; Paul Walmsley <paul.walmsley@...ive.com>; Atish Patra
> <atishp@...osinc.com>; Anup Patel <apatel@...tanamicro.com>; Alexandre Ghiti <alexghiti@...osinc.com>; Björn Töpel
> <bjorn@...osinc.com>; Song Shuai <suagrfillet@...il.com>; Petr Tesarik <petrtesarik@...weicloud.com>; linux-
> riscv@...ts.infradead.org; linux-kernel@...r.kernel.org; stable@...r.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)
Powered by blists - more mailing lists