* [PATCH] scripts: Fixed printf format mismatch
@ 2018-05-24 3:16 nixiaoming
2018-05-24 20:08 ` Steven Rostedt
2018-05-29 13:07 ` Masahiro Yamada
0 siblings, 2 replies; 3+ messages in thread
From: nixiaoming @ 2018-05-24 3:16 UTC (permalink / raw)
To: ard.biesheuvel, akpm, yamada.masahiro, caoj.fnst, linux, rostedt,
peterz, jhogan
Cc: linux-kernel, nixiaoming
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>
---
scripts/kallsyms.c | 2 +-
scripts/recordmcount.c | 2 +-
scripts/recordmcount.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 5abfbf1..e0c416a 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -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
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index 8c9691c..895c40e 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -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;
diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h
index b9897e2..2e77937 100644
--- a/scripts/recordmcount.h
+++ b/scripts/recordmcount.h
@@ -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();
}
--
2.10.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scripts: Fixed printf format mismatch
2018-05-24 3:16 [PATCH] scripts: Fixed printf format mismatch nixiaoming
@ 2018-05-24 20:08 ` Steven Rostedt
2018-05-29 13:07 ` Masahiro Yamada
1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2018-05-24 20:08 UTC (permalink / raw)
To: nixiaoming
Cc: ard.biesheuvel, akpm, yamada.masahiro, caoj.fnst, linux, peterz,
jhogan, linux-kernel, trivial
On Thu, 24 May 2018 11:16:12 +0800
nixiaoming <nixiaoming@huawei.com> wrote:
> 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"
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-- Steve
>
> Signed-off-by: nixiaoming <nixiaoming@huawei.com>
> ---
> scripts/kallsyms.c | 2 +-
> scripts/recordmcount.c | 2 +-
> scripts/recordmcount.h | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
> index 5abfbf1..e0c416a 100644
> --- a/scripts/kallsyms.c
> +++ b/scripts/kallsyms.c
> @@ -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
> diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
> index 8c9691c..895c40e 100644
> --- a/scripts/recordmcount.c
> +++ b/scripts/recordmcount.c
> @@ -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;
> diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h
> index b9897e2..2e77937 100644
> --- a/scripts/recordmcount.h
> +++ b/scripts/recordmcount.h
> @@ -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();
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scripts: Fixed printf format mismatch
2018-05-24 3:16 [PATCH] scripts: Fixed printf format mismatch nixiaoming
2018-05-24 20:08 ` Steven Rostedt
@ 2018-05-29 13:07 ` Masahiro Yamada
1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2018-05-29 13:07 UTC (permalink / raw)
To: nixiaoming
Cc: Ard Biesheuvel, Andrew Morton, Cao jin, Guenter Roeck,
Steven Rostedt, Peter Zijlstra (Intel),
James Hogan, Linux Kernel Mailing List
2018-05-24 12:16 GMT+09:00 nixiaoming <nixiaoming@huawei.com>:
> 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>
Applied to linux-kbuild
with Steven's Ack.
Thanks.
> ---
> scripts/kallsyms.c | 2 +-
> scripts/recordmcount.c | 2 +-
> scripts/recordmcount.h | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
> index 5abfbf1..e0c416a 100644
> --- a/scripts/kallsyms.c
> +++ b/scripts/kallsyms.c
> @@ -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
> diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
> index 8c9691c..895c40e 100644
> --- a/scripts/recordmcount.c
> +++ b/scripts/recordmcount.c
> @@ -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;
> diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h
> index b9897e2..2e77937 100644
> --- a/scripts/recordmcount.h
> +++ b/scripts/recordmcount.h
> @@ -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();
> }
> --
> 2.10.1
>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-29 13:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-24 3:16 [PATCH] scripts: Fixed printf format mismatch nixiaoming
2018-05-24 20:08 ` Steven Rostedt
2018-05-29 13:07 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).