Re: [PATCH v2 11/15] sgi-xp: Remove the now superfluous sentinel element from ctl_table array

2023-10-02 Thread Steve Wahl
On Mon, Oct 02, 2023 at 10:55:28AM +0200, Joel Granados via B4 Relay wrote:
> From: Joel Granados 
> 
> This commit comes at the tail end of a greater effort to remove the
> empty elements at the end of the ctl_table arrays (sentinels) which
> will reduce the overall build time size of the kernel and run time
> memory bloat by ~64 bytes per sentinel (further information Link :
> https://lore.kernel.org/all/zo5yx5jfoggi%2f...@bombadil.infradead.org/)
> 
> Remove sentinel from xpc_sys_xpc_hb and xpc_sys_xpc
> 
> Signed-off-by: Joel Granados 
> ---
>  drivers/misc/sgi-xp/xpc_main.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c
> index 6da509d692bb..3186421e82c3 100644
> --- a/drivers/misc/sgi-xp/xpc_main.c
> +++ b/drivers/misc/sgi-xp/xpc_main.c
> @@ -110,7 +110,6 @@ static struct ctl_table xpc_sys_xpc_hb[] = {
>.proc_handler = proc_dointvec_minmax,
>.extra1 = &xpc_hb_check_min_interval,
>.extra2 = &xpc_hb_check_max_interval},
> - {}
>  };
>  static struct ctl_table xpc_sys_xpc[] = {
>   {
> @@ -121,7 +120,6 @@ static struct ctl_table xpc_sys_xpc[] = {
>.proc_handler = proc_dointvec_minmax,
>.extra1 = &xpc_disengage_min_timelimit,
>.extra2 = &xpc_disengage_max_timelimit},
> - {}
>  };
>  
>  static struct ctl_table_header *xpc_sysctl;
> 
> -- 
> 2.30.2
> 

Reviewed-by: Steve Wahl 

-- 
Steve Wahl, Hewlett Packard Enterprise



Re: [PATCH 11/15] sgi-xp: Remove the now superfluous sentinel element from ctl_table array

2023-09-28 Thread Steve Wahl
On Thu, Sep 28, 2023 at 03:21:36PM +0200, Joel Granados via B4 Relay wrote:
> From: Joel Granados 
> 
> This commit comes at the tail end of a greater effort to remove the
> empty elements at the end of the ctl_table arrays (sentinels) which
> will reduce the overall build time size of the kernel and run time
> memory bloat by ~64 bytes per sentinel (further information Link :
> https://lore.kernel.org/all/zo5yx5jfoggi%2f...@bombadil.infradead.org/)
> 
> Remove sentinel from xpc_sys_xpc_hb and xpc_sys_xpc
> 
> Signed-off-by: Joel Granados 
> ---
>  drivers/misc/sgi-xp/xpc_main.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c
> index 6da509d692bb..c898092ff3ac 100644
> --- a/drivers/misc/sgi-xp/xpc_main.c
> +++ b/drivers/misc/sgi-xp/xpc_main.c
> @@ -109,8 +109,7 @@ static struct ctl_table xpc_sys_xpc_hb[] = {
>.mode = 0644,
>.proc_handler = proc_dointvec_minmax,
>.extra1 = &xpc_hb_check_min_interval,
> -  .extra2 = &xpc_hb_check_max_interval},
> - {}
> +  .extra2 = &xpc_hb_check_max_interval}
>  };
>  static struct ctl_table xpc_sys_xpc[] = {
>   {
> @@ -120,8 +119,7 @@ static struct ctl_table xpc_sys_xpc[] = {
>.mode = 0644,
>.proc_handler = proc_dointvec_minmax,
>.extra1 = &xpc_disengage_min_timelimit,
> -  .extra2 = &xpc_disengage_max_timelimit},
> - {}
> +  .extra2 = &xpc_disengage_max_timelimit}
>  };
>  
>  static struct ctl_table_header *xpc_sysctl;
> 
> -- 
> 2.30.2
> 

I assume you'll match the rest of the changes with regards to the
trailing comma.

Reviewed-by: Steve Wahl 

