lkml.org 
[lkml]   [2008]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectResend: [Patch 1/1] kernel/time/ntp.c : fix warning
Mailer spoilt the previous send... just realized that copy does'nt
work, sorry for that
Hello,

On compiling on a Xeon machine i get the following warning

kernel/time/ntp.c: In function `do_adjtimex':
kernel/time/ntp.c:328: warning: comparison of distinct pointer types
lacks a cast
kernel/time/ntp.c:329: warning: comparison of distinct pointer types
lacks a cast

This is with gcc version 3.4.3. The following patch fixes this...

--- linux-2.6.25/kernel/time/ntp.c.orig 2008-05-03 04:27:20.000000000 +0530
+++ linux-2.6.25/kernel/time/ntp.c 2008-05-03 04:45:06.000000000 +0530
@@ -325,8 +325,8 @@ int do_adjtimex(struct timex *txc)
* Scale the phase adjustment and
* clamp to the operating range.
*/
- time_offset = min(time_offset, (s64)MAXPHASE * NSEC_PER_USEC);
- time_offset = max(time_offset, (s64)-MAXPHASE * NSEC_PER_USEC);
+ time_offset = min(time_offset, (s64)(MAXPHASE * NSEC_PER_USEC));
+ time_offset = max(time_offset, (s64)(-MAXPHASE * NSEC_PER_USEC));

/*
* Select whether the frequency is to be controlled

\
 
 \ /
  Last update: 2008-05-03 07:11    [W:0.027 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site