netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] tun: add __exit annotations to module exit func tun_cleanup()
@ 2023-08-14  8:30 Ziyang Xuan
  2023-08-14 10:17 ` Leon Romanovsky
  2023-08-18  2:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 7+ messages in thread
From: Ziyang Xuan @ 2023-08-14  8:30 UTC (permalink / raw)
  To: willemdebruijn.kernel, jasowang, davem, edumazet, kuba, pabeni,
	netdev

Add missing __exit annotations to module exit func tun_cleanup().

Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
---
 drivers/net/tun.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 973b2fc74de3..291c118579a9 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -3740,7 +3740,7 @@ static int __init tun_init(void)
 	return ret;
 }
 
-static void tun_cleanup(void)
+static void __exit tun_cleanup(void)
 {
 	misc_deregister(&tun_miscdev);
 	rtnl_link_unregister(&tun_link_ops);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next] tun: add __exit annotations to module exit func tun_cleanup()
  2023-08-14  8:30 [PATCH net-next] tun: add __exit annotations to module exit func tun_cleanup() Ziyang Xuan
@ 2023-08-14 10:17 ` Leon Romanovsky
  2023-08-14 11:27   ` Ziyang Xuan (William)
  2023-08-18  2:20 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 7+ messages in thread
From: Leon Romanovsky @ 2023-08-14 10:17 UTC (permalink / raw)
  To: Ziyang Xuan
  Cc: willemdebruijn.kernel, jasowang, davem, edumazet, kuba, pabeni,
	netdev

On Mon, Aug 14, 2023 at 04:30:00PM +0800, Ziyang Xuan wrote:
> Add missing __exit annotations to module exit func tun_cleanup().
> 
> Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
> ---
>  drivers/net/tun.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 973b2fc74de3..291c118579a9 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -3740,7 +3740,7 @@ static int __init tun_init(void)
>  	return ret;
>  }
>  
> -static void tun_cleanup(void)
> +static void __exit tun_cleanup(void)

Why __exit and not __net_exit?

Thanks

>  {
>  	misc_deregister(&tun_miscdev);
>  	rtnl_link_unregister(&tun_link_ops);
> -- 
> 2.25.1
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next] tun: add __exit annotations to module exit func tun_cleanup()
  2023-08-14 10:17 ` Leon Romanovsky
@ 2023-08-14 11:27   ` Ziyang Xuan (William)
  2023-08-14 12:05     ` Leon Romanovsky
  0 siblings, 1 reply; 7+ messages in thread
From: Ziyang Xuan (William) @ 2023-08-14 11:27 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: willemdebruijn.kernel, jasowang, davem, edumazet, kuba, pabeni,
	netdev

> On Mon, Aug 14, 2023 at 04:30:00PM +0800, Ziyang Xuan wrote:
>> Add missing __exit annotations to module exit func tun_cleanup().
>>
>> Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
>> ---
>>  drivers/net/tun.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
>> index 973b2fc74de3..291c118579a9 100644
>> --- a/drivers/net/tun.c
>> +++ b/drivers/net/tun.c
>> @@ -3740,7 +3740,7 @@ static int __init tun_init(void)
>>  	return ret;
>>  }
>>  
>> -static void tun_cleanup(void)
>> +static void __exit tun_cleanup(void)
> 
> Why __exit and not __net_exit?

tun_cleanup() is a module exit function. it corresponds to tun_init().
tun_init() uses __init, so tun_cleanup() uses __exit.

Thank you!
William Xuan
> 
> Thanks
> 
>>  {
>>  	misc_deregister(&tun_miscdev);
>>  	rtnl_link_unregister(&tun_link_ops);
>> -- 
>> 2.25.1
>>
>>
> .
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next] tun: add __exit annotations to module exit func tun_cleanup()
  2023-08-14 11:27   ` Ziyang Xuan (William)
@ 2023-08-14 12:05     ` Leon Romanovsky
  2023-08-14 12:23       ` Ziyang Xuan (William)
  0 siblings, 1 reply; 7+ messages in thread
From: Leon Romanovsky @ 2023-08-14 12:05 UTC (permalink / raw)
  To: Ziyang Xuan (William)
  Cc: willemdebruijn.kernel, jasowang, davem, edumazet, kuba, pabeni,
	netdev

On Mon, Aug 14, 2023 at 07:27:59PM +0800, Ziyang Xuan (William) wrote:
> > On Mon, Aug 14, 2023 at 04:30:00PM +0800, Ziyang Xuan wrote:
> >> Add missing __exit annotations to module exit func tun_cleanup().
> >>
> >> Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
> >> ---
> >>  drivers/net/tun.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> >> index 973b2fc74de3..291c118579a9 100644
> >> --- a/drivers/net/tun.c
> >> +++ b/drivers/net/tun.c
> >> @@ -3740,7 +3740,7 @@ static int __init tun_init(void)
> >>  	return ret;
> >>  }
> >>  
> >> -static void tun_cleanup(void)
> >> +static void __exit tun_cleanup(void)
> > 
> > Why __exit and not __net_exit?
> 
> tun_cleanup() is a module exit function. it corresponds to tun_init().
> tun_init() uses __init, so tun_cleanup() uses __exit.

__net_init is equal to __init.

> 
> Thank you!
> William Xuan
> > 
> > Thanks
> > 
> >>  {
> >>  	misc_deregister(&tun_miscdev);
> >>  	rtnl_link_unregister(&tun_link_ops);
> >> -- 
> >> 2.25.1
> >>
> >>
> > .
> > 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next] tun: add __exit annotations to module exit func tun_cleanup()
  2023-08-14 12:05     ` Leon Romanovsky
@ 2023-08-14 12:23       ` Ziyang Xuan (William)
  2023-08-14 12:32         ` Leon Romanovsky
  0 siblings, 1 reply; 7+ messages in thread
From: Ziyang Xuan (William) @ 2023-08-14 12:23 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: willemdebruijn.kernel, jasowang, davem, edumazet, kuba, pabeni,
	netdev

> On Mon, Aug 14, 2023 at 07:27:59PM +0800, Ziyang Xuan (William) wrote:
>>> On Mon, Aug 14, 2023 at 04:30:00PM +0800, Ziyang Xuan wrote:
>>>> Add missing __exit annotations to module exit func tun_cleanup().
>>>>
>>>> Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
>>>> ---
>>>>  drivers/net/tun.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
>>>> index 973b2fc74de3..291c118579a9 100644
>>>> --- a/drivers/net/tun.c
>>>> +++ b/drivers/net/tun.c
>>>> @@ -3740,7 +3740,7 @@ static int __init tun_init(void)
>>>>  	return ret;
>>>>  }
>>>>  
>>>> -static void tun_cleanup(void)
>>>> +static void __exit tun_cleanup(void)
>>>
>>> Why __exit and not __net_exit?
>>
>> tun_cleanup() is a module exit function. it corresponds to tun_init().
>> tun_init() uses __init, so tun_cleanup() uses __exit.
> 
> __net_init is equal to __init.

That is not. They are equal when CONFIG_NET_NS is not enabled.
Refer to the definition of __net_init and __net_eixt in include/net/net_namespace.h.

> 
>>
>> Thank you!
>> William Xuan
>>>
>>> Thanks
>>>
>>>>  {
>>>>  	misc_deregister(&tun_miscdev);
>>>>  	rtnl_link_unregister(&tun_link_ops);
>>>> -- 
>>>> 2.25.1
>>>>
>>>>
>>> .
>>>
> .
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next] tun: add __exit annotations to module exit func tun_cleanup()
  2023-08-14 12:23       ` Ziyang Xuan (William)
@ 2023-08-14 12:32         ` Leon Romanovsky
  0 siblings, 0 replies; 7+ messages in thread
From: Leon Romanovsky @ 2023-08-14 12:32 UTC (permalink / raw)
  To: Ziyang Xuan (William)
  Cc: willemdebruijn.kernel, jasowang, davem, edumazet, kuba, pabeni,
	netdev

On Mon, Aug 14, 2023 at 08:23:37PM +0800, Ziyang Xuan (William) wrote:
> > On Mon, Aug 14, 2023 at 07:27:59PM +0800, Ziyang Xuan (William) wrote:
> >>> On Mon, Aug 14, 2023 at 04:30:00PM +0800, Ziyang Xuan wrote:
> >>>> Add missing __exit annotations to module exit func tun_cleanup().
> >>>>
> >>>> Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
> >>>> ---
> >>>>  drivers/net/tun.c | 2 +-
> >>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> >>>> index 973b2fc74de3..291c118579a9 100644
> >>>> --- a/drivers/net/tun.c
> >>>> +++ b/drivers/net/tun.c
> >>>> @@ -3740,7 +3740,7 @@ static int __init tun_init(void)
> >>>>  	return ret;
> >>>>  }
> >>>>  
> >>>> -static void tun_cleanup(void)
> >>>> +static void __exit tun_cleanup(void)
> >>>
> >>> Why __exit and not __net_exit?
> >>
> >> tun_cleanup() is a module exit function. it corresponds to tun_init().
> >> tun_init() uses __init, so tun_cleanup() uses __exit.
> > 
> > __net_init is equal to __init.
> 
> That is not. They are equal when CONFIG_NET_NS is not enabled.
> Refer to the definition of __net_init and __net_eixt in include/net/net_namespace.h.

Right, thanks
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next] tun: add __exit annotations to module exit func tun_cleanup()
  2023-08-14  8:30 [PATCH net-next] tun: add __exit annotations to module exit func tun_cleanup() Ziyang Xuan
  2023-08-14 10:17 ` Leon Romanovsky
@ 2023-08-18  2:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-18  2:20 UTC (permalink / raw)
  To: Ziyang Xuan
  Cc: willemdebruijn.kernel, jasowang, davem, edumazet, kuba, pabeni,
	netdev

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 14 Aug 2023 16:30:00 +0800 you wrote:
> Add missing __exit annotations to module exit func tun_cleanup().
> 
> Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
> ---
>  drivers/net/tun.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net-next] tun: add __exit annotations to module exit func tun_cleanup()
    https://git.kernel.org/netdev/net-next/c/b2f8323364ab

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-18  2:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-14  8:30 [PATCH net-next] tun: add __exit annotations to module exit func tun_cleanup() Ziyang Xuan
2023-08-14 10:17 ` Leon Romanovsky
2023-08-14 11:27   ` Ziyang Xuan (William)
2023-08-14 12:05     ` Leon Romanovsky
2023-08-14 12:23       ` Ziyang Xuan (William)
2023-08-14 12:32         ` Leon Romanovsky
2023-08-18  2:20 ` patchwork-bot+netdevbpf

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).