diff mbox series

[3/7] hv: simplify sysctl registration

Message ID 20230302204612.782387-4-mcgrof@kernel.org (mailing list archive)
State Not Applicable
Headers show
Series sysctl: slowly deprecate register_sysctl_table() | expand

Commit Message

Luis Chamberlain March 2, 2023, 8:46 p.m. UTC
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 <mcgrof@kernel.org>
---
 drivers/hv/vmbus_drv.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

Michael Kelley (LINUX) March 3, 2023, 12:59 a.m. UTC | #1
From: Luis Chamberlain <mcgrof@infradead.org> On Behalf Of Luis Chamberlain Sent: Thursday, March 2, 2023 12:46 PM
>
> 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 <mcgrof@kernel.org>
> ---
>  drivers/hv/vmbus_drv.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index d24dd65b33d4..229353f1e9c2 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -1460,15 +1460,6 @@ static struct ctl_table hv_ctl_table[] = {
>  	{}
>  };
> 
> -static struct ctl_table hv_root_table[] = {
> -	{
> -		.procname	= "kernel",
> -		.mode		= 0555,
> -		.child		= hv_ctl_table
> -	},
> -	{}
> -};
> -
>  /*
>   * vmbus_bus_init -Main vmbus driver initialization routine.
>   *
> @@ -1547,7 +1538,7 @@ static int vmbus_bus_init(void)
>  		 * message recording won't be available in isolated
>  		 * guests should the following registration fail.
>  		 */
> -		hv_ctl_table_hdr = register_sysctl_table(hv_root_table);
> +		hv_ctl_table_hdr = register_sysctl("kernel", hv_ctl_table);
>  		if (!hv_ctl_table_hdr)
>  			pr_err("Hyper-V: sysctl table register error");
> 
> --
> 2.39.1

Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Wei Liu March 6, 2023, 3:27 p.m. UTC | #2
On Thu, Mar 02, 2023 at 12:46:08PM -0800, Luis Chamberlain wrote:
> 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 <mcgrof@kernel.org>

Reviewed-by: Wei Liu <wei.liu@kernel.org>
diff mbox series

Patch

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index d24dd65b33d4..229353f1e9c2 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1460,15 +1460,6 @@  static struct ctl_table hv_ctl_table[] = {
 	{}
 };
 
-static struct ctl_table hv_root_table[] = {
-	{
-		.procname	= "kernel",
-		.mode		= 0555,
-		.child		= hv_ctl_table
-	},
-	{}
-};
-
 /*
  * vmbus_bus_init -Main vmbus driver initialization routine.
  *
@@ -1547,7 +1538,7 @@  static int vmbus_bus_init(void)
 		 * message recording won't be available in isolated
 		 * guests should the following registration fail.
 		 */
-		hv_ctl_table_hdr = register_sysctl_table(hv_root_table);
+		hv_ctl_table_hdr = register_sysctl("kernel", hv_ctl_table);
 		if (!hv_ctl_table_hdr)
 			pr_err("Hyper-V: sysctl table register error");