From: Joel Granados <j.granados@samsung.com>
To: <mcgrof@kernel.org>
Cc: <linux-kselftest@vger.kernel.org>,
<linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Joel Granados <j.granados@samsung.com>
Subject: [PATCH v2 3/8] test_sysctl: Group node sysctl test under one func
Date: Fri, 16 Jun 2023 10:59:17 +0200 [thread overview]
Message-ID: <20230616085922.3066990-4-j.granados@samsung.com> (raw)
In-Reply-To: <20230616085922.3066990-1-j.granados@samsung.com>
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>
---
lib/test_sysctl.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/lib/test_sysctl.c b/lib/test_sysctl.c
index e2a816d85ea2..0cf7c547d61a 100644
--- a/lib/test_sysctl.c
+++ b/lib/test_sysctl.c
@@ -126,9 +126,7 @@ static struct ctl_table test_table[] = {
{ }
};
-static struct ctl_table_header *test_sysctl_header;
-
-static int __init test_sysctl_init(void)
+static void test_sysctl_calc_match_int_ok(void)
{
int i;
@@ -153,7 +151,13 @@ static int __init test_sysctl_init(void)
for (i = 0; i < ARRAY_SIZE(match_int); i++)
if (match_int[i].defined != match_int[i].wanted)
match_int_ok = 0;
+}
+static struct ctl_table_header *test_sysctl_header;
+
+static int test_sysctl_setup_node_tests(void)
+{
+ test_sysctl_calc_match_int_ok();
test_data.bitmap_0001 = kzalloc(SYSCTL_TEST_BITMAP_SIZE/8, GFP_KERNEL);
if (!test_data.bitmap_0001)
return -ENOMEM;
@@ -162,8 +166,18 @@ static int __init test_sysctl_init(void)
kfree(test_data.bitmap_0001);
return -ENOMEM;
}
+
return 0;
}
+
+static int __init test_sysctl_init(void)
+{
+ int err;
+
+ err = test_sysctl_setup_node_tests();
+
+ return err;
+}
module_init(test_sysctl_init);
static void __exit test_sysctl_exit(void)
--
2.30.2
next prev parent reply other threads:[~2023-06-16 9:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230616085926eucas1p10709e25a4c0246ed2b22da602f919b4e@eucas1p1.samsung.com>
2023-06-16 8:59 ` [PATCH v2 0/8] Remove child from struct ctl_table Joel Granados
[not found] ` <CGME20230616085927eucas1p265c6e3512e3102a7df507da9d3f1f094@eucas1p2.samsung.com>
2023-06-16 8:59 ` [PATCH v2 1/8] parport: plug a sysctl register leak Joel Granados
[not found] ` <CGME20230616085930eucas1p2d1b7ee012df532b3dcf15f96cd2f8c18@eucas1p2.samsung.com>
2023-06-16 8:59 ` [PATCH v2 2/8] test_sysctl: Fix test metadata getters Joel Granados
[not found] ` <CGME20230616085932eucas1p1d3d120da7944fc06d714035043697e4d@eucas1p1.samsung.com>
2023-06-16 8:59 ` Joel Granados [this message]
[not found] ` <CGME20230616085935eucas1p2439375978f0ee33afd6310a9f8c5d07a@eucas1p2.samsung.com>
2023-06-16 8:59 ` [PATCH v2 4/8] test_sysctl: Add an unregister sysctl test Joel Granados
[not found] ` <CGME20230616085937eucas1p2128b2ddb3c01c887a606f376de850767@eucas1p2.samsung.com>
2023-06-16 8:59 ` [PATCH v2 5/8] test_sysctl: Add an option to prevent test skip Joel Granados
[not found] ` <CGME20230616085939eucas1p24e5c916a261653ce64bb65c7d12d2830@eucas1p2.samsung.com>
2023-06-16 8:59 ` [PATCH v2 6/8] test_sysclt: Test for registering a mount point Joel Granados
[not found] ` <CGME20230616085941eucas1p152b54db1511bfdd1afab32621aec847e@eucas1p1.samsung.com>
2023-06-16 8:59 ` [PATCH v2 7/8] sysctl: Remove debugging dump_stack Joel Granados
[not found] ` <CGME20230616085944eucas1p14e8491c53f5390064035de1ffb354c7a@eucas1p1.samsung.com>
2023-06-16 8:59 ` [PATCH v2 8/8] sysctl: replace child with an enumeration Joel Granados
2023-06-18 9:33 ` [PATCH v2 0/8] Remove child from struct ctl_table Luis Chamberlain
2023-06-19 7:32 ` Joel Granados
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230616085922.3066990-4-j.granados@samsung.com \
--to=j.granados@samsung.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mcgrof@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®