-- 
Steve Wahl, Hewlett Packard Enterprise



Re: [PATCH 5/7] sgi-xp: simplify sysctl registration

2023-03-07 Thread Steve Wahl
On Thu, Mar 02, 2023 at 12:46:10PM -0800, Luis Chamberlain wrote:
> Although this driver is a good use case for having a directory
> that is not other directories and then subdirectories with more
> entries, the usage of register_sysctl_table() can recurse and
> increases complexity so to avoid that just split out the
> registration to each directory with its own entries.
> 
> register_sysctl_table() is a deprecated compatibility wrapper.
> register_sysctl() can do the directory creation for you so just use
> that.
> 
> Signed-off-by: Luis Chamberlain 

Reviewed-by: Steve Wahl 

> ---
>  drivers/misc/sgi-xp/xpc_main.c | 24 ++--
>  1 file changed, 10 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c
> index b2c3c22fc13c..6da509d692bb 100644
> --- a/drivers/misc/sgi-xp/xpc_main.c
> +++ b/drivers/misc/sgi-xp/xpc_main.c
> @@ -93,7 +93,7 @@ int xpc_disengage_timelimit = 
> XPC_DISENGAGE_DEFAULT_TIMELIMIT;
>  static int xpc_disengage_min_timelimit;  /* = 0 */
>  static int xpc_disengage_max_timelimit = 120;
>  
> -static struct ctl_table xpc_sys_xpc_hb_dir[] = {
> +static struct ctl_table xpc_sys_xpc_hb[] = {
>   {
>.procname = "hb_interval",
>.data = &xpc_hb_interval,
> @@ -112,11 +112,7 @@ static struct ctl_table xpc_sys_xpc_hb_dir[] = {
>.extra2 = &xpc_hb_check_max_interval},
>   {}
>  };
> -static struct ctl_table xpc_sys_xpc_dir[] = {
> - {
> -  .procname = "hb",
> -  .mode = 0555,
> -  .child = xpc_sys_xpc_hb_dir},
> +static struct ctl_table xpc_sys_xpc[] = {
>   {
>.procname = "disengage_timelimit",
>.data = &xpc_disengage_timelimit,
> @@ -127,14 +123,9 @@ static struct ctl_table xpc_sys_xpc_dir[] = {
>.extra2 = &xpc_disengage_max_timelimit},
>   {}
>  };
> -static struct ctl_table xpc_sys_dir[] = {
> - {
> -  .procname = "xpc",
> -  .mode = 0555,
> -  .child = xpc_sys_xpc_dir},
> - {}
> -};
> +
>  static struct ctl_table_header *xpc_sysctl;
> +static struct ctl_table_header *xpc_sysctl_hb;
>  
>  /* non-zero if any remote partition disengage was timed out */
>  int xpc_disengage_timedout;
> @@ -1041,6 +1032,8 @@ xpc_do_exit(enum xp_retval reason)
>  
>   if (xpc_sysctl)
>   unregister_sysctl_table(xpc_sysctl);
> + if (xpc_sysctl_hb)
> + unregister_sysctl_table(xpc_sysctl_hb);
>  
>   xpc_teardown_partitions();
>  
> @@ -1243,7 +1236,8 @@ xpc_init(void)
>   goto out_1;
>   }
>  
> - xpc_sysctl = register_sysctl_table(xpc_sys_dir);
> + xpc_sysctl = register_sysctl("xpc", xpc_sys_xpc);
> + xpc_sysctl_hb = register_sysctl("xpc/hb", xpc_sys_xpc_hb);
>  
>   /*
>* Fill the partition reserved page with the information needed by
> @@ -1308,6 +1302,8 @@ xpc_init(void)
>   (void)unregister_die_notifier(&xpc_die_notifier);
>   (void)unregister_reboot_notifier(&xpc_reboot_notifier);
>  out_2:
> + if (xpc_sysctl_hb)
> + unregister_sysctl_table(xpc_sysctl_hb);
>   if (xpc_sysctl)
>   unregister_sysctl_table(xpc_sysctl);
>  
> -- 
> 2.39.1
> 

-- 
Steve Wahl, Hewlett Packard Enterprise