* [PATCH] usb: usb-skeleton: Add hint to find __init and __exit
@ 2021-10-23 5:25 Philipp Hortmann
2021-10-23 6:47 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Philipp Hortmann @ 2021-10-23 5:25 UTC (permalink / raw)
To: gregkh, linux-usb, linux-kernel; +Cc: corbet, linux-doc
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);
MODULE_LICENSE("GPL v2");
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: usb-skeleton: Add hint to find __init and __exit
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
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2021-10-23 6:47 UTC (permalink / raw)
To: Philipp Hortmann; +Cc: linux-usb, linux-kernel, corbet, linux-doc
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: usb-skeleton: Add hint to find __init and __exit
2021-10-23 6:47 ` Greg KH
@ 2021-10-23 7:11 ` Philipp Hortmann
2021-10-23 8:50 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Philipp Hortmann @ 2021-10-23 7:11 UTC (permalink / raw)
To: Greg KH; +Cc: linux-usb, linux-kernel, corbet, linux-doc
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?
thanks,
Philipp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: usb-skeleton: Add hint to find __init and __exit
2021-10-23 7:11 ` Philipp Hortmann
@ 2021-10-23 8:50 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2021-10-23 8:50 UTC (permalink / raw)
To: Philipp Hortmann; +Cc: linux-usb, linux-kernel, corbet, linux-doc
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-10-23 8:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).