Re: [PATCH] scripts:force conversion argument type

From: Randy Dunlap
Date: Wed May 11 2022 - 23:02:56 EST




On 5/11/22 19:38, Dong Chuanjian wrote:
> scripts:force conversion argument type
>
> Signed-off-by: Dong Chuanjian <chuanjian@xxxxxxxxxxxx>
> ---
> scripts/kallsyms.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
> index 8caabddf817c..544ab1e1b5ca 100644
> --- a/scripts/kallsyms.c
> +++ b/scripts/kallsyms.c
> @@ -498,7 +498,7 @@ static void write_src(void)
>
> output_label("kallsyms_token_index");
> for (i = 0; i < 256; i++)
> - printf("\t.short\t%d\n", best_idx[i]);
> + printf("\t.short\t%d\n", (int)best_idx[i]);

Or (better) you could use %u instead of %d to print the unsigned int value.

> printf("\n");
> }
>

--
~Randy