Skip to content

Commit 393dcd1

Browse files
rddunlapgregkh
authored andcommitted
usb: usbip: eliminate anonymous module_init & module_exit
Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 80fd9cd ("usbip: vudc: Add VUDC main file") Signed-off-by: Randy Dunlap <[email protected]> Cc: Krzysztof Opasiak <[email protected]> Cc: Igor Kotrasinski <[email protected]> Cc: Valentina Manea <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Shuah Khan <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent aff477c commit 393dcd1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/usb/usbip/vudc_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static struct platform_driver vudc_driver = {
2828

2929
static LIST_HEAD(vudc_devices);
3030

31-
static int __init init(void)
31+
static int __init vudc_init(void)
3232
{
3333
int retval = -ENOMEM;
3434
int i;
@@ -86,9 +86,9 @@ static int __init init(void)
8686
out:
8787
return retval;
8888
}
89-
module_init(init);
89+
module_init(vudc_init);
9090

91-
static void __exit cleanup(void)
91+
static void __exit vudc_cleanup(void)
9292
{
9393
struct vudc_device *udc_dev = NULL, *udc_dev2 = NULL;
9494

@@ -103,7 +103,7 @@ static void __exit cleanup(void)
103103
}
104104
platform_driver_unregister(&vudc_driver);
105105
}
106-
module_exit(cleanup);
106+
module_exit(vudc_cleanup);
107107

108108
MODULE_DESCRIPTION("USB over IP Device Controller");
109109
MODULE_AUTHOR("Krzysztof Opasiak, Karol Kosik, Igor Kotrasinski");

0 commit comments

Comments
 (0)