Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/linux Preserve signedness to return fa...



details:   https://anonhg.NetBSD.org/src/rev/012aad6063d8
branches:  trunk
changeset: 835670:012aad6063d8
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Sep 03 18:02:11 2018 +0000

description:
Preserve signedness to return failure from fence_wait_timeout.

>From mrg@.

diffstat:

 sys/external/bsd/drm2/linux/linux_reservation.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r 34728b4a7f65 -r 012aad6063d8 sys/external/bsd/drm2/linux/linux_reservation.c
--- a/sys/external/bsd/drm2/linux/linux_reservation.c   Mon Sep 03 16:55:17 2018 +0000
+++ b/sys/external/bsd/drm2/linux/linux_reservation.c   Mon Sep 03 18:02:11 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_reservation.c,v 1.10 2018/08/27 15:28:27 riastradh Exp $ */
+/*     $NetBSD: linux_reservation.c,v 1.11 2018/09/03 18:02:11 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.10 2018/08/27 15:28:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.11 2018/09/03 18:02:11 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/poll.h>
@@ -711,6 +711,7 @@
        struct reservation_object_list *list;
        struct fence *fence;
        uint32_t i, shared_count;
+       long ret;
 
        if (timeout == 0)
                return reservation_object_test_signaled_rcu(robj, shared);
@@ -792,9 +793,11 @@
         */
        KASSERT(fence != NULL);
        rcu_read_unlock();
-       timeout = fence_wait_timeout(fence, intr, timeout);
-       if (timeout <= 0)
-               return timeout;
+       ret = fence_wait_timeout(fence, intr, timeout);
+       if (ret <= 0)
+               return ret;
+       KASSERT(ret <= timeout);
+       timeout = ret;
        goto top;
 }
 



Home | Main Index | Thread Index | Old Index