summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>2016-08-05 10:39:34 -0300
committerSumit Semwal <sumit.semwal@linaro.org>2016-08-11 15:33:23 +0530
commite1aaf311dbe82221910cc0e0809c988de210cc3c (patch)
tree942432e8bdf1eed9f9cdaca00711604f571c9d8f /include/linux
parent9622c38f1cbab00aa2f52715ec950c5c5f838aa5 (diff)
downloadlinux-stable-e1aaf311dbe82221910cc0e0809c988de210cc3c.tar.gz
linux-stable-e1aaf311dbe82221910cc0e0809c988de210cc3c.tar.bz2
linux-stable-e1aaf311dbe82221910cc0e0809c988de210cc3c.zip
dma-buf/fence-array: add fence_is_array()
Add helper to check if fence is array. v2: Comments from Chris Wilson - remove ternary if from ops comparison - add EXPORT_SYMBOL(fence_array_ops) Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Christian König <christian.koenig@amd.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fence-array.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/fence-array.h b/include/linux/fence-array.h
index 86baaa45567c..a44794e508df 100644
--- a/include/linux/fence-array.h
+++ b/include/linux/fence-array.h
@@ -52,6 +52,16 @@ struct fence_array {
extern const struct fence_ops fence_array_ops;
/**
+ * fence_is_array - check if a fence is from the array subsclass
+ *
+ * Return true if it is a fence_array and false otherwise.
+ */
+static inline bool fence_is_array(struct fence *fence)
+{
+ return fence->ops == &fence_array_ops;
+}
+
+/**
* to_fence_array - cast a fence to a fence_array
* @fence: fence to cast to a fence_array
*