From 855aa4ef86b99f9d23e1253c95d96010f63f08d8 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 5 Oct 2025 16:44:21 +0300 Subject: [PATCH] xfree86: Fix -Wdiscarded-qualifiers warnings in SPARC Sbus probe code Signed-off-by: Alan Coopersmith Part-of: --- hw/xfree86/common/xf86AutoConfig.c | 2 +- hw/xfree86/common/xf86sbusBus_priv.h | 2 +- hw/xfree86/os-support/bus/Sbus.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 4178215871..7890a4ff3f 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -288,7 +288,7 @@ listPossibleVideoDrivers(XF86MatchedDrivers *md) } #endif #ifdef __sparc__ - char *sbusDriver = sparcDriverName(); + const char *sbusDriver = sparcDriverName(); if (sbusDriver) xf86AddMatchedDriver(md, sbusDriver); diff --git a/hw/xfree86/common/xf86sbusBus_priv.h b/hw/xfree86/common/xf86sbusBus_priv.h index cb6381333f..c6717efd4a 100644 --- a/hw/xfree86/common/xf86sbusBus_priv.h +++ b/hw/xfree86/common/xf86sbusBus_priv.h @@ -29,6 +29,6 @@ char *sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp); void sparcPromAssignNodes(void); char *sparcPromNode2Pathname(sbusPromNodePtr pnode); int sparcPromPathname2Node(const char *pathName); -char *sparcDriverName(void); +const char *sparcDriverName(void); #endif /* _XSERVER_XF86_SBUSBUS_H */ diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c index 838a64438e..25e50eb0ac 100644 --- a/hw/xfree86/os-support/bus/Sbus.c +++ b/hw/xfree86/os-support/bus/Sbus.c @@ -237,7 +237,7 @@ sparcPromGetBool(sbusPromNodePtr pnode, const char *prop) return promGetBool(prop); } -static char * +static const char * promWalkGetDriverName(int node, int oldnode) { int nextnode; @@ -267,7 +267,7 @@ promWalkGetDriverName(int node, int oldnode) nextnode = promGetChild(node); if (nextnode) { - char *name; + const char *name; name = promWalkGetDriverName(nextnode, node); if (name) @@ -280,10 +280,10 @@ promWalkGetDriverName(int node, int oldnode) return NULL; } -char * +const char * sparcDriverName(void) { - char *name; + const char *name; if (sparcPromInit() < 0) return NULL; @@ -393,7 +393,7 @@ sparcPromAssignNodes(void) int fbNum, devId; static struct { int devId; - char *prefix; + const char *prefix; } procFbPrefixes[] = { {SBUS_DEVICE_CG14, "CGfourteen"}, {SBUS_DEVICE_CG6, "CGsix"},