scripts: Fixed printf format mismatch
authornixiaoming <nixiaoming@huawei.com>
Thu, 24 May 2018 03:16:12 +0000 (11:16 +0800)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 29 May 2018 13:04:12 +0000 (22:04 +0900)
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 <nixiaoming@huawei.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/kallsyms.c
scripts/recordmcount.c
scripts/recordmcount.h

index 80417629b2469d3aa48b4b4ff4ca99ad8fa3b651..a9186a98a37d1342cd58446b29804e47f712b168 100644 (file)
@@ -405,7 +405,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
index 8c9691c3329e028ec47428a2ae4c82b785cb6da8..895c40e8679f77375b15daa23b0fe0b886b98f4f 100644 (file)
@@ -500,7 +500,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;
index b9897e2be404d24735068f584831c51ef90efccd..2e7793735e145157d5e3cf849679ed70ed2924a7 100644 (file)
@@ -441,7 +441,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();
 }