public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] time_adjust cleared before use
@ 2006-10-26 15:29 Jim Houston
  2006-10-26 17:22 ` Roman Zippel
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Houston @ 2006-10-26 15:29 UTC (permalink / raw)
  To: Roman Zippel; +Cc: John Stultz, linux-kernel

Hi

I notice that the code which implements adjtime clears
the time_adjust value before using it.  The attached 
patch makes the obvious fix.

Jim Houston - Concurrent Computer Corp.

--

diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 47195fa..3afeaa3 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -161,9 +161,9 @@ void second_overflow(void)
 			time_adjust += MAX_TICKADJ;
 			tick_length -= MAX_TICKADJ_SCALED;
 		} else {
-			time_adjust = 0;
 			tick_length += (s64)(time_adjust * NSEC_PER_USEC /
 					     HZ) << TICK_LENGTH_SHIFT;
+			time_adjust = 0;
 		}
 	}
 }



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

* Re: [PATCH] time_adjust cleared before use
  2006-10-26 15:29 [PATCH] time_adjust cleared before use Jim Houston
@ 2006-10-26 17:22 ` Roman Zippel
  2006-10-26 17:53   ` Jim Houston
  0 siblings, 1 reply; 3+ messages in thread
From: Roman Zippel @ 2006-10-26 17:22 UTC (permalink / raw)
  To: Jim Houston; +Cc: John Stultz, linux-kernel, linux

Hi,

On Thu, 26 Oct 2006, Jim Houston wrote:

> Hi
> 
> I notice that the code which implements adjtime clears
> the time_adjust value before using it.  The attached 
> patch makes the obvious fix.
> 
> Jim Houston - Concurrent Computer Corp.
> 
> --
> 
> diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
> index 47195fa..3afeaa3 100644
> --- a/kernel/time/ntp.c
> +++ b/kernel/time/ntp.c
> @@ -161,9 +161,9 @@ void second_overflow(void)
>  			time_adjust += MAX_TICKADJ;
>  			tick_length -= MAX_TICKADJ_SCALED;
>  		} else {
> -			time_adjust = 0;
>  			tick_length += (s64)(time_adjust * NSEC_PER_USEC /
>  					     HZ) << TICK_LENGTH_SHIFT;
> +			time_adjust = 0;
>  		}
>  	}
>  }

Acked-by: Roman Zippel <zippel@linux-m68k.org>

Thanks, that might also explain the other problem.
Could you please sign it off and then it should go into 2.6.19.

bye, Roman

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

* Re: [PATCH] time_adjust cleared before use
  2006-10-26 17:22 ` Roman Zippel
@ 2006-10-26 17:53   ` Jim Houston
  0 siblings, 0 replies; 3+ messages in thread
From: Jim Houston @ 2006-10-26 17:53 UTC (permalink / raw)
  To: Roman Zippel; +Cc: John Stultz, linux-kernel, linux

On Thu, 2006-10-26 at 19:22 +0200, Roman Zippel wrote:
> On Thu, 26 Oct 2006, Jim Houston wrote:
> > I notice that the code which implements adjtime clears
> > the time_adjust value before using it.  The attached 
> > patch makes the obvious fix.

> Acked-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Jim Houston <jim.houston@ccur.com>

diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 47195fa..3afeaa3 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -161,9 +161,9 @@ void second_overflow(void)
 			time_adjust += MAX_TICKADJ;
 			tick_length -= MAX_TICKADJ_SCALED;
 		} else {
-			time_adjust = 0;
 			tick_length += (s64)(time_adjust * NSEC_PER_USEC /
 					     HZ) << TICK_LENGTH_SHIFT;
+			time_adjust = 0;
 		}
 	}
 }



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

end of thread, other threads:[~2006-10-26 17:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-26 15:29 [PATCH] time_adjust cleared before use Jim Houston
2006-10-26 17:22 ` Roman Zippel
2006-10-26 17:53   ` Jim Houston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox