aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma-buf/sync_file.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-01-04 14:12:21 +0000
committerSumit Semwal <sumit.semwal@linaro.org>2017-01-09 20:06:58 +0530
commitd6c99f4bf093a58d3ab47caaec74b81f18bc4e3f (patch)
tree246eff35230c79ce6560cf7fe23ce453a6ed62bb /drivers/dma-buf/sync_file.c
parentdma-fence: Clear fence->status during dma_fence_init() (diff)
downloadlinux-dev-d6c99f4bf093a58d3ab47caaec74b81f18bc4e3f.tar.xz
linux-dev-d6c99f4bf093a58d3ab47caaec74b81f18bc4e3f.zip
dma-fence: Wrap querying the fence->status
The fence->status is an optional field that is only valid once the fence has been signaled. (Driver may fill the fence->status with an error code prior to calling dma_fence_signal().) Given the restriction upon its validity, wrap querying of the fence->status into a helper dma_fence_get_status(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170104141222.6992-2-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/dma-buf/sync_file.c')
-rw-r--r--drivers/dma-buf/sync_file.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index 07cb9b908f30..2321035f6204 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -373,10 +373,8 @@ static void sync_fill_fence_info(struct dma_fence *fence,
sizeof(info->obj_name));
strlcpy(info->driver_name, fence->ops->get_driver_name(fence),
sizeof(info->driver_name));
- if (dma_fence_is_signaled(fence))
- info->status = fence->status >= 0 ? 1 : fence->status;
- else
- info->status = 0;
+
+ info->status = dma_fence_get_status(fence);
info->timestamp_ns = ktime_to_ns(fence->timestamp);
}