test_sysctl-simplify-subdirectory-registration-with-register_sysctl.patch removed from -mm tree
The patch titled
Subject: test_sysctl: simplify subdirectory registration with register_sysctl()
has been removed from the -mm tree. Its filename was
test_sysctl-simplify-subdirectory-registration-with-register_sysctl.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Luis Chamberlain <[email protected]>
Subject: test_sysctl: simplify subdirectory registration with register_sysctl()
There is no need to user boiler plate code to specify a set of base directories we're going to stuff sysctls under. Simplify this by using register_sysctl() and specifying the directory path directly.
// pycocci sysctl-subdir-register-sysctl-simplify.cocci lib/test_sysctl.c
@c1@
expression E1;
identifier subdir, sysctls;
@@
static struct ctl_table subdir[] = {
{
.procname = E1,
.maxlen = 0,
.mode = 0555,
.child = sysctls,
},
{ }
};@c2@
identifier c1.subdir;
expression E2;
identifier base;
@@
static struct ctl_table base[] = {
{
.procname = E2,
.maxlen = 0,
.mode = 0555,
.child = subdir,
},
{ }
};@c3@
identifier c2.base;
identifier header;
@@
header = register_sysctl_table(base);
@r1 depends on c1 && c2 && c3@
expression c1.E1;
identifier c1.subdir, c1.sysctls;
@@
-static struct ctl_table subdir[] = {
- {
- .procname = E1,
- .maxlen = 0,
- .mode = 0555,
- .child = sysctls,
- },
- { }
-};
@r2 depends on c1 && c2 && c3@
identifier c1.subdir;
expression c2.E2;
identifier c2.base;
@@
-static struct ctl_table base[] = {
- {
- .procname = E2,
- .maxlen = 0,
- .mode = 0555,
- .child = subdir,
- },
- { }
-};
@initialize:python@
@@
def make_my_fresh_expression(s1, s2):
return '"' + s1.strip('"') + "/" + s2.strip('"') + '"'
@r3 depends on c1 && c2 && c3@
expression c1.E1;
identifier c1.sysctls;
expression c2.E2;
identifier c2.base;
identifier c3.header;
fresh identifier E3 = script:python(E2, E1) { make_my_fresh_expression(E2, E1) }; @@
header =
-register_sysctl_table(base);
+register_sysctl(E3, sysctls);
---
lib/test_sysctl.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-)
lib/test_sysctl.c renamed from lib/test_sysctl.c~test_sysctl-simplify-subdirectory-registration-with-register_sysctl +1 -21
@@ -128,26 +128,6 @@ static struct ctl_table test_table[] = { { } }; -static struct ctl_table test_sysctl_table[] = { - { - .procname ="test_sysctl" , - .maxlen =0 , - .mode =0555 , - .child = test_table, - }, - { } -}; - -static struct ctl_table test_sysctl_root_table[] = { - { - .procname ="debug" , - .maxlen =0 , - .mode =0555 , - .child = test_sysctl_table, - }, - { } -}; -static struct ctl_table_header *test_sysctl_header;static int __init test_sysctl_init (void )
@@ -155,7 +135,7 @@ static int __init test_sysctl_init(void) test_data.bitmap_0001 =kzalloc (SYSCTL_TEST_BITMAP_SIZE /8 ,GFP_KERNEL );if (!test_data.bitmap_0001)return -ENOMEM ; - test_sysctl_header =register_sysctl_table (test_sysctl_root_table); + test_sysctl_header =register_sysctl ("debug/test_sysctl" , test_table);if (!test_sysctl_header) {kfree (test_data.bitmap_0001);return -ENOMEM ;
_
Patches currently in -mm which might be from [email protected] are