[PATCH] tools/atmelimage: add const qualifier to fix compiler warning
Tom Rini
trini at konsulko.com
Wed Feb 25 16:07:42 CET 2026
On Wed, Feb 25, 2026 at 03:03:57PM +0000, Daniel Golle wrote:
> tools/atmelimage.c: In function ‘atmel_find_pmecc_parameter_in_token’:
> tools/atmelimage.c:64:31: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
> 64 | param = strstr(token, "=");
> | ^
> cc1: all warnings being treated as errors
>
> Add 'const' qualifier to variable 'param' to prevent build failing
> due to -Werror.
>
> Signed-off-by: Daniel Golle <daniel at makrotopia.org>
> ---
> tools/atmelimage.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/atmelimage.c b/tools/atmelimage.c
> index 6a2d9d8feab..770f7a0de4e 100644
> --- a/tools/atmelimage.c
> +++ b/tools/atmelimage.c
> @@ -55,7 +55,7 @@ static const char * const configs[] = {
> static int atmel_find_pmecc_parameter_in_token(const char *token)
> {
> size_t pos;
> - char *param;
> + const char *param;
>
> debug("token: '%s'\n", token);
>
How / where are you triggering this problem? This is part of mkimage and
built on CI every time (and on macOS and Windows, in Azure). Thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20260225/a4c38b70/attachment.sig>
More information about the U-Boot
mailing list