[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/6] arm/platforms: Make compatbile with -Wwrite-strings


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 20 Nov 2023 22:49:11 +0000
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Roberto Bagnara <roberto.bagnara@xxxxxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • Delivery-date: Mon, 20 Nov 2023 22:49:31 +0000
  • Ironport-data: A9a23:7Yx7WaOvDVN+r2vvrR16l8FynXyQoLVcMsEvi/4bfWQNrUog0zECz GMaWmDSOavYYGWjLthxbd/ioUlX7cSGyoVgGQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CQ6jefQAOOkVIYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGjxSs/7rRC9H5qyo42pB5ARmP5ingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0tl+MVhN2 +AoEysAfhWjrcyXh7WEdOY506zPLOGzVG8eknRpzDWfBvc6W5HTBa7N4Le03h9p2JoIR6yHI ZNEOHwwNHwsYDUWUrsTILs4kP2lmT/UdDpApUjOjaE2/3LS3Ep6172F3N/9I4baG5sPzxfDz o7A13rIMhwjMuDB8Ajb/lGA2P+elCGqZbtHQdVU8dY12QbOlwT/EiY+RVa95PW0lEO6c9ZeM FAPvDojq7Ao806mRcW7WAe3yFafpQIVUddUF+w86SmOx7DS7gLfAXILJhZDddgnuckeVTEsk FiTkLvBOztrt7GETGOHwZ2dpziyJCs9IHcLYGkPSg5ty9Puup0phxTDCNNqCreoj8bdECv1h TuNqUAWgrQYjccPkaKh713Dqzupqt7CSQtdzh/QVG+/8gQ/boeqYYWy4HDR8PlbIYCWCFKGu RAsncmV6+QHS4+AiDaMRuQlFqym/PuDP3vXhlsHInU6323zoTj5J9kWuWwvYhgxWioZRdP3S HDaiTpSyoNjB2CnfapXSayQTMMV86e1QLwJScvogspyjolZLVDfpH0/OxTJgQjQfF4QfbbT0 Kp3kPpA7l5AUMyLNBLsG48gPUYDn0jSP1/7S5Hh1AiA2rGDfnOTQrptGALRNrhktP7e/FyMr Ig32y62J/N3CrWWjs7/q9Z7ELz3BSJjWcCeRzJ/KoZv3TaK6El+UqSMkNvNiqRunrhPl/egw 51OchYw9bYLvlWecV/iQik6ONvSsWNX8SpT0doEYQz5hBDOoO+HsM8iSnfAVeB2qLU+lacsE KhtlgfpKq0ndwkrMg81NfHVxLGOvjzy7e5SF0JJuAQCQqM=
  • Ironport-hdrordr: A9a23:NgNX+ai79DJOlJx7BX2/oURwDXBQXuIji2hC6mlwRA09TySZ// rBoB19726MtN9xYgBHpTnuAsm9qB/nmaKdpLNhWItKPzOW31dATrsSjrcKqgeIc0aVm9K1l5 0QF5SWYOeAdWSS5vya3ODXKbkdKaG8gcKVuds=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

GCC complains:

  arch/arm/platforms/brcm.c: In function ‘brcm_populate_plat_regs’:
  arch/arm/platforms/brcm.c:76:27: error: passing argument 1 of 
‘brcm_get_dt_node’ discards ‘const’ qualifier from pointer target type 
[-Werror=discarded-qualifiers]
     76 |     rc = brcm_get_dt_node("brcm,brcmstb-cpu-biu-ctrl", &node, 
&reg_base);
        |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~

and

  arch/arm/platforms/exynos5.c: In function ‘exynos5_smp_init’:
  arch/arm/platforms/exynos5.c:109:20: error: assignment discards ‘const’ 
qualifier from pointer target type [-Werror=discarded-qualifiers]
    109 |         compatible = "samsung,exynos4210-sysram-ns";
        |                    ^

In both cases, just make the relevant variable const.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Julien Grall <julien@xxxxxxx>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
CC: Bertrand Marquis <bertrand.marquis@xxxxxxx>
CC: Michal Orzel <michal.orzel@xxxxxxx>
CC: Roberto Bagnara <roberto.bagnara@xxxxxxxxxxx>
CC: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
---
 xen/arch/arm/platforms/brcm.c    | 2 +-
 xen/arch/arm/platforms/exynos5.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/platforms/brcm.c b/xen/arch/arm/platforms/brcm.c
index 951e4d6cc328..43a07ab1a69d 100644
--- a/xen/arch/arm/platforms/brcm.c
+++ b/xen/arch/arm/platforms/brcm.c
@@ -35,7 +35,7 @@ static u32 brcm_boot_continuation_pc;
 
 static struct brcm_plat_regs regs;
 
-static __init int brcm_get_dt_node(char *compat_str,
+static __init int brcm_get_dt_node(const char *compat_str,
                                    const struct dt_device_node **dn,
                                    u32 *reg_base)
 {
diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c
index c48093cd4fa4..f7c09520675e 100644
--- a/xen/arch/arm/platforms/exynos5.c
+++ b/xen/arch/arm/platforms/exynos5.c
@@ -96,7 +96,7 @@ static int __init exynos5_smp_init(void)
 {
     struct dt_device_node *node;
     void __iomem *sysram;
-    char *compatible;
+    const char *compatible;
     paddr_t sysram_addr;
     paddr_t size;
     paddr_t sysram_offset;
-- 
2.30.2




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.