* [PATCH] timer.c: Cast time value so that it has the correct type
@ 2010-08-19 14:13 Ian Jackson
2010-08-19 14:37 ` Tim Deegan
0 siblings, 1 reply; 3+ messages in thread
From: Ian Jackson @ 2010-08-19 14:13 UTC (permalink / raw)
To: xen-devel
We'd prefer to avoid PRI macros in xen itself, so instead we cast the
value to long to match the printf format. Without this, the build
fails on some compilers.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
diff -r a05a2d559931 xen/common/timer.c
--- a/xen/common/timer.c Thu Aug 19 14:46:32 2010 +0100
+++ b/xen/common/timer.c Thu Aug 19 15:12:36 2010 +0100
@@ -500,7 +500,7 @@ static void dump_timer(struct timer *t,
static void dump_timer(struct timer *t, s_time_t now)
{
printk(" ex=%8ldus timer=%p cb=%p(%p)",
- (t->expires - now) / 1000, t, t->function, t->data);
+ (long)((t->expires - now) / 1000), t, t->function, t->data);
print_symbol(" %s\n", (unsigned long)t->function);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] timer.c: Cast time value so that it has the correct type
2010-08-19 14:13 [PATCH] timer.c: Cast time value so that it has the correct type Ian Jackson
@ 2010-08-19 14:37 ` Tim Deegan
2010-08-19 14:46 ` Keir Fraser
0 siblings, 1 reply; 3+ messages in thread
From: Tim Deegan @ 2010-08-19 14:37 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel@lists.xensource.com
At 15:13 +0100 on 19 Aug (1282230825), Ian Jackson wrote:
> We'd prefer to avoid PRI macros in xen itself
I don't think we would; we even define a bunch of our own. :)
>, so instead we cast the
> value to long to match the printf format. Without this, the build
> fails on some compilers.
This is the wrong fix; on PAE builds the value will be truncated from 64
bits to 32.
Cheers,
Tim.
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
>
> diff -r a05a2d559931 xen/common/timer.c
> --- a/xen/common/timer.c Thu Aug 19 14:46:32 2010 +0100
> +++ b/xen/common/timer.c Thu Aug 19 15:12:36 2010 +0100
> @@ -500,7 +500,7 @@ static void dump_timer(struct timer *t,
> static void dump_timer(struct timer *t, s_time_t now)
> {
> printk(" ex=%8ldus timer=%p cb=%p(%p)",
> - (t->expires - now) / 1000, t, t->function, t->data);
> + (long)((t->expires - now) / 1000), t, t->function, t->data);
> print_symbol(" %s\n", (unsigned long)t->function);
> }
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
--
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] timer.c: Cast time value so that it has the correct type
2010-08-19 14:37 ` Tim Deegan
@ 2010-08-19 14:46 ` Keir Fraser
0 siblings, 0 replies; 3+ messages in thread
From: Keir Fraser @ 2010-08-19 14:46 UTC (permalink / raw)
To: Tim Deegan, Ian Jackson; +Cc: xen-devel@lists.xensource.com
This is my mistake, I'll do a patch to use the appropriate PRI macro.
-- Keir
On 19/08/2010 15:37, "Tim Deegan" <Tim.Deegan@citrix.com> wrote:
> At 15:13 +0100 on 19 Aug (1282230825), Ian Jackson wrote:
>> We'd prefer to avoid PRI macros in xen itself
>
> I don't think we would; we even define a bunch of our own. :)
>
>> , so instead we cast the
>> value to long to match the printf format. Without this, the build
>> fails on some compilers.
>
> This is the wrong fix; on PAE builds the value will be truncated from 64
> bits to 32.
>
> Cheers,
>
> Tim.
>
>> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
>>
>> diff -r a05a2d559931 xen/common/timer.c
>> --- a/xen/common/timer.c Thu Aug 19 14:46:32 2010 +0100
>> +++ b/xen/common/timer.c Thu Aug 19 15:12:36 2010 +0100
>> @@ -500,7 +500,7 @@ static void dump_timer(struct timer *t,
>> static void dump_timer(struct timer *t, s_time_t now)
>> {
>> printk(" ex=%8ldus timer=%p cb=%p(%p)",
>> - (t->expires - now) / 1000, t, t->function, t->data);
>> + (long)((t->expires - now) / 1000), t, t->function, t->data);
>> print_symbol(" %s\n", (unsigned long)t->function);
>> }
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-08-19 14:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-19 14:13 [PATCH] timer.c: Cast time value so that it has the correct type Ian Jackson
2010-08-19 14:37 ` Tim Deegan
2010-08-19 14:46 ` Keir Fraser
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).