[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6719a9e5f2a29_da1f9294c4@iweiny-mobl.notmuch>
Date: Wed, 23 Oct 2024 20:59:02 -0500
From: Ira Weiny <ira.weiny@...el.com>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>, Ira Weiny
<ira.weiny@...el.com>
CC: Dave Jiang <dave.jiang@...el.com>, Fan Ni <fan.ni@...sung.com>, "Navneet
Singh" <navneet.singh@...el.com>, Jonathan Corbet <corbet@....net>, "Andrew
Morton" <akpm@...ux-foundation.org>, Dan Williams <dan.j.williams@...el.com>,
Davidlohr Bueso <dave@...olabs.net>, Alison Schofield
<alison.schofield@...el.com>, Vishal Verma <vishal.l.verma@...el.com>,
<linux-btrfs@...r.kernel.org>, <linux-cxl@...r.kernel.org>,
<linux-doc@...r.kernel.org>, <nvdimm@...ts.linux.dev>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 27/28] tools/testing/cxl: Make event logs dynamic
Jonathan Cameron wrote:
> On Mon, 07 Oct 2024 18:16:33 -0500
> Ira Weiny <ira.weiny@...el.com> wrote:
>
[snip]
> >
> > Signed-off-by: Ira Weiny <ira.weiny@...el.com>
> Might be worth breaking up into refactor (the static cases) and
> then new stuff.
I had it split but the rework became difficult. And this is test code so
I merged it. I'd rather keep it as is.
>
> Otherwise one trivial comment inline.
>
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Thanks.
>
> >
> > ---
> > Changes:
> > [iweiny: rebase to 6.12]
> > ---
> > tools/testing/cxl/test/mem.c | 268 ++++++++++++++++++++++++++-----------------
> > 1 file changed, 162 insertions(+), 106 deletions(-)
> >
> > diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c
> > index ccdd6a504222..5e453aa2819b 100644
> > --- a/tools/testing/cxl/test/mem.c
> > +++ b/tools/testing/cxl/test/mem.c
> > @@ -126,18 +126,26 @@ static struct {
>
> > /* Handle can never be 0 use 1 based indexing for handle */
> > -static u16 event_get_clear_handle(struct mock_event_log *log)
> > +static u16 event_inc_handle(u16 handle)
> > {
> > - return log->clear_idx + 1;
> > + handle = (handle + 1) % CXL_TEST_EVENT_ARRAY_SIZE;
> > + if (!handle)
> > + handle = handle + 1;
>
> That's a little confusing for me
>
> if (handle == 0)
> handle = 1;
Done.
Ira
Powered by blists - more mailing lists