diff mbox

[RFC,v2,1/3] dma-buf/fence-array: add fence_is_array()

Message ID 1467055762-25881-2-git-send-email-gustavo@padovan.org (mailing list archive)
State New, archived
Headers show

Commit Message

Gustavo Padovan June 27, 2016, 7:29 p.m. UTC
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Add helper to check if fence is array.

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>
---
 include/linux/fence-array.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox

Patch

diff --git a/include/linux/fence-array.h b/include/linux/fence-array.h
index 86baaa4..d2e9f40 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) ? true : false;
+}
+
+/**
  * to_fence_array - cast a fence to a fence_array
  * @fence: fence to cast to a fence_array
  *