linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Add __init and __exit marks to UART drivers
@ 2010-07-24  5:04 Gustavo F. Padovan
  2010-07-24  5:04 ` [PATCH 2/2] Bluetooth: Add __init and __exit marks to RFCOMM Gustavo F. Padovan
  2010-07-27 19:36 ` [PATCH 1/2] Bluetooth: Add __init and __exit marks to UART drivers Marcel Holtmann
  0 siblings, 2 replies; 7+ messages in thread
From: Gustavo F. Padovan @ 2010-07-24  5:04 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: marcel, Gustavo F. Padovan

From: Gustavo F. Padovan <padovan@profusion.mobi>

Those marks are useful to save space in the binary and in the memory.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
 drivers/bluetooth/hci_ath.c  |    4 ++--
 drivers/bluetooth/hci_bcsp.c |    4 ++--
 drivers/bluetooth/hci_h4.c   |    4 ++--
 drivers/bluetooth/hci_ll.c   |    4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c
index 5ab258b..b941dd5 100644
--- a/drivers/bluetooth/hci_ath.c
+++ b/drivers/bluetooth/hci_ath.c
@@ -217,7 +217,7 @@ static struct hci_uart_proto athp = {
 	.flush = ath_flush,
 };
 
-int ath_init(void)
+int __init ath_init(void)
 {
 	int err = hci_uart_register_proto(&athp);
 
@@ -229,7 +229,7 @@ int ath_init(void)
 	return err;
 }
 
-int ath_deinit(void)
+int __exit ath_deinit(void)
 {
 	return hci_uart_unregister_proto(&athp);
 }
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index 42d69d4..9c5b2dc 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -739,7 +739,7 @@ static struct hci_uart_proto bcsp = {
 	.flush		= bcsp_flush
 };
 
-int bcsp_init(void)
+int __init bcsp_init(void)
 {
 	int err = hci_uart_register_proto(&bcsp);
 
@@ -751,7 +751,7 @@ int bcsp_init(void)
 	return err;
 }
 
-int bcsp_deinit(void)
+int __exit bcsp_deinit(void)
 {
 	return hci_uart_unregister_proto(&bcsp);
 }
diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c
index b2cf50e..7b8ad93 100644
--- a/drivers/bluetooth/hci_h4.c
+++ b/drivers/bluetooth/hci_h4.c
@@ -173,7 +173,7 @@ static struct hci_uart_proto h4p = {
 	.flush		= h4_flush,
 };
 
-int h4_init(void)
+int __init h4_init(void)
 {
 	int err = hci_uart_register_proto(&h4p);
 
@@ -185,7 +185,7 @@ int h4_init(void)
 	return err;
 }
 
-int h4_deinit(void)
+int __exit h4_deinit(void)
 {
 	return hci_uart_unregister_proto(&h4p);
 }
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index 5744aba..38595e7 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -517,7 +517,7 @@ static struct hci_uart_proto llp = {
 	.flush		= ll_flush,
 };
 
-int ll_init(void)
+int __init ll_init(void)
 {
 	int err = hci_uart_register_proto(&llp);
 
@@ -529,7 +529,7 @@ int ll_init(void)
 	return err;
 }
 
-int ll_deinit(void)
+int __exit ll_deinit(void)
 {
 	return hci_uart_unregister_proto(&llp);
 }
-- 
1.7.1.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] Bluetooth: Add __init and __exit marks to RFCOMM
  2010-07-24  5:04 [PATCH 1/2] Bluetooth: Add __init and __exit marks to UART drivers Gustavo F. Padovan
@ 2010-07-24  5:04 ` Gustavo F. Padovan
  2010-07-27 19:37   ` Marcel Holtmann
  2010-07-30 20:39   ` Mat Martineau
  2010-07-27 19:36 ` [PATCH 1/2] Bluetooth: Add __init and __exit marks to UART drivers Marcel Holtmann
  1 sibling, 2 replies; 7+ messages in thread
From: Gustavo F. Padovan @ 2010-07-24  5:04 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: marcel, Gustavo F. Padovan

From: Gustavo F. Padovan <padovan@profusion.mobi>

Those annotation save memory and space on the binary. __init code is
discarded just after execute and __exit code is discarded if the module is
built into the kernel image or unload of modules is not allowed.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
 net/bluetooth/rfcomm/sock.c |    2 +-
 net/bluetooth/rfcomm/tty.c  |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index 43fbf6b..44a6232 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -1152,7 +1152,7 @@ error:
 	return err;
 }
 
-void rfcomm_cleanup_sockets(void)
+void __exit rfcomm_cleanup_sockets(void)
 {
 	debugfs_remove(rfcomm_sock_debugfs);
 
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 309b6c2..026205c 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -1153,7 +1153,7 @@ static const struct tty_operations rfcomm_ops = {
 	.tiocmset		= rfcomm_tty_tiocmset,
 };
 
-int rfcomm_init_ttys(void)
+int __init rfcomm_init_ttys(void)
 {
 	rfcomm_tty_driver = alloc_tty_driver(RFCOMM_TTY_PORTS);
 	if (!rfcomm_tty_driver)
@@ -1183,7 +1183,7 @@ int rfcomm_init_ttys(void)
 	return 0;
 }
 
-void rfcomm_cleanup_ttys(void)
+void __exit rfcomm_cleanup_ttys(void)
 {
 	tty_unregister_driver(rfcomm_tty_driver);
 	put_tty_driver(rfcomm_tty_driver);
-- 
1.7.1.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] Bluetooth: Add __init and __exit marks to UART drivers
  2010-07-24  5:04 [PATCH 1/2] Bluetooth: Add __init and __exit marks to UART drivers Gustavo F. Padovan
  2010-07-24  5:04 ` [PATCH 2/2] Bluetooth: Add __init and __exit marks to RFCOMM Gustavo F. Padovan
@ 2010-07-27 19:36 ` Marcel Holtmann
  1 sibling, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2010-07-27 19:36 UTC (permalink / raw)
  To: Gustavo F. Padovan; +Cc: linux-bluetooth, Gustavo F. Padovan

Hi Gustavo,

> Those marks are useful to save space in the binary and in the memory.
> 
> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
> ---
>  drivers/bluetooth/hci_ath.c  |    4 ++--
>  drivers/bluetooth/hci_bcsp.c |    4 ++--
>  drivers/bluetooth/hci_h4.c   |    4 ++--
>  drivers/bluetooth/hci_ll.c   |    4 ++--
>  4 files changed, 8 insertions(+), 8 deletions(-)

patch has been applied. Thanks.

Regards

Marcel



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] Bluetooth: Add __init and __exit marks to RFCOMM
  2010-07-24  5:04 ` [PATCH 2/2] Bluetooth: Add __init and __exit marks to RFCOMM Gustavo F. Padovan
@ 2010-07-27 19:37   ` Marcel Holtmann
  2010-07-30 20:39   ` Mat Martineau
  1 sibling, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2010-07-27 19:37 UTC (permalink / raw)
  To: Gustavo F. Padovan; +Cc: linux-bluetooth, Gustavo F. Padovan

Hi Gustavo,

> Those annotation save memory and space on the binary. __init code is
> discarded just after execute and __exit code is discarded if the module is
> built into the kernel image or unload of modules is not allowed.
> 
> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
> ---
>  net/bluetooth/rfcomm/sock.c |    2 +-
>  net/bluetooth/rfcomm/tty.c  |    4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)

patch has been applied. Thanks.

Regards

Marcel



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] Bluetooth: Add __init and __exit marks to RFCOMM
  2010-07-24  5:04 ` [PATCH 2/2] Bluetooth: Add __init and __exit marks to RFCOMM Gustavo F. Padovan
  2010-07-27 19:37   ` Marcel Holtmann
@ 2010-07-30 20:39   ` Mat Martineau
  2010-07-31 22:57     ` [PATCH] Bluetooth: Remove __exit from rfcomm_cleanup_ttys() Gustavo F. Padovan
  1 sibling, 1 reply; 7+ messages in thread
From: Mat Martineau @ 2010-07-30 20:39 UTC (permalink / raw)
  To: gustavo; +Cc: linux-bluetooth, marcel, padovan


Gustavo -

On Sat, 24 Jul 2010, Gustavo F. Padovan wrote:

> From: Gustavo F. Padovan <padovan@profusion.mobi>
>
> Those annotation save memory and space on the binary. __init code is
> discarded just after execute and __exit code is discarded if the module is
> built into the kernel image or unload of modules is not allowed.
>
> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
> ---
> net/bluetooth/rfcomm/sock.c |    2 +-
> net/bluetooth/rfcomm/tty.c  |    4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
> index 43fbf6b..44a6232 100644
> --- a/net/bluetooth/rfcomm/sock.c
> +++ b/net/bluetooth/rfcomm/sock.c
> @@ -1152,7 +1152,7 @@ error:
> 	return err;
> }
>
> -void rfcomm_cleanup_sockets(void)
> +void __exit rfcomm_cleanup_sockets(void)
> {
> 	debugfs_remove(rfcomm_sock_debugfs);
>
> diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
> index 309b6c2..026205c 100644
> --- a/net/bluetooth/rfcomm/tty.c
> +++ b/net/bluetooth/rfcomm/tty.c
> @@ -1153,7 +1153,7 @@ static const struct tty_operations rfcomm_ops = {
> 	.tiocmset		= rfcomm_tty_tiocmset,
> };
>
> -int rfcomm_init_ttys(void)
> +int __init rfcomm_init_ttys(void)
> {
> 	rfcomm_tty_driver = alloc_tty_driver(RFCOMM_TTY_PORTS);
> 	if (!rfcomm_tty_driver)
> @@ -1183,7 +1183,7 @@ int rfcomm_init_ttys(void)
> 	return 0;
> }
>
> -void rfcomm_cleanup_ttys(void)
> +void __exit rfcomm_cleanup_ttys(void)
> {
> 	tty_unregister_driver(rfcomm_tty_driver);
> 	put_tty_driver(rfcomm_tty_driver);

The change to rfcomm_cleanup_ttys() causes a warning:

WARNING: modpost: Found 1 section mismatch(es).

rfcomm_cleanup_ttys() is also called by rfcomm_init, so it should not 
be marked with __exit.

--
Mat Martineau
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] Bluetooth: Remove __exit from rfcomm_cleanup_ttys()
  2010-07-30 20:39   ` Mat Martineau
