Skip to contentSkip to conversation

torture: remove exporting of internal functions

PATCH In review Denis Efremov 2 participants 3 messages Jul 4, 2019 Torture-test modules

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 torture: remove exporting of internal functions

The functions torture_onoff_cleanup, torture_shuffle_cleanup are declared as static and marked as EXPORT_SYMBOL. It's a bit confusing for an internal function to be exported. The area of visibility for such function is its .c file and all other modules. Other *.c files of the same module can't use it, despite all other modules can. Relying on the fact that these are the internal functions and they are not a crucial part of the API, the patch removes the EXPORT_SYMBOL marking of the torture_onoff_cleanup and torture_shuffle_cleanup. The patch complements commit cc47ae083026 ("rcutorture: Abstract torture-test cleanup").

---
 kernel/torture.c | 2 --
 1 file changed, 2 deletions(-)
kernel/torture.c +0 -2
index 17b2be9bde12..fbbcc4abe426 100644
@@ -263,7 +263,6 @@ static void torture_onoff_cleanup(void)
 	onoff_task = NULL;
 #endif /* #ifdef CONFIG_HOTPLUG_CPU */
 }
-EXPORT_SYMBOL_GPL(torture_onoff_cleanup);
 
 /*
  * Print online/offline testing statistics.
@@ -449,7 +448,6 @@ static void torture_shuffle_cleanup(void)
 	}
 	shuffler_task = NULL;
 }
-EXPORT_SYMBOL_GPL(torture_shuffle_cleanup);
 
 /*
  * Variables for auto-shutdown.  This allows "lights out" torture runs
Signature · 1 line
2.21.0
#1 lore raw
Quoted 11 lines · Denis Efremov

The functions torture_onoff_cleanup, torture_shuffle_cleanup are declared as static and marked as EXPORT_SYMBOL. It's a bit confusing for an internal function to be exported. The area of visibility for such function is its .c file and all other modules. Other *.c files of the same module can't use it, despite all other modules can. Relying on the fact that these are the internal functions and they are not a crucial part of the API, the patch removes the EXPORT_SYMBOL marking of the torture_onoff_cleanup and torture_shuffle_cleanup. The patch complements commit cc47ae083026 ("rcutorture: Abstract torture-test cleanup").

Good catch, applied, thank you!

I reworked the commit message as follows, so could you please check to make sure that I didn't fold, spindle, or otherwise mutilate something?

Thanx, Paul

------------------------------------------------------------------------

commit 0848a1dfea913f0c384b49a1f61f84b95a4d555a

Author: Denis Efremov <[email protected]>
Date:   Thu Jul 4 15:57:19 2019 +0300

torture: Remove exporting of internal functions

The functions torture_onoff_cleanup() and torture_shuffle_cleanup() are declared static and marked EXPORT_SYMBOL_GPL(), which is at best an odd combination. Because these functions are not used outside of the kernel/torture.c file they are defined in, this commit removes their EXPORT_SYMBOL_GPL() marking.

Fixes cc47ae083026 ("rcutorture: Abstract torture-test cleanup")
kernel/torture.c +0 -2
index a8d9bdfba7c3..7c13f5558b71 100644
@@ -263,7 +263,6 @@ static void torture_onoff_cleanup(void)
 	onoff_task = NULL;
 #endif /* #ifdef CONFIG_HOTPLUG_CPU */
 }
-EXPORT_SYMBOL_GPL(torture_onoff_cleanup);
 
 /*
  * Print online/offline testing statistics.
@@ -449,7 +448,6 @@ static void torture_shuffle_cleanup(void)
 	}
 	shuffler_task = NULL;
 }
-EXPORT_SYMBOL_GPL(torture_shuffle_cleanup);
 
 /*
  * Variables for auto-shutdown.  This allows "lights out" torture runs
#2 lore raw
Quoted 6 lines

I reworked the commit message as follows, so could you please check to make sure that I didn't fold, spindle, or otherwise mutilate something?

Thanx, Paul

Perfect, thanks!

Denis