[PATCH v2 1/2] serial: sh-sci: Remove __initdata attribute for struct 'port_cfg'

From: Daniel Kurtz
Date: Tue Mar 20 2018 - 13:57:36 EST


Commit dd076cffb8cd ("serial: sh-sci: Fix init data attribute for struct
'port_cfg'") properly removed the __init attribute, and changed it to
__initdata.

The __init function early_console_setup() takes the address of global
port_cfg and assigns it to a field in another global, sci_ports:

static int __init early_console_setup(struct earlycon_device *device,
int type)
{
...
port_cfg.type = type;
sci_ports[0].cfg = &port_cfg;
...
}

port_cfg, however, is now in __initdata:
static struct plat_sci_port port_cfg __initdata;

... but sci_ports is not:
static struct sci_port sci_ports[SCI_NPORTS];

Thus, there is a non-__initdata variable containing the address of a
__initdata struct.

Fix this section type conflict by just removing the __initdata attribute.

Fixes: dd076cffb8cd ("serial: sh-sci: Fix init data attribute for struct 'port_cfg'")
Signed-off-by: Daniel Kurtz <djkurtz@xxxxxxxxxxxx>
---
drivers/tty/serial/sh-sci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 44adf9db38f8..ff4e1012ed76 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -3277,7 +3277,7 @@ early_platform_init_buffer("earlyprintk", &sci_driver,
early_serial_buf, ARRAY_SIZE(early_serial_buf));
#endif
#ifdef CONFIG_SERIAL_SH_SCI_EARLYCON
-static struct plat_sci_port port_cfg __initdata;
+static struct plat_sci_port port_cfg;

static int __init early_console_setup(struct earlycon_device *device,
int type)
--
2.16.2.804.g6dcf76e118-goog