public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	corbet@lwn.net, linux-doc@vger.kernel.org
Subject: Re: [PATCH] usb: usb-skeleton: Add hint to find __init and __exit
Date: Sat, 23 Oct 2021 10:50:06 +0200	[thread overview]
Message-ID: <YXPMvi+A8h0ybR0t@kroah.com> (raw)
In-Reply-To: <7ae5d5c1-4121-65b1-8a91-95513b945823@gmail.com>

On Sat, Oct 23, 2021 at 09:11:37AM +0200, Philipp Hortmann wrote:
> On 10/23/21 8:47 AM, Greg KH wrote:
> > On Sat, Oct 23, 2021 at 07:25:38AM +0200, Philipp Hortmann wrote:
> > > Comment to find __init and __exit.
> > > 
> > > Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
> > > ---
> > >   drivers/usb/usb-skeleton.c | 1 +
> > >   1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
> > > index 2dc58766273a..80338a50dcde 100644
> > > --- a/drivers/usb/usb-skeleton.c
> > > +++ b/drivers/usb/usb-skeleton.c
> > > @@ -641,6 +641,7 @@ static struct usb_driver skel_driver = {
> > >   	.supports_autosuspend = 1,
> > >   };
> > > +/* __init and __exit */
> > >   module_usb_driver(skel_driver);
> > 
> > This comment makes no sense, sorry.  __init and __exit are things that
> > the linker uses, why would you need to "find" them?
> > 
> > thanks,
> > 
> > greg k-h
> > 
> 
> When I want to add something to the __init function (debug comment for
> example), how to do this without knowing that it is in module_usb_driver?

The whole point of the module_usb_driver() macro is to keep a developer
from having to write that init_module() and exit_module() functions
entirely.  I think you are getting confused with the __init and __exit
linker hints with the module init/exit functions.  They are totally
different things.

thanks,

greg k-h

      reply	other threads:[~2021-10-23  8:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-23  5:25 [PATCH] usb: usb-skeleton: Add hint to find __init and __exit Philipp Hortmann
2021-10-23  6:47 ` Greg KH
2021-10-23  7:11   ` Philipp Hortmann
2021-10-23  8:50     ` Greg KH [this message]

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=YXPMvi+A8h0ybR0t@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=philipp.g.hortmann@gmail.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