[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210203171219.GA4104698@infradead.org>
Date: Wed, 3 Feb 2021 17:12:19 +0000
From: Christoph Hellwig <hch@...radead.org>
To: Ben Widawsky <ben.widawsky@...el.com>
Cc: Christoph Hellwig <hch@...radead.org>, linux-cxl@...r.kernel.org,
linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-nvdimm@...ts.01.org, linux-pci@...r.kernel.org,
Bjorn Helgaas <helgaas@...nel.org>,
Chris Browy <cbrowy@...ry-design.com>,
Dan Williams <dan.j.williams@...el.com>,
Ira Weiny <ira.weiny@...el.com>,
Jon Masters <jcm@...masters.org>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Rafael Wysocki <rafael.j.wysocki@...el.com>,
Randy Dunlap <rdunlap@...radead.org>,
Vishal Verma <vishal.l.verma@...el.com>,
daniel.lll@...baba-inc.com,
"John Groves (jgroves)" <jgroves@...ron.com>,
"Kelley, Sean V" <sean.v.kelley@...el.com>
Subject: Re: [PATCH 02/14] cxl/mem: Map memory device registers
On Tue, Feb 02, 2021 at 10:31:51AM -0800, Ben Widawsky wrote:
> > > + if (reg_type == CXL_REGLOC_RBI_MEMDEV) {
> > > + rc = 0;
> > > + cxlm = cxl_mem_create(pdev, reg_lo, reg_hi);
> > > + if (!cxlm)
> > > + rc = -ENODEV;
> > > + break;
> >
> > And given that we're going to grow more types eventually, why not start
> > out with a switch here? Also why return the structure when nothing
> > uses it?
>
> We've (Intel) already started working on the libnvdimm integration which does
> change this around a bit. In order to go with what's best tested though, I've
> chosen to use this as is for merge. Many different people not just in Intel
> have tested these codepaths. The resulting code moves the check on register
> type out of this function entirely.
>
> If you'd like me to make it a switch, I can, but it's going to be extracted
> later anyway.
This was just a suggestion. No hard feelings, it's just that the code
looks a little odd to me.
Powered by blists - more mailing lists