From: Christoph Hellwig <hch@lst.de>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Christoph Hellwig <hch@lst.de>,
Alex Williamson <alex.williamson@redhat.com>,
Cornelia Huck <cohuck@redhat.com>,
Jonathan Corbet <corbet@lwn.net>,
kvm@vger.kernel.org, Kirti Wankhede <kwankhede@nvidia.com>,
linux-doc@vger.kernel.org, "Raj, Ashok" <ashok.raj@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Leon Romanovsky <leonro@nvidia.com>,
Max Gurtovoy <mgurtovoy@nvidia.com>,
Tarun Gupta <targupta@nvidia.com>
Subject: Re: [PATCH 03/18] vfio/mdev: Simplify driver registration
Date: Fri, 26 Mar 2021 13:55:08 +0100 [thread overview]
Message-ID: <20210326125508.GA18011@lst.de> (raw)
In-Reply-To: <20210326121048.GN2356281@nvidia.com>
On Fri, Mar 26, 2021 at 09:10:48AM -0300, Jason Gunthorpe wrote:
> It is usually hidden and works like this:
>
> /* pci_register_driver() must be a macro so KBUILD_MODNAME can be expanded */
> #define pci_register_driver(driver) \
> __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
>
> int __pci_register_driver(struct pci_driver *drv, struct module *owner,
> const char *mod_name)
> {
> drv->driver.owner = owner;
> drv->driver.mod_name = mod_name;
Indeed, there seem to be about two handful of instance of that.
> > I've not really seen that in anywere else, and the only user seems
> > to be module_add_driver for a rather odd case we shouldn't hit here.
>
> vfio_mdev could be compiled built in?
>
> AFAICT it handles the case where THIS_MODULE==NULL so we still need to
> create sysfs links to the built in module.
>
> If it is left NULL then a few sysfs files go missing for the built in
> mode but no harm done?
Yes, it seems to be needed for a few driver-specific files. So it looks
ok, even if rather unexpected.
next prev parent reply other threads:[~2021-03-26 12:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-23 17:55 [PATCH 00/18] Make vfio_mdev type safe Jason Gunthorpe
2021-03-23 17:55 ` [PATCH 02/18] vfio/mdev: Add missing typesafety around mdev_device Jason Gunthorpe
2021-03-26 2:04 ` Tian, Kevin
2021-03-30 15:24 ` Cornelia Huck
2021-03-23 17:55 ` [PATCH 03/18] vfio/mdev: Simplify driver registration Jason Gunthorpe
2021-03-23 19:14 ` Christoph Hellwig
2021-03-26 12:10 ` Jason Gunthorpe
2021-03-26 12:55 ` Christoph Hellwig [this message]
2021-03-26 2:17 ` Tian, Kevin
2021-03-30 15:28 ` Cornelia Huck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210326125508.GA18011@lst.de \
--to=hch@lst.de \
--cc=alex.williamson@redhat.com \
--cc=ashok.raj@intel.com \
--cc=cohuck@redhat.com \
--cc=corbet@lwn.net \
--cc=dan.j.williams@intel.com \
--cc=jgg@nvidia.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=leonro@nvidia.com \
--cc=linux-doc@vger.kernel.org \
--cc=mgurtovoy@nvidia.com \
--cc=targupta@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).