@ 2010-07-31 22:57     ` Gustavo F. Padovan
  2010-07-31 23:10       ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: Gustavo F. Padovan @ 2010-07-31 22:57 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: marcel, Gustavo F. Padovan

From: Gustavo F. Padovan <padovan@profusion.mobi>

rfcomm_cleanup_ttys() is also called from rfcomm_init(), so it can't have
__exit.

Reported-by: Mat Martineau <mathewm@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
 net/bluetooth/rfcomm/tty.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 026205c..befc3a5 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -1183,7 +1183,7 @@ int __init rfcomm_init_ttys(void)
 	return 0;
 }
 
-void __exit rfcomm_cleanup_ttys(void)
+void rfcomm_cleanup_ttys(void)
 {
 	tty_unregister_driver(rfcomm_tty_driver);
 	put_tty_driver(rfcomm_tty_driver);
-- 
1.7.1.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Bluetooth: Remove __exit from rfcomm_cleanup_ttys()
  2010-07-31 22:57     ` [PATCH] Bluetooth: Remove __exit from rfcomm_cleanup_ttys() Gustavo F. Padovan
@ 2010-07-31 23:10       ` Marcel Holtmann
  0 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2010-07-31 23:10 UTC (permalink / raw)
  To: Gustavo F. Padovan; +Cc: linux-bluetooth, Gustavo F. Padovan

Hi Gustavo,

> rfcomm_cleanup_ttys() is also called from rfcomm_init(), so it can't have
> __exit.
> 
> Reported-by: Mat Martineau <mathewm@codeaurora.org>
> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
> ---
>  net/bluetooth/rfcomm/tty.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

patch has been applied. Thanks.

Regards

Marcel



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-07-31 23:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-24  5:04 [PATCH 1/2] Bluetooth: Add __init and __exit marks to UART drivers Gustavo F. Padovan
2010-07-24  5:04 ` [PATCH 2/2] Bluetooth: Add __init and __exit marks to RFCOMM Gustavo F. Padovan
2010-07-27 19:37   ` Marcel Holtmann
2010-07-30 20:39   ` Mat Martineau
2010-07-31 22:57     ` [PATCH] Bluetooth: Remove __exit from rfcomm_cleanup_ttys() Gustavo F. Padovan
2010-07-31 23:10       ` Marcel Holtmann
2010-07-27 19:36 ` [PATCH 1/2] Bluetooth: Add __init and __exit marks to UART drivers Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).