[asahilinux:nvme/dev 13/17] drivers/nvme/host/pci.c:2249:2-3: Unneeded semicolon
Arnd Bergmann
arnd at arndb.de
Mon Aug 9 03:02:55 PDT 2021
+ On Sat, Aug 7, 2021 at 7:43 PM Christoph Hellwig <hch at infradead.org> wrote:
>
> FYI, I think the approach to mess up the nvme-pci driver in this
> branch is completely unacceptable for upstream.
>
> Please create an entirely separate driver plugging into nvme_ctrl_ops.
Hi Christoph,
I wrote the initial version of the series with the intention for testing
out how much of the code can be shared between the pci_driver
and the platform_driver version.
I tried to avoid moving around or duplicating code for this, to make
it easier to rebase until we have decided what the final code should
look like. It would be fairly easy to take the version that sven is
testing, and then remove all the PCI bits from that driver to get
to a separate nvme_ctrl_ops implementation, but that does mean
a great deal of duplication. I initially planned to send my patches
as an RFC to the list, but I never managed to get it working before
I lost access to the machine I had. Sven got it working fine with a
little rework then.
Out of the 3557 lines for the combined pci/platform driver, I ended
up with 475 lines that are specific to the PCI version, and 104
lines that are specific to the platform driver. There are probably
a few more bits that could be removed from a platform-only version,
but I still expect the majority of the code to be the same, which is why
I was hoping we could rearrange the code in a way that puts those
into a library module, either as part of the existing nvme-core.ko,
or a new nvme-mmio.ko that is used by both pci and platform
front-ends.
Simply moving the common functions into a separate file, and
exporting the symbols would work, but probably won't lead to
the best structure without some more rework.
Do you have any further suggestions? Should we just duplicate
the driver and then simplify the platform version as much as possible
as you suggested above, or try to share some of the code according
to my original plan?
Arnd
More information about the Linux-nvme
mailing list