Skip to content

Commit

Permalink
scripts: Fixed printf format mismatch
Browse files Browse the repository at this point in the history
scripts/kallsyms.c: function write_src:
"printf", the vantoman#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 vantoman#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 vantoman#1 format specifier "d" need arg type "int",
but the according arg "txtndx" has type "unsigned int"

Signed-off-by: nixiaoming <nixiaoming@huawei.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
  • Loading branch information
nixiaoming authored and danya2271 committed May 31, 2024
1 parent 594e01a commit bbb2f94
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ static void write_src(void)
}

output_label("kallsyms_num_syms");
printf("\tPTR\t%d\n", table_cnt);
printf("\tPTR\t%u\n", table_cnt);
printf("\n");

/* table of offset markers, that give the offset in the compressed stream
Expand Down
2 changes: 1 addition & 1 deletion scripts/recordmcount.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ do_file(char const *const fname)
gpfx = 0;
switch (w2(ehdr->e_machine)) {
default:
fprintf(stderr, "unrecognized e_machine %d %s\n",
fprintf(stderr, "unrecognized e_machine %u %s\n",
w2(ehdr->e_machine), fname);
fail_file();
break;
Expand Down
2 changes: 1 addition & 1 deletion scripts/recordmcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ static unsigned find_secsym_ndx(unsigned const txtndx,
return symp - sym0;
}
}
fprintf(stderr, "Cannot find symbol for section %d: %s.\n",
fprintf(stderr, "Cannot find symbol for section %u: %s.\n",
txtndx, txtname);
fail_file();
}
Expand Down

0 comments on commit bbb2f94

Please sign in to comment.