Skip to content

Commit 14200da

Browse files
nixiaomingarter97
authored andcommitted
scripts: Fixed printf format mismatch
scripts/kallsyms.c: function write_src: "printf", the #1 format specifier "d" need arg type "int", but the according arg "table_cnt" has type "unsigned int" scripts/recordmcount.c: function do_file: "fprintf", the #1 format specifier "d" need arg type "int", but the according arg "(*w2)(ehdr->e_machine)" has type "unsigned int" scripts/recordmcount.h: function find_secsym_ndx: "fprintf", the #1 format specifier "d" need arg type "int", but the according arg "txtndx" has type "unsigned int" Signed-off-by: nixiaoming <[email protected]> Acked-by: Steven Rostedt (VMware) <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Danny Lin <[email protected]>
1 parent 0bc9404 commit 14200da

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: scripts/kallsyms.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ static void write_src(void)
427427
}
428428

429429
output_label("kallsyms_num_syms");
430-
printf("\tPTR\t%d\n", table_cnt);
430+
printf("\tPTR\t%u\n", table_cnt);
431431
printf("\n");
432432

433433
/* table of offset markers, that give the offset in the compressed stream

Diff for: scripts/recordmcount.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ do_file(char const *const fname)
531531
gpfx = 0;
532532
switch (w2(ehdr->e_machine)) {
533533
default:
534-
fprintf(stderr, "unrecognized e_machine %d %s\n",
534+
fprintf(stderr, "unrecognized e_machine %u %s\n",
535535
w2(ehdr->e_machine), fname);
536536
fail_file();
537537
break;

Diff for: scripts/recordmcount.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ static unsigned find_secsym_ndx(unsigned const txtndx,
442442
return symp - sym0;
443443
}
444444
}
445-
fprintf(stderr, "Cannot find symbol for section %d: %s.\n",
445+
fprintf(stderr, "Cannot find symbol for section %u: %s.\n",
446446
txtndx, txtname);
447447
fail_file();
448448
}

0 commit comments

Comments
 (0)