* [PATCH 1/1 linux-next] ieee802154: add __init to lowpan_frags_sysctl_register @ 2014-09-30 20:34 Fabian Frederick 2014-09-30 21:08 ` David Miller 2014-10-01 0:25 ` Alexander Aring 0 siblings, 2 replies; 5+ messages in thread From: Fabian Frederick @ 2014-09-30 20:34 UTC (permalink / raw) To: linux-kernel Cc: Fabian Frederick, Alexander Aring, David S. Miller, linux-wpan, netdev lowpan_frags_sysctl_register is only called by __init lowpan_net_frag_init (part of the lowpan module). Signed-off-by: Fabian Frederick <fabf@skynet.be> --- This is untested. net/ieee802154/reassembly.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c index 32755cb..30ec608 100644 --- a/net/ieee802154/reassembly.c +++ b/net/ieee802154/reassembly.c @@ -485,7 +485,7 @@ static void __net_exit lowpan_frags_ns_sysctl_unregister(struct net *net) static struct ctl_table_header *lowpan_ctl_header; -static int lowpan_frags_sysctl_register(void) +static int __init lowpan_frags_sysctl_register(void) { lowpan_ctl_header = register_net_sysctl(&init_net, "net/ieee802154/6lowpan", @@ -498,7 +498,7 @@ static void lowpan_frags_sysctl_unregister(void) unregister_net_sysctl_table(lowpan_ctl_header); } #else -static inline int lowpan_frags_ns_sysctl_register(struct net *net) +static inline int __init lowpan_frags_ns_sysctl_register(struct net *net) { return 0; } -- 1.9.3 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1 linux-next] ieee802154: add __init to lowpan_frags_sysctl_register 2014-09-30 20:34 [PATCH 1/1 linux-next] ieee802154: add __init to lowpan_frags_sysctl_register Fabian Frederick @ 2014-09-30 21:08 ` David Miller 2014-10-01 0:25 ` Alexander Aring 1 sibling, 0 replies; 5+ messages in thread From: David Miller @ 2014-09-30 21:08 UTC (permalink / raw) To: fabf; +Cc: linux-kernel, alex.aring, linux-wpan, netdev From: Fabian Frederick <fabf@skynet.be> Date: Tue, 30 Sep 2014 22:34:08 +0200 > lowpan_frags_sysctl_register is only called by __init lowpan_net_frag_init > (part of the lowpan module). > > Signed-off-by: Fabian Frederick <fabf@skynet.be> Applied. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1 linux-next] ieee802154: add __init to lowpan_frags_sysctl_register 2014-09-30 20:34 [PATCH 1/1 linux-next] ieee802154: add __init to lowpan_frags_sysctl_register Fabian Frederick 2014-09-30 21:08 ` David Miller @ 2014-10-01 0:25 ` Alexander Aring 2014-10-01 4:36 ` Fabian Frederick 1 sibling, 1 reply; 5+ messages in thread From: Alexander Aring @ 2014-10-01 0:25 UTC (permalink / raw) To: Fabian Frederick; +Cc: linux-kernel, David S. Miller, linux-wpan, netdev Hi, On Tue, Sep 30, 2014 at 10:34:08PM +0200, Fabian Frederick wrote: > lowpan_frags_sysctl_register is only called by __init lowpan_net_frag_init > (part of the lowpan module). > > Signed-off-by: Fabian Frederick <fabf@skynet.be> > --- > This is untested. > > net/ieee802154/reassembly.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c > index 32755cb..30ec608 100644 > --- a/net/ieee802154/reassembly.c > +++ b/net/ieee802154/reassembly.c > @@ -485,7 +485,7 @@ static void __net_exit lowpan_frags_ns_sysctl_unregister(struct net *net) > > static struct ctl_table_header *lowpan_ctl_header; > > -static int lowpan_frags_sysctl_register(void) > +static int __init lowpan_frags_sysctl_register(void) yes right, but there is more lacks of missing "__init". See below. > { > lowpan_ctl_header = register_net_sysctl(&init_net, > "net/ieee802154/6lowpan", > @@ -498,7 +498,7 @@ static void lowpan_frags_sysctl_unregister(void) > unregister_net_sysctl_table(lowpan_ctl_header); > } > #else > -static inline int lowpan_frags_ns_sysctl_register(struct net *net) > +static inline int __init lowpan_frags_ns_sysctl_register(struct net *net) This is wrong, it's callback from "struct pernet_operations lowpan_frags_ops". > { > return 0; > } Your patch adds "__init" now for two different functions and we have two different declarations for these functions, depends if CONFIG_SYSCTL is enabled. Now if CONFIG_SYSCTL select we have as lowpan_frags_sysctl_register declaration: static int __init lowpan_frags_sysctl_register(void) if not: static inline int lowpan_frags_sysctl_register(void) Same for lowpan_frags_ns_sysctl_register and vice versa for CONFIG_SYSCTL. Your changes are for two different functions (Don't know if you realized that): "lowpan_frags_sysctl_register" and "lowpan_frags_ns_sysctl_register", which makes no sense. Also lowpan_frags_ns_sysctl_register isn't called by module init which is wrong. To make "correct" cleanup for this "__init" should be add to the functions, for both declarations if CONFIG_SYSCTL is set or not: - lowpan_net_frag_init - lowpan_frags_sysctl_register I see now it's already applied, David please revert this change. Are you fine to apply a correct version of this to wpan-next tree, next time? - Alex ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1 linux-next] ieee802154: add __init to lowpan_frags_sysctl_register 2014-10-01 0:25 ` Alexander Aring @ 2014-10-01 4:36 ` Fabian Frederick 2014-10-01 4:41 ` David Miller 0 siblings, 1 reply; 5+ messages in thread From: Fabian Frederick @ 2014-10-01 4:36 UTC (permalink / raw) To: Alexander Aring; +Cc: netdev, linux-kernel, linux-wpan, David S. Miller > On 01 October 2014 at 02:25 Alexander Aring <alex.aring@gmail.com> wrote: > > > Hi, > > On Tue, Sep 30, 2014 at 10:34:08PM +0200, Fabian Frederick wrote: > > lowpan_frags_sysctl_register is only called by __init lowpan_net_frag_init > > (part of the lowpan module). > > > > Signed-off-by: Fabian Frederick <fabf@skynet.be> > > --- > > This is untested. > > > > net/ieee802154/reassembly.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c > > index 32755cb..30ec608 100644 > > --- a/net/ieee802154/reassembly.c > > +++ b/net/ieee802154/reassembly.c > > @@ -485,7 +485,7 @@ static void __net_exit > > lowpan_frags_ns_sysctl_unregister(struct net *net) > > > > static struct ctl_table_header *lowpan_ctl_header; > > > > -static int lowpan_frags_sysctl_register(void) > > +static int __init lowpan_frags_sysctl_register(void) > > yes right, but there is more lacks of missing "__init". See below. > > > { > > lowpan_ctl_header = register_net_sysctl(&init_net, > > "net/ieee802154/6lowpan", > > @@ -498,7 +498,7 @@ static void lowpan_frags_sysctl_unregister(void) > > unregister_net_sysctl_table(lowpan_ctl_header); > > } > > #else > > -static inline int lowpan_frags_ns_sysctl_register(struct net *net) > > +static inline int __init lowpan_frags_ns_sysctl_register(struct net *net) > > This is wrong, it's callback from "struct pernet_operations lowpan_frags_ops". > > > { > > return 0; > > } > > > Your patch adds "__init" now for two different functions and we have > two different declarations for these functions, depends if CONFIG_SYSCTL is > enabled. > > Now if CONFIG_SYSCTL select we have as lowpan_frags_sysctl_register > declaration: > > static int __init lowpan_frags_sysctl_register(void) > > if not: > > static inline int lowpan_frags_sysctl_register(void) > > Same for lowpan_frags_ns_sysctl_register and vice versa for CONFIG_SYSCTL. > > Your changes are for two different functions (Don't know if you realized > that): Hi Alexander, I didn't see _ns_ . I'll send the right fix based on wpan-next. Thanks, Fabian > > "lowpan_frags_sysctl_register" and "lowpan_frags_ns_sysctl_register", > which makes no sense. Also lowpan_frags_ns_sysctl_register isn't called > by module init which is wrong. > > > To make "correct" cleanup for this "__init" should be add to the functions, > for > both declarations if CONFIG_SYSCTL is set or not: > > - lowpan_net_frag_init > - lowpan_frags_sysctl_register > > > I see now it's already applied, David please revert this change. Are you > fine to apply a correct version of this to wpan-next tree, next time? > > - Alex ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1 linux-next] ieee802154: add __init to lowpan_frags_sysctl_register 2014-10-01 4:36 ` Fabian Frederick @ 2014-10-01 4:41 ` David Miller 0 siblings, 0 replies; 5+ messages in thread From: David Miller @ 2014-10-01 4:41 UTC (permalink / raw) To: fabf; +Cc: alex.aring, netdev, linux-kernel, linux-wpan From: Fabian Frederick <fabf@skynet.be> Date: Wed, 1 Oct 2014 06:36:49 +0200 (CEST) > I didn't see _ns_ . I'll send the right fix based on wpan-next. You'll have to send it to me, because I applied your patch already to net-next. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-10-01 4:41 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-09-30 20:34 [PATCH 1/1 linux-next] ieee802154: add __init to lowpan_frags_sysctl_register Fabian Frederick 2014-09-30 21:08 ` David Miller 2014-10-01 0:25 ` Alexander Aring 2014-10-01 4:36 ` Fabian Frederick 2014-10-01 4:41 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox