Skip to content

Commit e009bd5

Browse files
Joelgranadosmcgrof
authored andcommitted
test_sysctl: Group node sysctl test under one func
Preparation commit to add a new type of test to test_sysctl.c. We want to differentiate between node and (sub)directory tests. Signed-off-by: Joel Granados <j.granados@samsung.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
1 parent a40b702 commit e009bd5

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

lib/test_sysctl.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ static struct ctl_table test_table[] = {
126126
{ }
127127
};
128128

129-
static struct ctl_table_header *test_sysctl_header;
130-
131-
static int __init test_sysctl_init(void)
129+
static void test_sysctl_calc_match_int_ok(void)
132130
{
133131
int i;
134132

@@ -153,7 +151,13 @@ static int __init test_sysctl_init(void)
153151
for (i = 0; i < ARRAY_SIZE(match_int); i++)
154152
if (match_int[i].defined != match_int[i].wanted)
155153
match_int_ok = 0;
154+
}
156155

156+
static struct ctl_table_header *test_sysctl_header;
157+
158+
static int test_sysctl_setup_node_tests(void)
159+
{
160+
test_sysctl_calc_match_int_ok();
157161
test_data.bitmap_0001 = kzalloc(SYSCTL_TEST_BITMAP_SIZE/8, GFP_KERNEL);
158162
if (!test_data.bitmap_0001)
159163
return -ENOMEM;
@@ -162,8 +166,18 @@ static int __init test_sysctl_init(void)
162166
kfree(test_data.bitmap_0001);
163167
return -ENOMEM;
164168
}
169+
165170
return 0;
166171
}
172+
173+
static int __init test_sysctl_init(void)
174+
{
175+
int err;
176+
177+
err = test_sysctl_setup_node_tests();
178+
179+
return err;
180+
}
167181
module_init(test_sysctl_init);
168182

169183
static void __exit test_sysctl_exit(void)

0 commit comments

Comments
 (0)