Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1434619 > unrolled thread
| Started by | Gustavo Padovan <gustavo@padovan.org> |
|---|---|
| First post | 2016-06-30 16:30 +0200 |
| Last post | 2016-07-01 00:20 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 1/2] dma-buf/fence-array: add fence_is_array() Gustavo Padovan <gustavo@padovan.org> - 2016-06-30 16:30 +0200
Re: [PATCH 1/2] dma-buf/fence-array: add fence_is_array() Chris Wilson <chris@chris-wilson.co.uk> - 2016-06-30 16:30 +0200
Re: [PATCH 1/2] dma-buf/fence-array: add fence_is_array() Chris Wilson <chris@chris-wilson.co.uk> - 2016-07-01 00:20 +0200
| From | Gustavo Padovan <gustavo@padovan.org> |
|---|---|
| Date | 2016-06-30 16:30 +0200 |
| Subject | [PATCH 1/2] dma-buf/fence-array: add fence_is_array() |
| Message-ID | <rPL8B-2eN-13@gated-at.bofh.it> |
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 --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
*
--
2.5.5
[toc] | [next] | [standalone]
| From | Chris Wilson <chris@chris-wilson.co.uk> |
|---|---|
| Date | 2016-06-30 16:30 +0200 |
| Message-ID | <rPL8C-2eN-27@gated-at.bofh.it> |
| In reply to | #1434619 |
On Thu, Jun 30, 2016 at 11:09:47AM -0300, Gustavo Padovan wrote:
> 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 --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;
Just return fence->ops == &fence_array_ops; It's a logical operation, it
is already a boolean. With that,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
[toc] | [prev] | [next] | [standalone]
| From | Chris Wilson <chris@chris-wilson.co.uk> |
|---|---|
| Date | 2016-07-01 00:20 +0200 |
| Message-ID | <rPSts-6J4-31@gated-at.bofh.it> |
| In reply to | #1434620 |
On Thu, Jun 30, 2016 at 03:23:59PM +0100, Chris Wilson wrote:
> On Thu, Jun 30, 2016 at 11:09:47AM -0300, Gustavo Padovan wrote:
> > 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 --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;
>
> Just return fence->ops == &fence_array_ops; It's a logical operation, it
> is already a boolean. With that,
>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Oops, this needs an EXPORT_SYMBOL(fence_array_ops);
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web