lkml.org 
[lkml]   [2018]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 1/2] serial: sh-sci: Remove __initdata attribute for struct 'port_cfg'
Date
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@chromium.org>
---
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
\
 
 \ /
  Last update: 2018-03-20 18:58    [W:0.149 / U:24.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site