Skip to contentSkip to conversation

lib/test_string.c: allow mode removal

PATCH Applied Matteo Croce 1 participant 2 messages Jun 16, 2021 – Jun 17, 2021 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/test_string.c: allow mode removal

From: Matteo Croce <[email protected]>

The test_string can't be removed because it lacks an exit hook. Since there is no reason for it to be permanent, add an empty one to allow module removal.

---
 lib/test_string.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/test_string.c +5 -0
index 7b31f4a505bf..9dfd6f52de92 100644
@@ -179,6 +179,10 @@ static __init int strnchr_selftest(void)
 	return 0;
 }
 
+static __exit void string_selftest_remove(void)
+{
+}
+
 static __init int string_selftest_init(void)
 {
 	int test, subtest;
@@ -216,4 +220,5 @@ static __init int string_selftest_init(void)
 }
 
 module_init(string_selftest_init);
+module_exit(string_selftest_remove);
 MODULE_LICENSE("GPL v2");
Signature · 1 line
2.31.1
#1 lore raw
Quoted 9 lines · Matteo Croce

From: Matteo Croce <[email protected]>

The test_string can't be removed because it lacks an exit hook. Since there is no reason for it to be permanent, add an empty one to allow module removal.

---

Small typo, s/mode/module/

Regards,

Signature · 1 line
per aspera ad upstream