From: Geert Uytterhoeven <geert@linux-m68k.org>
To: "Finn Thain" <fthain@linux-m68k.org>,
"Michael Schmitz" <schmitzmic@gmail.com>,
"James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
"Sam Creasey" <sammy@sammy.net>,
"Uwe Kleine-König" <ukleinek@kernel.org>
Cc: linux-scsi@vger.kernel.org, linux-m68k@vger.kernel.org,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch
Date: Tue, 5 Nov 2024 19:36:31 +0100 [thread overview]
Message-ID: <b2c56fa3556505befe9b4cb9a830d9e2a962e72c.1730831769.git.geert@linux-m68k.org> (raw)
As described in the added code comment, a reference to .exit.text is ok
for drivers registered via module_platform_driver_probe(). Make this
explicit to prevent the following section mismatch warnings
WARNING: modpost: drivers/scsi/sun3_scsi: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)
WARNING: modpost: drivers/scsi/sun3_scsi_vme: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)
that trigger on a Sun 3 allmodconfig build.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/scsi/sun3_scsi.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
index fffc0fa525940cee..1bd1c3f87ff7dd42 100644
--- a/drivers/scsi/sun3_scsi.c
+++ b/drivers/scsi/sun3_scsi.c
@@ -656,7 +656,13 @@ static void __exit sun3_scsi_remove(struct platform_device *pdev)
iounmap(ioaddr);
}
-static struct platform_driver sun3_scsi_driver = {
+/*
+ * sun3_scsi_remove() lives in .exit.text. For drivers registered via
+ * module_platform_driver_probe() this is ok because they cannot get unbound at
+ * runtime. So mark the driver struct with __refdata to prevent modpost
+ * triggering a section mismatch warning.
+ */
+static struct platform_driver sun3_scsi_driver __refdata = {
.remove_new = __exit_p(sun3_scsi_remove),
.driver = {
.name = DRV_MODULE_NAME,
--
2.34.1
next reply other threads:[~2024-11-05 18:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 18:36 Geert Uytterhoeven [this message]
2024-11-05 22:29 ` [PATCH] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch Finn Thain
2024-11-06 8:50 ` Uwe Kleine-König
2024-11-06 9:59 ` Geert Uytterhoeven
2024-11-07 2:07 ` Martin K. Petersen
2024-11-14 2:49 ` Martin K. Petersen
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=b2c56fa3556505befe9b4cb9a830d9e2a962e72c.1730831769.git.geert@linux-m68k.org \
--to=geert@linux-m68k.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=fthain@linux-m68k.org \
--cc=linux-m68k@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sammy@sammy.net \
--cc=schmitzmic@gmail.com \
--cc=ukleinek@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox