Re: [PATCH] riscv: change CSR M/S defines to use "X" for prefix
From: Olof Johansson
Date: Fri Jan 03 2020 - 22:05:19 EST
On Fri, Jan 3, 2020 at 5:28 PM Paul Walmsley <paul.walmsley@xxxxxxxxxx> wrote:
> On Wed, 18 Dec 2019, Olof Johansson wrote:
> > Commit a4c3733d32a7 ("riscv: abstract out CSR names for supervisor vs
> > machine mode") introduced new non-S/M-specific defines for some of the
> > CSRs and fields that differ for when you run the kernel in machine or
> > supervisor mode.
> > One of those was "IRQ_TIMER" (instead of IRQ_S_TIMER/IRQ_M_MTIMER),
> > which was generic enough to cause conflicts with other defines in
> > drivers. Since it was in csr.h, it ended up getting pulled in through
> > fairly generic include files, etc.
> > I looked at just renaming those, but for consistency I chose to rename all
> > M/S symbols to using 'X' instead of 'S'/'M' in the identifiers instead,
> > which gives them all less generic names.
> > This is pretty churny, and I'm sure there'll be opinions on naming, but
> > I figured I'd do the busywork of fixing it up instead of just pointing
> > out the conflicts.
> > Fixes: a4c3733d32a7 ("riscv: abstract out CSR names for supervisor vs machine mode")
> > Cc: Christoph Hellwig <hch@xxxxxx>
> > Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> > Signed-off-by: Olof Johansson <olof@xxxxxxxxx>
> Thanks for taking a stab at fixing the issue. I queued the following
> minimal fix has been queued for v5.5-rc, adding an RV_ prefix to the IRQ_*
> macros. It may be that we need to do the same thing to the rest of the
> CSRs. But, based on a quick look, I think we should be OK for the moment.
> Let us know if you have a different point of view.
Sure, this does the job. I'd personally prefer consistent prefixes but
that's just bikeshed color preferences -- this is fine.
Acked-by: Olof Johansson <olof@xxxxxxxxx>
(Builds are still failing for some configs, but will be fixed if/when
you pick up https://lore.kernel.org/linux-riscv/20191217040631.91886-1-olof@xxxxxxxxx/)