Re: [PATCH] speakup: Fix the wrong format specifier

From: Samuel Thibault
Date: Wed Dec 04 2024 - 17:39:41 EST


liujing, le mer. 04 déc. 2024 23:03:03 +0800, a ecrit:
> Make a minor change to eliminate a static checker warning. The type
> of '(unsigned int)kp[i]' is unsigned int, so the correct format specifier should be
> %u instead of %d.
>
> Signed-off-by: liujing <liujing@xxxxxxxxxxxxxxxxxxxx>

Reviewed-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>

Thanks!

> diff --git a/drivers/accessibility/speakup/genmap.c b/drivers/accessibility/speakup/genmap.c
> index 0882bab10fb8..9bd78e1f023b 100644
> --- a/drivers/accessibility/speakup/genmap.c
> +++ b/drivers/accessibility/speakup/genmap.c
> @@ -153,7 +153,7 @@ main(int argc, char *argv[])
> continue;
> printf("\n\t%d,", lc);
> for (i = 0; i < max_states; i++)
> - printf(" %d,", (unsigned int)kp[i]);
> + printf(" %u,", (unsigned int)kp[i]);
> }
> printf("\n\t0, %d\n", map_ver);
>
> --
> 2.27.0