All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] timer_list should use signed numbers for relative times
@ 2007-11-27 12:44 Pavel Machek
  2007-11-27 12:59 ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2007-11-27 12:44 UTC (permalink / raw)
  To: Thomas Gleixner, kernel list, Ingo Molnar, Andrew Morton

Relative times are signed by nature, and timers can (briefly) have
expires in past. Print them as negative numbers.

Signed-off-by: Pavel Machek <pavel@suse.cz>

diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index 12c5f4c..7f6eaa9 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -65,7 +65,7 @@ #ifdef CONFIG_TIMER_STATS
 	SEQ_printf(m, ", %s/%d", tmp, timer->start_pid);
 #endif
 	SEQ_printf(m, "\n");
-	SEQ_printf(m, " # expires at %Lu nsecs [in %Lu nsecs]\n",
+	SEQ_printf(m, " # expires at %Lu nsecs [in %Ld nsecs]\n",
 		(unsigned long long)ktime_to_ns(timer->expires),
 		(unsigned long long)(ktime_to_ns(timer->expires) - now));
 }

 


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [patch] timer_list should use signed numbers for relative times
  2007-11-27 12:44 [patch] timer_list should use signed numbers for relative times Pavel Machek
@ 2007-11-27 12:59 ` Andreas Schwab
  2007-11-27 14:08   ` Pavel Machek
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2007-11-27 12:59 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Thomas Gleixner, kernel list, Ingo Molnar, Andrew Morton

Pavel Machek <pavel@ucw.cz> writes:

> Relative times are signed by nature, and timers can (briefly) have
> expires in past. Print them as negative numbers.
>
> Signed-off-by: Pavel Machek <pavel@suse.cz>
>
> diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
> index 12c5f4c..7f6eaa9 100644
> --- a/kernel/time/timer_list.c
> +++ b/kernel/time/timer_list.c
> @@ -65,7 +65,7 @@ #ifdef CONFIG_TIMER_STATS
>  	SEQ_printf(m, ", %s/%d", tmp, timer->start_pid);
>  #endif
>  	SEQ_printf(m, "\n");
> -	SEQ_printf(m, " # expires at %Lu nsecs [in %Lu nsecs]\n",
> +	SEQ_printf(m, " # expires at %Lu nsecs [in %Ld nsecs]\n",
>  		(unsigned long long)ktime_to_ns(timer->expires),
>  		(unsigned long long)(ktime_to_ns(timer->expires) - now));

Perhaps change the cast as well.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [patch] timer_list should use signed numbers for relative times
  2007-11-27 12:59 ` Andreas Schwab
@ 2007-11-27 14:08   ` Pavel Machek
  2007-11-27 14:19     ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2007-11-27 14:08 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Thomas Gleixner, kernel list, Ingo Molnar, Andrew Morton

Hi!


> > Relative times are signed by nature, and timers can (briefly) have
> > expires in past. Print them as negative numbers.
> >
> > Signed-off-by: Pavel Machek <pavel@suse.cz>
> >
> > diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
> > index 12c5f4c..7f6eaa9 100644
> > --- a/kernel/time/timer_list.c
> > +++ b/kernel/time/timer_list.c
> > @@ -65,7 +65,7 @@ #ifdef CONFIG_TIMER_STATS
> >  	SEQ_printf(m, ", %s/%d", tmp, timer->start_pid);
> >  #endif
> >  	SEQ_printf(m, "\n");
> > -	SEQ_printf(m, " # expires at %Lu nsecs [in %Lu nsecs]\n",
> > +	SEQ_printf(m, " # expires at %Lu nsecs [in %Ld nsecs]\n",
> >  		(unsigned long long)ktime_to_ns(timer->expires),
> >  		(unsigned long long)(ktime_to_ns(timer->expires) - now));
> 
> Perhaps change the cast as well.

Well, that seems to be absolute time, so %Lu makes some sense...
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [patch] timer_list should use signed numbers for relative times
  2007-11-27 14:08   ` Pavel Machek
@ 2007-11-27 14:19     ` Andreas Schwab
  2007-11-27 14:35       ` Pavel Machek
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2007-11-27 14:19 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Thomas Gleixner, kernel list, Ingo Molnar, Andrew Morton

Pavel Machek <pavel@ucw.cz> writes:

> Hi!
>
>
>> > Relative times are signed by nature, and timers can (briefly) have
>> > expires in past. Print them as negative numbers.
>> >
>> > Signed-off-by: Pavel Machek <pavel@suse.cz>
>> >
>> > diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
>> > index 12c5f4c..7f6eaa9 100644
>> > --- a/kernel/time/timer_list.c
>> > +++ b/kernel/time/timer_list.c
>> > @@ -65,7 +65,7 @@ #ifdef CONFIG_TIMER_STATS
>> >  	SEQ_printf(m, ", %s/%d", tmp, timer->start_pid);
>> >  #endif
>> >  	SEQ_printf(m, "\n");
>> > -	SEQ_printf(m, " # expires at %Lu nsecs [in %Lu nsecs]\n",
>> > +	SEQ_printf(m, " # expires at %Lu nsecs [in %Ld nsecs]\n",
>> >  		(unsigned long long)ktime_to_ns(timer->expires),
>> >  		(unsigned long long)(ktime_to_ns(timer->expires) - now));
>> 
>> Perhaps change the cast as well.
>
> Well, that seems to be absolute time, so %Lu makes some sense...

I don't understand what this has to do with the cast.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [patch] timer_list should use signed numbers for relative times
  2007-11-27 14:19     ` Andreas Schwab
@ 2007-11-27 14:35       ` Pavel Machek
  0 siblings, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2007-11-27 14:35 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Thomas Gleixner, kernel list, Ingo Molnar, Andrew Morton

On Tue 2007-11-27 15:19:27, Andreas Schwab wrote:
> Pavel Machek <pavel@ucw.cz> writes:
> 
> > Hi!
> >
> >
> >> > Relative times are signed by nature, and timers can (briefly) have
> >> > expires in past. Print them as negative numbers.
> >> >
> >> > Signed-off-by: Pavel Machek <pavel@suse.cz>
> >> >
> >> > diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
> >> > index 12c5f4c..7f6eaa9 100644
> >> > --- a/kernel/time/timer_list.c
> >> > +++ b/kernel/time/timer_list.c
> >> > @@ -65,7 +65,7 @@ #ifdef CONFIG_TIMER_STATS
> >> >  	SEQ_printf(m, ", %s/%d", tmp, timer->start_pid);
> >> >  #endif
> >> >  	SEQ_printf(m, "\n");
> >> > -	SEQ_printf(m, " # expires at %Lu nsecs [in %Lu nsecs]\n",
> >> > +	SEQ_printf(m, " # expires at %Lu nsecs [in %Ld nsecs]\n",
> >> >  		(unsigned long long)ktime_to_ns(timer->expires),
> >> >  		(unsigned long long)(ktime_to_ns(timer->expires) - now));
> >> 
> >> Perhaps change the cast as well.
> >
> > Well, that seems to be absolute time, so %Lu makes some sense...
> 
> I don't understand what this has to do with the cast.

Aha, stupid me, yes, you are right, fixed.
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

end of thread, other threads:[~2007-11-27 14:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-27 12:44 [patch] timer_list should use signed numbers for relative times Pavel Machek
2007-11-27 12:59 ` Andreas Schwab
2007-11-27 14:08   ` Pavel Machek
2007-11-27 14:19     ` Andreas Schwab
2007-11-27 14:35       ` Pavel Machek

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.