All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Pramod Gurav <pramod.gurav@smartplayin.com>
Cc: linux-kernel@vger.kernel.org,
	Ludovic Desroches <ludovic.desroches@atmel.com>,
	Chris Ball <chris@printf.net>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	linux-mmc@vger.kernel.org
Subject: [PATCH] mmc: atmel-mci: fix mismatched section on atmci_cleanup_slot
Date: Fri, 26 Sep 2014 21:34:58 +0200	[thread overview]
Message-ID: <201409262134.58457.arnd@arndb.de> (raw)
In-Reply-To: <1411467606-13041-2-git-send-email-pramod.gurav@smartplayin.com>

As of 528bc7808f4e ("mmc: atmel-mci: Release mmc resources on failure in probe"),
the atmci_probe() function calls atmci_cleanup_slot in the failure path.

This causes a new warning whenever the driver is built:

WARNING: drivers/mmc/host/built-in.o(.init.text+0xa04): Section mismatch in reference from the function atmci_probe() to the function .exit.text:atmci_cleanup_slot()
The function __init atmci_probe() references
a function __exit atmci_cleanup_slot().

Gcc correctly warns about this function getting dropped in the link stage
for the built-in case, which would cause undefined behavior when this error
path is hit. The solution is to simply drop the __exit annotation.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 528bc7808f4e ("mmc: atmel-mci: Release mmc resources on failure in probe")

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 772ef5b0e4d5..974626087732 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -2244,7 +2244,7 @@ static int __init atmci_init_slot(struct atmel_mci *host,
 	return 0;
 }
 
-static void __exit atmci_cleanup_slot(struct atmel_mci_slot *slot,
+static void atmci_cleanup_slot(struct atmel_mci_slot *slot,
 		unsigned int id)
 {
 	/* Debugfs stuff is cleaned up by mmc core */

  parent reply	other threads:[~2014-09-26 19:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 10:20 [PATCH v2 1/2] mmc: atmel-mci: Switch to using managed resource in probe Pramod Gurav
2014-09-23 10:20 ` [PATCH v2 2/2] mmc: atmel-mci: Release mmc resources on failure " Pramod Gurav
2014-09-23 12:43   ` Ludovic Desroches
2014-09-23 12:43     ` Ludovic Desroches
2014-09-24  8:49   ` Ulf Hansson
2014-09-26 19:34   ` Arnd Bergmann [this message]
2014-09-27  3:15     ` [PATCH] mmc: atmel-mci: fix mismatched section on atmci_cleanup_slot Pramod Gurav
2014-09-27 11:59       ` Arnd Bergmann
2014-09-29  7:34     ` Ludovic Desroches
2014-09-29  7:34       ` Ludovic Desroches
2014-09-29  9:43     ` Ulf Hansson
2014-09-23 12:43 ` [PATCH v2 1/2] mmc: atmel-mci: Switch to using managed resource in probe Ludovic Desroches
2014-09-23 12:43   ` Ludovic Desroches

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=201409262134.58457.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=chris@printf.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ludovic.desroches@atmel.com \
    --cc=pramod.gurav@smartplayin.com \
    --cc=ulf.hansson@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.