All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: "Ziyang Xuan (William)" <william.xuanziyang@huawei.com>
Cc: willemdebruijn.kernel@gmail.com, jasowang@redhat.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] tun: add __exit annotations to module exit func tun_cleanup()
Date: Mon, 14 Aug 2023 15:32:32 +0300	[thread overview]
Message-ID: <20230814123232.GI3921@unreal> (raw)
In-Reply-To: <b0cbdac5-9518-225f-a607-90431f36fa2d@huawei.com>

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>

  reply	other threads:[~2023-08-14 12:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2023-08-18  2:20 ` patchwork-bot+netdevbpf

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=20230814123232.GI3921@unreal \
    --to=leon@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jasowang@redhat.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=william.xuanziyang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.