lkml.org 
[lkml]   [2007]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC] [4/9] modpost: Fix format string warnings
On Thu, Nov 22, 2007 at 03:43:09AM +0100, Andi Kleen wrote:
>
> Fix wrong format strings in modpost exposed by the previous patch.
> Including one missing argument -- some random data was printed instead.

Looks good. Can I get a s-o-b then I will apply it.

Sam

>
> ---
> scripts/mod/modpost.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> Index: linux/scripts/mod/modpost.c
> ===================================================================
> --- linux.orig/scripts/mod/modpost.c
> +++ linux/scripts/mod/modpost.c
> @@ -388,7 +388,7 @@ static int parse_elf(struct elf_info *in
>
> /* Check if file offset is correct */
> if (hdr->e_shoff > info->size) {
> - fatal("section header offset=%u in file '%s' is bigger then filesize=%lu\n", hdr->e_shoff, filename, info->size);
> + fatal("section header offset=%lu in file '%s' is bigger then filesize=%lu\n", (unsigned long)hdr->e_shoff, filename, info->size);
> return 0;
> }
>
> @@ -409,7 +409,7 @@ static int parse_elf(struct elf_info *in
> const char *secname;
>
> if (sechdrs[i].sh_offset > info->size) {
> - fatal("%s is truncated. sechdrs[i].sh_offset=%u > sizeof(*hrd)=%ul\n", filename, (unsigned int)sechdrs[i].sh_offset, sizeof(*hdr));
> + fatal("%s is truncated. sechdrs[i].sh_offset=%lu > sizeof(*hrd)=%lu\n", filename, (unsigned long)sechdrs[i].sh_offset, sizeof(*hdr));
> return 0;
> }
> secname = secstrings + sechdrs[i].sh_name;
> @@ -907,7 +907,8 @@ static void warn_sec_mismatch(const char
> "before '%s' (at offset -0x%llx)\n",
> modname, fromsec, (unsigned long long)r.r_offset,
> secname, refsymname,
> - elf->strtab + after->st_name);
> + elf->strtab + after->st_name,
> + (unsigned long long)r.r_offset);
> } else {
> warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s\n",
> modname, fromsec, (unsigned long long)r.r_offset,


\
 
 \ /
  Last update: 2007-12-10 19:51    [W:0.255 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site