* [PATCH] mtd: rawnand: docg4: Remove wrong __init annotations
@ 2018-08-23 21:43 Geert Uytterhoeven
2018-08-27 18:44 ` Boris Brezillon
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2018-08-23 21:43 UTC (permalink / raw)
To: Boris Brezillon, Miquel Raynal, Richard Weinberger,
David Woodhouse, Brian Norris, Marek Vasut
Cc: Arnd Bergmann, linux-mtd, linux-kernel, Geert Uytterhoeven
If gcc (e.g. 4.1.2) decides not to inline init_mtd_structs() and
read_id_reg(), this will cause section mismatches, and crashes:
WARNING: drivers/mtd/nand/raw/docg4.o(.text+0xc10): Section mismatch in reference from the function docg4_attach_chip() to the function .init.text:init_mtd_structs()
The function docg4_attach_chip() references
the function __init init_mtd_structs().
This is often because docg4_attach_chip lacks a __init
annotation or the annotation of init_mtd_structs is wrong.
WARNING: drivers/mtd/nand/raw/docg4.o(.text+0xc3e): Section mismatch in reference from the function docg4_attach_chip() to the function .init.text:read_id_reg()
The function docg4_attach_chip() references
the function __init read_id_reg().
This is often because docg4_attach_chip lacks a __init
annotation or the annotation of read_id_reg is wrong.
Fix this by dropping the now incorrect __init annotations from
init_mtd_structs() and read_id_reg().
Fixes: 66a38478dcc5b5a3 ("mtd: rawnand: docg4: convert driver to nand_scan()")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/mtd/nand/raw/docg4.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/raw/docg4.c b/drivers/mtd/nand/raw/docg4.c
index a3f04315c05c54e6..427fcbc1b71c0551 100644
--- a/drivers/mtd/nand/raw/docg4.c
+++ b/drivers/mtd/nand/raw/docg4.c
@@ -1218,7 +1218,7 @@ static int docg4_resume(struct platform_device *pdev)
return 0;
}
-static void __init init_mtd_structs(struct mtd_info *mtd)
+static void init_mtd_structs(struct mtd_info *mtd)
{
/* initialize mtd and nand data structures */
@@ -1290,7 +1290,7 @@ static void __init init_mtd_structs(struct mtd_info *mtd)
}
-static int __init read_id_reg(struct mtd_info *mtd)
+static int read_id_reg(struct mtd_info *mtd)
{
struct nand_chip *nand = mtd_to_nand(mtd);
struct docg4_priv *doc = nand_get_controller_data(nand);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mtd: rawnand: docg4: Remove wrong __init annotations
2018-08-23 21:43 [PATCH] mtd: rawnand: docg4: Remove wrong __init annotations Geert Uytterhoeven
@ 2018-08-27 18:44 ` Boris Brezillon
0 siblings, 0 replies; 2+ messages in thread
From: Boris Brezillon @ 2018-08-27 18:44 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Miquel Raynal, Richard Weinberger, David Woodhouse, Brian Norris,
Marek Vasut, linux-mtd, linux-kernel, Arnd Bergmann
On Thu, 23 Aug 2018 23:43:45 +0200
Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> If gcc (e.g. 4.1.2) decides not to inline init_mtd_structs() and
> read_id_reg(), this will cause section mismatches, and crashes:
>
> WARNING: drivers/mtd/nand/raw/docg4.o(.text+0xc10): Section mismatch in reference from the function docg4_attach_chip() to the function .init.text:init_mtd_structs()
> The function docg4_attach_chip() references
> the function __init init_mtd_structs().
> This is often because docg4_attach_chip lacks a __init
> annotation or the annotation of init_mtd_structs is wrong.
>
> WARNING: drivers/mtd/nand/raw/docg4.o(.text+0xc3e): Section mismatch in reference from the function docg4_attach_chip() to the function .init.text:read_id_reg()
> The function docg4_attach_chip() references
> the function __init read_id_reg().
> This is often because docg4_attach_chip lacks a __init
> annotation or the annotation of read_id_reg is wrong.
>
> Fix this by dropping the now incorrect __init annotations from
> init_mtd_structs() and read_id_reg().
>
> Fixes: 66a38478dcc5b5a3 ("mtd: rawnand: docg4: convert driver to nand_scan()")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Queued to mtd/master.
Thanks,
Boris
> ---
> drivers/mtd/nand/raw/docg4.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/docg4.c b/drivers/mtd/nand/raw/docg4.c
> index a3f04315c05c54e6..427fcbc1b71c0551 100644
> --- a/drivers/mtd/nand/raw/docg4.c
> +++ b/drivers/mtd/nand/raw/docg4.c
> @@ -1218,7 +1218,7 @@ static int docg4_resume(struct platform_device *pdev)
> return 0;
> }
>
> -static void __init init_mtd_structs(struct mtd_info *mtd)
> +static void init_mtd_structs(struct mtd_info *mtd)
> {
> /* initialize mtd and nand data structures */
>
> @@ -1290,7 +1290,7 @@ static void __init init_mtd_structs(struct mtd_info *mtd)
>
> }
>
> -static int __init read_id_reg(struct mtd_info *mtd)
> +static int read_id_reg(struct mtd_info *mtd)
> {
> struct nand_chip *nand = mtd_to_nand(mtd);
> struct docg4_priv *doc = nand_get_controller_data(nand);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-27 18:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-23 21:43 [PATCH] mtd: rawnand: docg4: Remove wrong __init annotations Geert Uytterhoeven
2018-08-27 18:44 ` Boris Brezillon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).