[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [xen-tip:for-linus-4.5 12/12] arch/x86/xen/time.c:170:12: error: incompatible types when assigning to type 'struct timespec' from type 'struct timespec64'



On Tue, 24 Nov 2015, kbuild test robot wrote:
    arch/x86/xen/time.c: In function 'xen_pvclock_gtod_notify':
> >> arch/x86/xen/time.c:139:35: warning: passing argument 1 of 
> >> 'timespec_compare' from incompatible pointer type 
> >> [-Wincompatible-pointer-types]
>      if (!was_set && timespec_compare(&now, &next_sync) < 0)
>                                       ^
>    In file included from include/linux/ktime.h:24:0,
>                     from include/linux/timer.h:5,
>                     from include/linux/workqueue.h:8,
>                     from include/linux/pm.h:25,
>                     from arch/x86/include/asm/apic.h:5,
>                     from arch/x86/include/asm/smp.h:12,
>                     from include/linux/smp.h:59,
>                     from include/linux/percpu.h:6,
>                     from include/linux/context_tracking_state.h:4,
>                     from include/linux/vtime.h:4,
>                     from include/linux/hardirq.h:7,
>                     from include/linux/interrupt.h:12,
>                     from arch/x86/xen/time.c:11:
>    include/linux/time.h:24:19: note: expected 'const struct timespec *' but 
> argument is of type 'struct timespec64 *'
>     static inline int timespec_compare(const struct timespec *lhs, const 
> struct timespec *rhs)
>                       ^
> >> arch/x86/xen/time.c:170:12: error: incompatible types when assigning to 
> >> type 'struct timespec' from type 'struct timespec64'
>      next_sync = now;

This robot is awesome

The appended patch fixes the issue. Boris, if you are OK with it, I'll
queue it up on for-linus-4.5.

---

xen/x86: convert remaining timespec to timespec64 in xen_pvclock_gtod_notify

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index 4b8af45..a0a4e55 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -121,7 +121,7 @@ static int xen_pvclock_gtod_notify(struct notifier_block 
*nb,
                                   unsigned long was_set, void *priv)
 {
        /* Protected by the calling core code serialization */
-       static struct timespec next_sync;
+       static struct timespec64 next_sync;
 
        struct xen_platform_op op;
        struct timespec64 now;
@@ -136,7 +136,7 @@ static int xen_pvclock_gtod_notify(struct notifier_block 
*nb,
         * We only take the expensive HV call when the clock was set
         * or when the 11 minutes RTC synchronization time elapsed.
         */
-       if (!was_set && timespec_compare(&now, &next_sync) < 0)
+       if (!was_set && timespec64_compare(&now, &next_sync) < 0)
                return NOTIFY_OK;
 
 again:



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.