Re: [PATCH net-next] net: sysctl: cleanup net_sysctl_init()

2021-01-07 Thread Jakub Kicinski
On Thu, 07 Jan 2021 09:13:40 + Alexander Lobakin wrote: > From: Jakub Kicinski > Date: Wed, 6 Jan 2021 16:30:56 -0800 > > > On Wed, 06 Jan 2021 20:40:28 + Alexander Lobakin wrote: > >> 'net_header' is not used outside of this function, so can be moved > >> from BSS onto the stack. > >>

Re: [PATCH net-next] net: sysctl: cleanup net_sysctl_init()

2021-01-07 Thread Alexander Lobakin
From: Jakub Kicinski Date: Wed, 6 Jan 2021 16:30:56 -0800 > On Wed, 06 Jan 2021 20:40:28 + Alexander Lobakin wrote: >> 'net_header' is not used outside of this function, so can be moved >> from BSS onto the stack. >> Declarations of one-element arrays are discouraged, and there's no >> need t

Re: [PATCH net-next] net: sysctl: cleanup net_sysctl_init()

2021-01-06 Thread Jakub Kicinski
On Wed, 06 Jan 2021 20:40:28 + Alexander Lobakin wrote: > 'net_header' is not used outside of this function, so can be moved > from BSS onto the stack. > Declarations of one-element arrays are discouraged, and there's no > need to store 'empty' in BSS. Simply allocate it from heap at init. Are

[PATCH net-next] net: sysctl: cleanup net_sysctl_init()

2021-01-06 Thread Alexander Lobakin
'net_header' is not used outside of this function, so can be moved from BSS onto the stack. Declarations of one-element arrays are discouraged, and there's no need to store 'empty' in BSS. Simply allocate it from heap at init. Signed-off-by: Alexander Lobakin --- net/sysctl_net.c | 27 ++