Linux bluetooth development
 help / color / mirror / Atom feed
From: Mat Martineau <mathewm@codeaurora.org>
To: gustavo@padovan.org
Cc: linux-bluetooth@vger.kernel.org, marcel@holtmann.org,
	padovan@profusion.mobi
Subject: Re: [PATCH 2/2] Bluetooth: Add __init and __exit marks to RFCOMM
Date: Fri, 30 Jul 2010 13:39:47 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.1007301330030.5809@linux-sea-02> (raw)
In-Reply-To: <1279947885-19304-2-git-send-email-gustavo@padovan.org>


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

  parent reply	other threads:[~2010-07-30 20:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1007301330030.5809@linux-sea-02 \
    --to=mathewm@codeaurora.org \
    --cc=gustavo@padovan.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=padovan@profusion.mobi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox