Skip to contentSkip to conversation

Bluetooth: fix sco_exit compile warning

PATCH Applied Alexander Aring 2 participants 2 messages Mar 7, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: fix sco_exit compile warning

While compiling the following warning occurs:

WARNING: net/built-in.o(.init.text+0x602c): Section mismatch in reference from the function bt_init() to the function .exit.text:sco_exit()
The function __init bt_init() references
a function __exit sco_exit().
This is often seen when error handling in the init function uses functionality in the exit path.
The fix is often to remove the __exit annotation of sco_exit() so it may be used outside an exit section.

Since commit 6d785aa345f525e1fdf098b7c590168f0b00f3f1 ("Bluetooth:
Convert mgmt to use HCI chan registration API") the function "sco_exit" is used inside of function "bt_init". The suggested solution by remove the __exit annotation solved this issue.

---
I don't have any working bluetooth setup here, just compile tested.

 net/bluetooth/sco.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/sco.c +1 -1
index 54279ac..4322c83 100644
@@ -1231,7 +1231,7 @@ error:
 	return err;
 }
 
-void __exit sco_exit(void)
+void sco_exit(void)
 {
 	bt_procfs_cleanup(&init_net, "sco");
 
Signature · 1 line
2.3.0
#1 lore raw

Hi Alex,

Quoted 17 lines · Alexander Aring

While compiling the following warning occurs:

WARNING: net/built-in.o(.init.text+0x602c): Section mismatch in reference from the function bt_init() to the function .exit.text:sco_exit()
The function __init bt_init() references
a function __exit sco_exit().
This is often seen when error handling in the init function uses functionality in the exit path.
The fix is often to remove the __exit annotation of sco_exit() so it may be used outside an exit section.

Since commit 6d785aa345f525e1fdf098b7c590168f0b00f3f1 ("Bluetooth:
Convert mgmt to use HCI chan registration API") the function "sco_exit" is used inside of function "bt_init". The suggested solution by remove the __exit annotation solved this issue.

Quoted 7 lines

---
I don't have any working bluetooth setup here, just compile tested.

 net/bluetooth/sco.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to bluetooth-next. Thanks.

Johan