Skip to contentSkip to conversation

scripts:force conversion argument type

PATCH In review Dong Chuanjian 2 participants 2 messages May 12, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts:force conversion argument type

scripts:force conversion argument type

---
 scripts/kallsyms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kallsyms.c +1 -1
index 8caabddf817c..544ab1e1b5ca 100644
@@ -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]);
 	printf("\n");
 }
 
Signature · 1 line
2.18.2
#1 lore raw
Quoted 12 lines · Dong Chuanjian

scripts:force conversion argument type

---
 scripts/kallsyms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kallsyms.c +0 -0
index 8caabddf817c..544ab1e1b5ca 100644

scripts/kallsyms.c static void write_src(void) · line 501

Quoted 5 lines
scripts/kallsyms.c +1 -1
@@ -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.

Quoted 3 lines
scripts/kallsyms.c +0 -0
 	printf("\n");
 }
 
Signature · 1 line
~Randy