提交 e1aaf311 编写于 作者: G Gustavo Padovan 提交者: Sumit Semwal

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: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: NChristian König <christian.koenig@amd.com>
Signed-off-by: NSumit Semwal <sumit.semwal@linaro.org>
上级 9622c38f
......@@ -99,6 +99,7 @@ const struct fence_ops fence_array_ops = {
.wait = fence_default_wait,
.release = fence_array_release,
};
EXPORT_SYMBOL(fence_array_ops);
/**
* fence_array_create - Create a custom fence array
......
......@@ -51,6 +51,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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册