[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWwRXKP51vX9KYjiwdZ9mUhsnLxkrAex+LwKpCw-H7=8A@mail.gmail.com>
Date: Thu, 8 Sep 2022 21:28:45 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: matthew.gerlach@...ux.intel.com
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Wu Hao <hao.wu@...el.com>, Xu Yilun <yilun.xu@...el.com>,
russell.h.weight@...el.com, basheer.ahmed.muddebihal@...el.com,
Tom Rix <trix@...hat.com>, Moritz Fischer <mdf@...nel.org>,
linux-fpga@...r.kernel.org,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
tianfei.zhang@...el.com, Jonathan Corbet <corbet@....net>,
Greg KH <gregkh@...uxfoundation.org>,
"open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
Jiri Slaby <jirislaby@...nel.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Niklas Söderlund
<niklas.soderlund+renesas@...natech.se>,
Phil Edworthy <phil.edworthy@...esas.com>,
"Maciej W. Rozycki" <macro@...am.me.uk>,
Johan Hovold <johan@...nel.org>, Lukas Wunner <lukas@...ner.de>
Subject: Re: [PATCH v1 4/5] fpga: dfl: add generic support for MSIX interrupts
Hi Matthew,
On Thu, Sep 8, 2022 at 7:34 PM <matthew.gerlach@...ux.intel.com> wrote:
> On Thu, 8 Sep 2022, Andy Shevchenko wrote:
> > On Wed, Sep 07, 2022 at 02:37:32PM -0700, matthew.gerlach@...ux.intel.com wrote:
> >> On Tue, 6 Sep 2022, Andy Shevchenko wrote:
> >>> On Tue, Sep 06, 2022 at 12:04:25PM -0700, matthew.gerlach@...ux.intel.com wrote:
> >
> > ...
> >
> >>>> + if (fid != FEATURE_ID_AFU && fid != PORT_FEATURE_ID_ERROR &&
> >>>> + fid != PORT_FEATURE_ID_UINT && fid != FME_FEATURE_ID_GLOBAL_ERR) {
> >>>> + v = readq(base);
> >>>> + v = FIELD_GET(DFH_VERSION, v);
> >>>> +
> >>>> + if (v == 1) {
> >>>> + v = readq(base + DFHv1_CSR_SIZE_GRP);
> >>>
> >>> I am already lost what v keeps...
> >>>
> >>> Perhaps
> >>>
> >>> v = readq(base);
> >>> switch (FIELD_GET(DFH_VERSION, v)) {
> >>> case 1:
> >>> ...
> >>> break;
> >>> }
> >>
> >> How about?
> >> if (FIELD_GET(DFH_VERSION, readq(base)) == 1) {
> >> ...
> >> }
> >
> > This one tends to be expanded in the future, so I would keep it switch case.
> >
>
> I'm okay with using the switch statement, but how about the following?
>
> switch (FIELD_GET(DFH_VERSION, readq(base))) {
> case 1:
> ...
> break;
> }
Would it make sense to print an error if a newer version than 1 is detected?
BTW, what is the expected value when DFHv1 is not detected? Zero
or an arbitrary number?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists