diff mbox series

[09/11] fs-verity: simplify sysctls with register_sysctl()

Message ID 20230302202826.776286-10-mcgrof@kernel.org (mailing list archive)
State New, archived
Headers show
Series sysctl: deprecate register_sysctl_paths() | expand

Commit Message

Luis Chamberlain March 2, 2023, 8:28 p.m. UTC
register_sysctl_paths() is only needed if your child (directories) have
entries but this does not so just use register_sysctl() so to do away
with the path specification.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 fs/verity/signature.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

Comments

Eric Biggers March 7, 2023, 7:47 p.m. UTC | #1
On Thu, Mar 02, 2023 at 12:28:24PM -0800, Luis Chamberlain wrote:
> register_sysctl_paths() is only needed if your child (directories) have
> entries but this does not so just use register_sysctl() so to do away
> with the path specification.
> 
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> ---
>  fs/verity/signature.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)

Applied to https://git.kernel.org/pub/scm/fs/fsverity/linux.git/log/?h=for-next  

- Eric
diff mbox series

Patch

diff --git a/fs/verity/signature.c b/fs/verity/signature.c
index e7d3ca919a1e..b8c51ad40d3a 100644
--- a/fs/verity/signature.c
+++ b/fs/verity/signature.c
@@ -88,12 +88,6 @@  int fsverity_verify_signature(const struct fsverity_info *vi,
 #ifdef CONFIG_SYSCTL
 static struct ctl_table_header *fsverity_sysctl_header;
 
-static const struct ctl_path fsverity_sysctl_path[] = {
-	{ .procname = "fs", },
-	{ .procname = "verity", },
-	{ }
-};
-
 static struct ctl_table fsverity_sysctl_table[] = {
 	{
 		.procname       = "require_signatures",
@@ -109,8 +103,7 @@  static struct ctl_table fsverity_sysctl_table[] = {
 
 static int __init fsverity_sysctl_init(void)
 {
-	fsverity_sysctl_header = register_sysctl_paths(fsverity_sysctl_path,
-						       fsverity_sysctl_table);
+	fsverity_sysctl_header = register_sysctl("fs/verity", fsverity_sysctl_table);
 	if (!fsverity_sysctl_header) {
 		pr_err("sysctl registration failed!\n");
 		return -ENOMEM;