Skip to contentSkip to conversation

xen: driver/char: fix const declaration of DT compatible list

PATCH Applied Julien Grall 2 participants 3 messages Dec 24, 2013 – Jan 7, 2014 Arm Samsung Exynos

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: driver/char: fix const declaration of DT compatible list

The data type for DT compatible list should be:

    const char * const[]  __initconst

Fix every serial drivers which support device tree.

---
 xen/drivers/char/exynos4210-uart.c | 2 +-
 xen/drivers/char/ns16550.c         | 2 +-
 xen/drivers/char/omap-uart.c       | 2 +-
 xen/drivers/char/pl011.c           | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
xen/drivers/char/exynos4210-uart.c +1 -1
index 17ba010..74ac33d 100644
@@ -358,7 +358,7 @@ static int __init exynos4210_uart_init(struct dt_device_node *dev,
     return 0;
 }
 
-static const char const *exynos4210_dt_compat[] __initdata =
+static const char * const exynos4210_dt_compat[] __initconst =
 {
     "samsung,exynos4210-uart",
     NULL
xen/drivers/char/ns16550.c +1 -1
index 9c2cded..d53caa5 100644
@@ -814,7 +814,7 @@ static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
     return 0;
 }
 
-static const char const *ns16550_dt_compat[] __initconst =
+static const char * const ns16550_dt_compat[] __initconst =
 {
     "ns16550",
     "snps,dw-apb-uart",
xen/drivers/char/omap-uart.c +1 -1
index ad5aabb..7f21f1f 100644
@@ -353,7 +353,7 @@ static int __init omap_uart_init(struct dt_device_node *dev,
     return 0;
 }
 
-static const char * const omap_uart_dt_compat[] __initdata =
+static const char * const omap_uart_dt_compat[] __initconst =
 {
     "ti,omap4-uart",
     NULL
xen/drivers/char/pl011.c +1 -1
index 378d37e..9c2870a 100644
@@ -276,7 +276,7 @@ static int __init pl011_uart_init(struct dt_device_node *dev,
     return 0;
 }
 
-static const char const *pl011_dt_compat[] __initdata =
+static const char * const pl011_dt_compat[] __initconst =
 {
     "arm,pl011",
     NULL
Signature · 1 line
1.8.3.1
Applied
#2 lore raw
Quoted 4 lines · Ian Campbell
Quoted 3 lines · Julien Grall

The data type for DT compatible list should be:

    const char * const[]  __initconst
Quoted 8 lines
Quoted 4 lines

Fix every serial drivers which support device tree.

WRT the release I think this is a bug fix.

The risk here is a build error which will be easily detected, this patterns of const is used in all the existing non-serial DT drivers so I think we can be pretty confident in it.

Applied.