GCC 16.1 defaults to C23 and glibc 2.43 added const qualifiers to
several functions. In particular strchr() will now return a const
char * when a const char * is given as input, and a char * when
given a char * as input.
Fix the following build warning by aligning the data types:
"
tools/image-host.c: In function ‘fit_pre_load_data’:
tools/image-host.c:1797:14: warning: assignment discards ‘const’ qualifier from
pointer target type [-Wdiscarded-qualifiers]
1797 | name = strchr(algo_name, ',');
| ^
"
Reviewed-by: Simon Glass <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
---
Cc: Aristo Chen <[email protected]>
Cc: Daniel Golle <[email protected]>
Cc: James Hilliard <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
---
V2: Add RB from Simon
V3: No change
---
tools/image-host.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/image-host.c b/tools/image-host.c
index 4874c33a01c..b7f3ed826f2 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -1763,7 +1763,7 @@ int fit_pre_load_data(const char *keydir, void *keydest,
void *fit)
int pre_load_noffset;
const char *algo_name;
const char *key_name;
- char *name;
+ const char *name;
int ret;
if (!keydir || !keydest || !fit)
--
2.53.0