public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Tony Luck <tony.luck@intel.com>
Cc: Anton Vorontsov <anton@enomsg.org>,
	Colin Cross <ccross@android.com>,
	Kees Cook <keescook@chromium.org>,
	linux-kernel@vger.kernel.org, Geliang Tang <geliangtang@163.com>
Subject: [PATCH] pstore: remove __exit annotation for ramoops_remove
Date: Thu, 22 Oct 2015 16:52:33 +0200	[thread overview]
Message-ID: <4192179.KJLgHAoH2d@wuerfel> (raw)

The remove function of a device driver should not be marked
__exit, because that section gets discarded for built-in drivers,
and it is still possible to manually unbind a driver from a
device, which would result in a runtime error.

The kernel also produces a link error for this when the module
is built-in:

`ramoops_remove' referenced in section `.data' of fs/built-in.o: defined in discarded section `.exit.text' of fs/built-in.o

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 2adb611ef932 ("pstore: add pstore unregister")

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 68889a727bc7..319c3a60cfa5 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -578,7 +578,7 @@ fail_out:
 	return err;
 }
 
-static int __exit ramoops_remove(struct platform_device *pdev)
+static int ramoops_remove(struct platform_device *pdev)
 {
 	struct ramoops_context *cxt = &oops_cxt;
 


             reply	other threads:[~2015-10-22 14:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22 14:52 Arnd Bergmann [this message]
2015-10-22 16:05 ` [PATCH] pstore: remove __exit annotation for ramoops_remove Luck, Tony
2015-10-22 16:09 ` Geliang Tang

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=4192179.KJLgHAoH2d@wuerfel \
    --to=arnd@arndb.de \
    --cc=anton@enomsg.org \
    --cc=ccross@android.com \
    --cc=geliangtang@163.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    /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