* [PATCH] Fix parse_size_and_unit() breakage in xen-3.0.4-testing (kdump broken)
@ 2007-01-10 8:42 Magnus Damm
2007-01-10 9:24 ` Ian Campbell
2007-01-10 11:35 ` Steven Hand
0 siblings, 2 replies; 4+ messages in thread
From: Magnus Damm @ 2007-01-10 8:42 UTC (permalink / raw)
To: Ian Campbell; +Cc: Christoph Egger, xen-devel, Magnus Damm, Hiromichi Itou
Fix parse_size_and_unit() breakage in xen-3.0.4-testing (kdump broken)
Kdump has been broken since xen-3.0.4-testing.hg-13109.
Many thanks to Hiromichi Itou for tracking this down.
Signed-Off-By: Magnus Damm <magnus@valinux.co.jp>
---
Applies to xen-3.0.4-testing-13130.
--- 0001/xen/common/lib.c
+++ work/xen/common/lib.c 2007-01-10 11:18:38.000000000 +0900
@@ -442,7 +442,7 @@ s64 __moddi3(s64 a, s64 b)
unsigned long long parse_size_and_unit(const char *s, const char **ps)
{
unsigned long long ret;
- const char *s1;
+ const char *s1 = NULL;
ret = simple_strtoull(s, &s1, 0);
@@ -454,7 +454,7 @@ unsigned long long parse_size_and_unit(c
case 'K': case 'k':
ret <<= 10;
case 'B': case 'b':
- s++;
+ s1++;
break;
default:
ret <<= 10; /* default to kB */
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Fix parse_size_and_unit() breakage in xen-3.0.4-testing (kdump broken)
2007-01-10 8:42 [PATCH] Fix parse_size_and_unit() breakage in xen-3.0.4-testing (kdump broken) Magnus Damm
@ 2007-01-10 9:24 ` Ian Campbell
2007-01-11 1:25 ` Magnus Damm
2007-01-10 11:35 ` Steven Hand
1 sibling, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2007-01-10 9:24 UTC (permalink / raw)
To: Magnus Damm; +Cc: Christoph Egger, xen-devel, Hiromichi Itou
On Wed, 2007-01-10 at 17:42 +0900, Magnus Damm wrote:
> Fix parse_size_and_unit() breakage in xen-3.0.4-testing (kdump broken)
>
> Kdump has been broken since xen-3.0.4-testing.hg-13109.
> Many thanks to Hiromichi Itou for tracking this down.
>
> Signed-Off-By: Magnus Damm <magnus@valinux.co.jp>
I applied a similar fix to xen-unstable.hg in 13282:9865145e53eb. I'll
get it pulled into xen-3.0.4-testing.hg.
> --- 0001/xen/common/lib.c
> +++ work/xen/common/lib.c 2007-01-10 11:18:38.000000000 +0900
> @@ -442,7 +442,7 @@ s64 __moddi3(s64 a, s64 b)
> unsigned long long parse_size_and_unit(const char *s, const char **ps)
> {
> unsigned long long ret;
> - const char *s1;
> + const char *s1 = NULL;
>
> ret = simple_strtoull(s, &s1, 0);
Are you sure this bit is necessary? simple_strtoull always initialises
&s1.
Ian.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Re: [PATCH] Fix parse_size_and_unit() breakage in xen-3.0.4-testing (kdump broken)
2007-01-10 9:24 ` Ian Campbell
@ 2007-01-11 1:25 ` Magnus Damm
0 siblings, 0 replies; 4+ messages in thread
From: Magnus Damm @ 2007-01-11 1:25 UTC (permalink / raw)
To: Ian Campbell; +Cc: Magnus Damm, xen-devel, Christoph Egger, Hiromichi Itou
On 1/10/07, Ian Campbell <Ian.Campbell@xensource.com> wrote:
> On Wed, 2007-01-10 at 17:42 +0900, Magnus Damm wrote:
> > Fix parse_size_and_unit() breakage in xen-3.0.4-testing (kdump broken)
> >
> > Kdump has been broken since xen-3.0.4-testing.hg-13109.
> > Many thanks to Hiromichi Itou for tracking this down.
> >
> > Signed-Off-By: Magnus Damm <magnus@valinux.co.jp>
>
> I applied a similar fix to xen-unstable.hg in 13282:9865145e53eb. I'll
> get it pulled into xen-3.0.4-testing.hg.
Great, thanks.
> > --- 0001/xen/common/lib.c
> > +++ work/xen/common/lib.c 2007-01-10 11:18:38.000000000 +0900
> > @@ -442,7 +442,7 @@ s64 __moddi3(s64 a, s64 b)
> > unsigned long long parse_size_and_unit(const char *s, const char **ps)
> > {
> > unsigned long long ret;
> > - const char *s1;
> > + const char *s1 = NULL;
> >
> > ret = simple_strtoull(s, &s1, 0);
>
> Are you sure this bit is necessary? simple_strtoull always initialises
> &s1.
Probably no, but the reason why I put it there is that we would be
sure to crash if someone happened to change simple_strtoull(). If
simple_strtoull() would forget to write s1 then today we may get
silent errors where switch (*s1) is used on an uninitialized variable.
/ magnus
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix parse_size_and_unit() breakage in xen-3.0.4-testing (kdump broken)
2007-01-10 8:42 [PATCH] Fix parse_size_and_unit() breakage in xen-3.0.4-testing (kdump broken) Magnus Damm
2007-01-10 9:24 ` Ian Campbell
@ 2007-01-10 11:35 ` Steven Hand
1 sibling, 0 replies; 4+ messages in thread
From: Steven Hand @ 2007-01-10 11:35 UTC (permalink / raw)
To: Magnus Damm
Cc: Christoph Egger, xen-devel, Steven.Hand, Hiromichi Itou,
Ian Campbell
>Fix parse_size_and_unit() breakage in xen-3.0.4-testing (kdump broken)
>
>Kdump has been broken since xen-3.0.4-testing.hg-13109.
>Many thanks to Hiromichi Itou for tracking this down.
>
>Signed-Off-By: Magnus Damm <magnus@valinux.co.jp>
>
>---
>
>Applies to xen-3.0.4-testing-13130.
Applied (second hunk only to minimize diff w/ -unstable).
thanks,
S.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-01-11 1:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-10 8:42 [PATCH] Fix parse_size_and_unit() breakage in xen-3.0.4-testing (kdump broken) Magnus Damm
2007-01-10 9:24 ` Ian Campbell
2007-01-11 1:25 ` Magnus Damm
2007-01-10 11:35 ` Steven Hand
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.