[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 3/5] riscv: Allow user to set the satp mode
From: |
Andrew Jones |
Subject: |
Re: [PATCH v7 3/5] riscv: Allow user to set the satp mode |
Date: |
Wed, 25 Jan 2023 16:00:35 +0100 |
On Wed, Jan 25, 2023 at 01:23:45PM +0100, Alexandre Ghiti wrote:
> On Wed, Jan 25, 2023 at 1:01 PM Andrew Jones <ajones@ventanamicro.com> wrote:
> >
> > On Wed, Jan 25, 2023 at 09:41:05AM +0100, Alexandre Ghiti wrote:
...
> > > + if (!rv32) {
> > > + for (int i = satp_mode_max - 1; i >= 0; --i) {
> >
> > satp_mode_max can be zero when configs only support mbare, so we need
> > to be careful here. We should only run this loop when it's greater than
> > zero.
>
> If satp_mode_max == 0, we don't enter the loop, so no problem for me.
>
Oh, right, i is signed. I reviewed this right after reviewing some
unsigned comparisons and had the wrong thought process engaged...
And now I recall that when I'd read this before in previous revisions
I had had the same impulse at least once, but those times I noticed
it was signed before sending comments. Anyway, sorry for the noise.
Thanks,
drew