All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kexec, i386: Fix build warning of size_t print
@ 2013-04-06  5:39 Zhang Yanfei
  2013-04-08  1:37 ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Zhang Yanfei @ 2013-04-06  5:39 UTC (permalink / raw)
  To: Simon Horman; +Cc: kexec@lists.infradead.org

From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>

When compile kexec-tools in i386, we got the following warnings:

kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’

This is because the two functions output a size_t value as %ld
when it should be %zd, resulting in this warning.

Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
---
 kexec/kexec-elf-rel.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kexec/kexec-elf-rel.c b/kexec/kexec-elf-rel.c
index 38e34ec..6acd50d 100644
--- a/kexec/kexec-elf-rel.c
+++ b/kexec/kexec-elf-rel.c
@@ -513,7 +513,7 @@ void elf_rel_set_symbol(struct mem_ehdr *ehdr,
                        name);
        }
        if (sym.st_size != size) {
-               die("Symbol: %s has size: %lld not %ld\n",
+               die("Symbol: %s has size: %lld not %zd\n",
                        name, sym.st_size, size);
        }
        shdr = &ehdr->e_shdr[sym.st_shndx];
@@ -537,7 +537,7 @@ void elf_rel_get_symbol(struct mem_ehdr *ehdr,
                die("Symbol: %s not found cannot get\n", name);
        }
        if (sym.st_size != size) {
-               die("Symbol: %s has size: %lld not %ld\n",
+               die("Symbol: %s has size: %lld not %zd\n",
                        name, sym.st_size, size);
        }
        shdr = &ehdr->e_shdr[sym.st_shndx];
-- 
1.7.1

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] kexec, i386: Fix build warning of size_t print
  2013-04-06  5:39 [PATCH] kexec, i386: Fix build warning of size_t print Zhang Yanfei
@ 2013-04-08  1:37 ` Simon Horman
  2013-04-08  1:38   ` Zhang Yanfei
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2013-04-08  1:37 UTC (permalink / raw)
  To: Zhang Yanfei; +Cc: kexec@lists.infradead.org

On Sat, Apr 06, 2013 at 01:39:40PM +0800, Zhang Yanfei wrote:
> From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
> 
> When compile kexec-tools in i386, we got the following warnings:
> 
> kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
> kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
> kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
> kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
> 
> This is because the two functions output a size_t value as %ld
> when it should be %zd, resulting in this warning.

Thanks,

This change looks good to me, however, the patch does
not appear to apply on the master branch of the kexec-tools tree.
Could you rebase and repost it?

> 
> Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
> ---
>  kexec/kexec-elf-rel.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kexec/kexec-elf-rel.c b/kexec/kexec-elf-rel.c
> index 38e34ec..6acd50d 100644
> --- a/kexec/kexec-elf-rel.c
> +++ b/kexec/kexec-elf-rel.c
> @@ -513,7 +513,7 @@ void elf_rel_set_symbol(struct mem_ehdr *ehdr,
>                         name);
>         }
>         if (sym.st_size != size) {
> -               die("Symbol: %s has size: %lld not %ld\n",
> +               die("Symbol: %s has size: %lld not %zd\n",
>                         name, sym.st_size, size);
>         }
>         shdr = &ehdr->e_shdr[sym.st_shndx];
> @@ -537,7 +537,7 @@ void elf_rel_get_symbol(struct mem_ehdr *ehdr,
>                 die("Symbol: %s not found cannot get\n", name);
>         }
>         if (sym.st_size != size) {
> -               die("Symbol: %s has size: %lld not %ld\n",
> +               die("Symbol: %s has size: %lld not %zd\n",
>                         name, sym.st_size, size);
>         }
>         shdr = &ehdr->e_shdr[sym.st_shndx];
> -- 
> 1.7.1
> 

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] kexec, i386: Fix build warning of size_t print
  2013-04-08  1:37 ` Simon Horman
@ 2013-04-08  1:38   ` Zhang Yanfei
  2013-04-08  2:08     ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Zhang Yanfei @ 2013-04-08  1:38 UTC (permalink / raw)
  To: Simon Horman; +Cc: kexec@lists.infradead.org, Zhang Yanfei

于 2013年04月08日 09:37, Simon Horman 写道:
> On Sat, Apr 06, 2013 at 01:39:40PM +0800, Zhang Yanfei wrote:
>> From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
>>
>> When compile kexec-tools in i386, we got the following warnings:
>>
>> kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
>> kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
>> kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
>> kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
>>
>> This is because the two functions output a size_t value as %ld
>> when it should be %zd, resulting in this warning.
> 
> Thanks,
> 
> This change looks good to me, however, the patch does
> not appear to apply on the master branch of the kexec-tools tree.
> Could you rebase and repost it?

Really? Maybe I made some mistake. Anyway I will regenerate it and
resend it again.

Thanks
Zhang

> 
>>
>> Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
>> ---
>>  kexec/kexec-elf-rel.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/kexec/kexec-elf-rel.c b/kexec/kexec-elf-rel.c
>> index 38e34ec..6acd50d 100644
>> --- a/kexec/kexec-elf-rel.c
>> +++ b/kexec/kexec-elf-rel.c
>> @@ -513,7 +513,7 @@ void elf_rel_set_symbol(struct mem_ehdr *ehdr,
>>                         name);
>>         }
>>         if (sym.st_size != size) {
>> -               die("Symbol: %s has size: %lld not %ld\n",
>> +               die("Symbol: %s has size: %lld not %zd\n",
>>                         name, sym.st_size, size);
>>         }
>>         shdr = &ehdr->e_shdr[sym.st_shndx];
>> @@ -537,7 +537,7 @@ void elf_rel_get_symbol(struct mem_ehdr *ehdr,
>>                 die("Symbol: %s not found cannot get\n", name);
>>         }
>>         if (sym.st_size != size) {
>> -               die("Symbol: %s has size: %lld not %ld\n",
>> +               die("Symbol: %s has size: %lld not %zd\n",
>>                         name, sym.st_size, size);
>>         }
>>         shdr = &ehdr->e_shdr[sym.st_shndx];
>> -- 
>> 1.7.1
>>
> 


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] kexec, i386: Fix build warning of size_t print
  2013-04-08  1:38   ` Zhang Yanfei
@ 2013-04-08  2:08     ` Simon Horman
  2013-04-08  2:11       ` Zhang Yanfei
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2013-04-08  2:08 UTC (permalink / raw)
  To: Zhang Yanfei; +Cc: kexec@lists.infradead.org, Zhang Yanfei

On Mon, Apr 08, 2013 at 09:38:49AM +0800, Zhang Yanfei wrote:
> 于 2013年04月08日 09:37, Simon Horman 写道:
> > On Sat, Apr 06, 2013 at 01:39:40PM +0800, Zhang Yanfei wrote:
> >> From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
> >>
> >> When compile kexec-tools in i386, we got the following warnings:
> >>
> >> kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
> >> kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
> >> kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
> >> kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
> >>
> >> This is because the two functions output a size_t value as %ld
> >> when it should be %zd, resulting in this warning.
> > 
> > Thanks,
> > 
> > This change looks good to me, however, the patch does
> > not appear to apply on the master branch of the kexec-tools tree.
> > Could you rebase and repost it?
> 
> Really? Maybe I made some mistake. Anyway I will regenerate it and
> resend it again.

Perhaps I made a mistake ^)

The head commit I have is:

commit 969f3e8c1c534f63b869183ccf292bcaef0e5558
Author: Richard Weinberger <richard@nod.at>
Date:   Mon Apr 1 13:23:04 2013 +0200

    purgatory: remove arch/i386/timer.c
    
    This file is nowhere referenced, let's get rid of it.
    
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Simon Horman <horms@verge.net.au>

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] kexec, i386: Fix build warning of size_t print
  2013-04-08  2:08     ` Simon Horman
@ 2013-04-08  2:11       ` Zhang Yanfei
  2013-04-08  3:33         ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Zhang Yanfei @ 2013-04-08  2:11 UTC (permalink / raw)
  To: Simon Horman; +Cc: kexec@lists.infradead.org, Zhang Yanfei

于 2013年04月08日 10:08, Simon Horman 写道:
> On Mon, Apr 08, 2013 at 09:38:49AM +0800, Zhang Yanfei wrote:
>> 于 2013年04月08日 09:37, Simon Horman 写道:
>>> On Sat, Apr 06, 2013 at 01:39:40PM +0800, Zhang Yanfei wrote:
>>>> From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
>>>>
>>>> When compile kexec-tools in i386, we got the following warnings:
>>>>
>>>> kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
>>>> kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
>>>> kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
>>>> kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
>>>>
>>>> This is because the two functions output a size_t value as %ld
>>>> when it should be %zd, resulting in this warning.
>>>
>>> Thanks,
>>>
>>> This change looks good to me, however, the patch does
>>> not appear to apply on the master branch of the kexec-tools tree.
>>> Could you rebase and repost it?
>>
>> Really? Maybe I made some mistake. Anyway I will regenerate it and
>> resend it again.
> 
> Perhaps I made a mistake ^)
> 
> The head commit I have is:
> 
> commit 969f3e8c1c534f63b869183ccf292bcaef0e5558
> Author: Richard Weinberger <richard@nod.at>
> Date:   Mon Apr 1 13:23:04 2013 +0200
> 
>     purgatory: remove arch/i386/timer.c
>     
>     This file is nowhere referenced, let's get rid of it.
>     
>     Signed-off-by: Richard Weinberger <richard@nod.at>
>     Signed-off-by: Simon Horman <horms@verge.net.au>
> 

Same with you.

I regenerate one, see below:
---------------------------------------------

From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Date: Mon, 8 Apr 2013 02:05:07 +0800
Subject: [PATCH] kexec, i386: Fix build warning of size_t print

When compile kexec-tools in i386, we got the following warnings:

kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’

This is because the two functions output a size_t value as %ld
when it should be %zd, resulting in this warning.

Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
---
 kexec/kexec-elf-rel.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kexec/kexec-elf-rel.c b/kexec/kexec-elf-rel.c
index 38e34ec..f59140f 100644
--- a/kexec/kexec-elf-rel.c
+++ b/kexec/kexec-elf-rel.c
@@ -513,7 +513,7 @@ void elf_rel_set_symbol(struct mem_ehdr *ehdr,
 			name);
 	}
 	if (sym.st_size != size) {
-		die("Symbol: %s has size: %lld not %ld\n",
+		die("Symbol: %s has size: %lld not %zd\n",
 			name, sym.st_size, size);
 	}
 	shdr = &ehdr->e_shdr[sym.st_shndx];
@@ -537,7 +537,7 @@ void elf_rel_get_symbol(struct mem_ehdr *ehdr,
 		die("Symbol: %s not found cannot get\n", name);
 	}
 	if (sym.st_size != size) {
-		die("Symbol: %s has size: %lld not %ld\n",
+		die("Symbol: %s has size: %lld not %zd\n",
 			name, sym.st_size, size);
 	}
 	shdr = &ehdr->e_shdr[sym.st_shndx];
-- 
1.7.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] kexec, i386: Fix build warning of size_t print
  2013-04-08  2:11       ` Zhang Yanfei
@ 2013-04-08  3:33         ` Simon Horman
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2013-04-08  3:33 UTC (permalink / raw)
  To: Zhang Yanfei; +Cc: kexec@lists.infradead.org, Zhang Yanfei

On Mon, Apr 08, 2013 at 10:11:09AM +0800, Zhang Yanfei wrote:
> 于 2013年04月08日 10:08, Simon Horman 写道:
> > On Mon, Apr 08, 2013 at 09:38:49AM +0800, Zhang Yanfei wrote:
> >> 于 2013年04月08日 09:37, Simon Horman 写道:
> >>> On Sat, Apr 06, 2013 at 01:39:40PM +0800, Zhang Yanfei wrote:
> >>>> From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
> >>>>
> >>>> When compile kexec-tools in i386, we got the following warnings:
> >>>>
> >>>> kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
> >>>> kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
> >>>> kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
> >>>> kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
> >>>>
> >>>> This is because the two functions output a size_t value as %ld
> >>>> when it should be %zd, resulting in this warning.
> >>>
> >>> Thanks,
> >>>
> >>> This change looks good to me, however, the patch does
> >>> not appear to apply on the master branch of the kexec-tools tree.
> >>> Could you rebase and repost it?
> >>
> >> Really? Maybe I made some mistake. Anyway I will regenerate it and
> >> resend it again.
> > 
> > Perhaps I made a mistake ^)
> > 
> > The head commit I have is:
> > 
> > commit 969f3e8c1c534f63b869183ccf292bcaef0e5558
> > Author: Richard Weinberger <richard@nod.at>
> > Date:   Mon Apr 1 13:23:04 2013 +0200
> > 
> >     purgatory: remove arch/i386/timer.c
> >     
> >     This file is nowhere referenced, let's get rid of it.
> >     
> >     Signed-off-by: Richard Weinberger <richard@nod.at>
> >     Signed-off-by: Simon Horman <horms@verge.net.au>
> > 
> 
> Same with you.
> 
> I regenerate one, see below:

Thanks, applied.

> ---------------------------------------------
> 
> From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
> Date: Mon, 8 Apr 2013 02:05:07 +0800
> Subject: [PATCH] kexec, i386: Fix build warning of size_t print
> 
> When compile kexec-tools in i386, we got the following warnings:
> 
> kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
> kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
> kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
> kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
> 
> This is because the two functions output a size_t value as %ld
> when it should be %zd, resulting in this warning.
> 
> Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
> ---
>  kexec/kexec-elf-rel.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kexec/kexec-elf-rel.c b/kexec/kexec-elf-rel.c
> index 38e34ec..f59140f 100644
> --- a/kexec/kexec-elf-rel.c
> +++ b/kexec/kexec-elf-rel.c
> @@ -513,7 +513,7 @@ void elf_rel_set_symbol(struct mem_ehdr *ehdr,
>  			name);
>  	}
>  	if (sym.st_size != size) {
> -		die("Symbol: %s has size: %lld not %ld\n",
> +		die("Symbol: %s has size: %lld not %zd\n",
>  			name, sym.st_size, size);
>  	}
>  	shdr = &ehdr->e_shdr[sym.st_shndx];
> @@ -537,7 +537,7 @@ void elf_rel_get_symbol(struct mem_ehdr *ehdr,
>  		die("Symbol: %s not found cannot get\n", name);
>  	}
>  	if (sym.st_size != size) {
> -		die("Symbol: %s has size: %lld not %ld\n",
> +		die("Symbol: %s has size: %lld not %zd\n",
>  			name, sym.st_size, size);
>  	}
>  	shdr = &ehdr->e_shdr[sym.st_shndx];
> -- 
> 1.7.1
> 
> 

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-08  3:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-06  5:39 [PATCH] kexec, i386: Fix build warning of size_t print Zhang Yanfei
2013-04-08  1:37 ` Simon Horman
2013-04-08  1:38   ` Zhang Yanfei
2013-04-08  2:08     ` Simon Horman
2013-04-08  2:11       ` Zhang Yanfei
2013-04-08  3:33         ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.