All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>
Cc: David Woodhouse <David.Woodhouse@intel.com>,
	Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mtd@lists.infradead.org, kernel@pengutronix.de,
	linux-kbuild@vger.kernel.org
Subject: [PATCH 01/20] mtd: rawnand: txx9ndfmc: Mark driver struct with __refdata to prevent section mismatch warning
Date: Sun,  8 Oct 2023 22:01:24 +0200	[thread overview]
Message-ID: <20231008200143.196369-2-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20231008200143.196369-1-u.kleine-koenig@pengutronix.de>

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 a section mismatch warning with
CONFIG_MTD_NAND_TXX9NDFMC=m:

	WARNING: modpost: drivers/mtd/nand/raw/txx9ndfmc: section mismatch in reference: txx9ndfmc_driver+0x4 (section: .data) -> txx9ndfmc_remove (section: .exit.text)

Fixes: 64fb65baffa5 ("[MTD] TXx9 SoC NAND Flash Memory Controller driver")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

note this warning only triggers with f177cd0c15fc ("modpost: Don't let
"driver"s reference .exit.*") that currently waits in next for the next
merge window + building with W=1.

Best regards
Uwe

 drivers/mtd/nand/raw/txx9ndfmc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/txx9ndfmc.c b/drivers/mtd/nand/raw/txx9ndfmc.c
index eddcc0728a67..aff9d6f16851 100644
--- a/drivers/mtd/nand/raw/txx9ndfmc.c
+++ b/drivers/mtd/nand/raw/txx9ndfmc.c
@@ -406,7 +406,13 @@ static int txx9ndfmc_resume(struct platform_device *dev)
 #define txx9ndfmc_resume NULL
 #endif
 
-static struct platform_driver txx9ndfmc_driver = {
+/*
+ * txx9ndfmc_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 txx9ndfmc_driver __refdata = {
 	.remove		= __exit_p(txx9ndfmc_remove),
 	.resume		= txx9ndfmc_resume,
 	.driver		= {
-- 
2.40.1


WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>
Cc: David Woodhouse <David.Woodhouse@intel.com>,
	Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mtd@lists.infradead.org, kernel@pengutronix.de,
	linux-kbuild@vger.kernel.org
Subject: [PATCH 01/20] mtd: rawnand: txx9ndfmc: Mark driver struct with __refdata to prevent section mismatch warning
Date: Sun,  8 Oct 2023 22:01:24 +0200	[thread overview]
Message-ID: <20231008200143.196369-2-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20231008200143.196369-1-u.kleine-koenig@pengutronix.de>

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 a section mismatch warning with
CONFIG_MTD_NAND_TXX9NDFMC=m:

	WARNING: modpost: drivers/mtd/nand/raw/txx9ndfmc: section mismatch in reference: txx9ndfmc_driver+0x4 (section: .data) -> txx9ndfmc_remove (section: .exit.text)

Fixes: 64fb65baffa5 ("[MTD] TXx9 SoC NAND Flash Memory Controller driver")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

note this warning only triggers with f177cd0c15fc ("modpost: Don't let
"driver"s reference .exit.*") that currently waits in next for the next
merge window + building with W=1.

Best regards
Uwe

 drivers/mtd/nand/raw/txx9ndfmc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/txx9ndfmc.c b/drivers/mtd/nand/raw/txx9ndfmc.c
index eddcc0728a67..aff9d6f16851 100644
--- a/drivers/mtd/nand/raw/txx9ndfmc.c
+++ b/drivers/mtd/nand/raw/txx9ndfmc.c
@@ -406,7 +406,13 @@ static int txx9ndfmc_resume(struct platform_device *dev)
 #define txx9ndfmc_resume NULL
 #endif
 
-static struct platform_driver txx9ndfmc_driver = {
+/*
+ * txx9ndfmc_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 txx9ndfmc_driver __refdata = {
 	.remove		= __exit_p(txx9ndfmc_remove),
 	.resume		= txx9ndfmc_resume,
 	.driver		= {
-- 
2.40.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2023-10-08 20:02 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-08 20:01 [PATCH 00/20] mtd: Convert to platform remove callback returning void Uwe Kleine-König
2023-10-08 20:01 ` Uwe Kleine-König
2023-10-08 20:01 ` Uwe Kleine-König
2023-10-08 20:01 ` Uwe Kleine-König
2023-10-08 20:01 ` Uwe Kleine-König [this message]
2023-10-08 20:01   ` [PATCH 01/20] mtd: rawnand: txx9ndfmc: Mark driver struct with __refdata to prevent section mismatch warning Uwe Kleine-König
2023-10-09  7:22   ` Masahiro Yamada
2023-10-09  7:22     ` Masahiro Yamada
2023-10-09  8:43     ` Arnd Bergmann
2023-10-09  8:43       ` Arnd Bergmann
2023-10-09 10:30       ` Uwe Kleine-König
2023-10-09 10:30         ` Uwe Kleine-König
2023-10-09 12:46         ` Miquel Raynal
2023-10-09 12:46           ` Miquel Raynal
2023-10-09 13:01           ` Arnd Bergmann
2023-10-09 13:01             ` Arnd Bergmann
2023-10-09 13:37             ` Miquel Raynal
2023-10-09 13:37               ` Miquel Raynal
2023-10-16  8:57               ` Miquel Raynal
2023-10-16  8:57                 ` Miquel Raynal
2023-10-16  9:25         ` Arnd Bergmann
2023-10-16  9:25           ` Arnd Bergmann
2023-10-16 10:21           ` Uwe Kleine-König
2023-10-16 10:21             ` Uwe Kleine-König
2023-10-17 10:20             ` Masahiro Yamada
2023-10-17 10:20               ` Masahiro Yamada
2023-10-17 13:20               ` Uwe Kleine-König
2023-10-17 13:20                 ` Uwe Kleine-König
2023-10-17 13:45                 ` Greg Kroah-Hartman
2023-10-17 13:45                   ` Greg Kroah-Hartman
2023-10-08 20:01 ` [PATCH 02/20] mtd: rawnand: txx9ndfmc: Drop if block with always false condition Uwe Kleine-König
2023-10-08 20:01 ` [PATCH 03/20] mtd: bcm47xxsflash: Convert to platform remove callback returning void Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 04/20] mtd: docg3: " Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 05/20] mtd: phram: " Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 06/20] mtd: powernv_flash: " Uwe Kleine-König
2023-10-08 20:01   ` Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-16  9:28     ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 07/20] mtd: spear_smi: " Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 08/20] mtd: st_spi_fsm: " Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 09/20] mtd: hyperbus: hbmc-am654: " Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 10/20] mtd: hyperbus: rpc-if: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 11/20] mtd: lpddr2_nvm: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 12/20] mtd: maps: lantiq-flash: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 13/20] mtd: maps: physmap-core: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 14/20] mtd: maps: plat-ram: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 15/20] mtd: maps: pxa2xx-flash: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 16/20] mtd: maps: sa1100-flash: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 17/20] mtd: maps: sun_uflash: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 18/20] mtd: rawnand: txx9ndfmc: " Uwe Kleine-König
2023-10-08 20:01 ` [PATCH 19/20] mtd: spi-nor: hisi-sfc: " Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-08 20:01 ` [PATCH 20/20] mtd: spi-nor: nxp-spifi: " Uwe Kleine-König
2023-10-08 20:01   ` Uwe Kleine-König
2023-10-16  9:27   ` Miquel Raynal
2023-10-16  9:27     ` Miquel Raynal
2023-10-09  6:07 ` [PATCH 00/20] mtd: " Tudor Ambarus
2023-10-09  6:07   ` Tudor Ambarus
2023-10-09  6:07   ` Tudor Ambarus
2023-10-09  6:07   ` Tudor Ambarus

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=20231008200143.196369-2-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=David.Woodhouse@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=kernel@pengutronix.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.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 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.