Skip to contentSkip to conversation

time_adjust cleared before use

PATCH In review Jim Houston 2 participants 3 messages Oct 26, 2006 Timekeeping, clocksource core, NTP, alarmtimer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 time_adjust cleared before use

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.

--

kernel/time/ntp.c +1 -1
index 47195fa..3afeaa3 100644
@@ -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 on v1 1/1
#1 lore raw

Hi,

Quoted 15 lines · Jim Houston

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.

--

kernel/time/ntp.c +0 -0
index 47195fa..3afeaa3 100644

kernel/time/ntp.c void second_overflow(void) · line 169

Quoted 10 lines
kernel/time/ntp.c +1 -1
@@ -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;
 		}
 	}
 }

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

#2 lore raw
Quoted 6 lines · Roman Zippel
Quoted 3 lines · Jim Houston

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

kernel/time/ntp.c +1 -1
index 47195fa..3afeaa3 100644
@@ -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;
 		}
 	}
 }