From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752705AbcF3WKV (ORCPT ); Thu, 30 Jun 2016 18:10:21 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34440 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751068AbcF3WKR (ORCPT ); Thu, 30 Jun 2016 18:10:17 -0400 Date: Thu, 30 Jun 2016 22:55:54 +0100 From: Chris Wilson To: Gustavo Padovan , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Daniel Stone , Daniel Vetter , Rob Clark , Greg Hackmann , John Harrison , laurent.pinchart@ideasonboard.com, seanpaul@google.com, marcheu@google.com, m.chehab@samsung.com, Sumit Semwal , Maarten Lankhorst , Gustavo Padovan , Christian =?iso-8859-1?Q?K=F6nig?= Subject: Re: [PATCH 1/2] dma-buf/fence-array: add fence_is_array() Message-ID: <20160630215554.GA28931@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Gustavo Padovan , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Daniel Stone , Daniel Vetter , Rob Clark , Greg Hackmann , John Harrison , laurent.pinchart@ideasonboard.com, seanpaul@google.com, marcheu@google.com, m.chehab@samsung.com, Sumit Semwal , Maarten Lankhorst , Gustavo Padovan , Christian =?iso-8859-1?Q?K=F6nig?= References: <1467295788-6422-1-git-send-email-gustavo@padovan.org> <1467295788-6422-2-git-send-email-gustavo@padovan.org> <20160630142359.GC28577@nuc-i3427.alporthouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160630142359.GC28577@nuc-i3427.alporthouse.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > > > Add helper to check if fence is array. > > > > Cc: Chris Wilson > > Cc: Christian König > > Signed-off-by: Gustavo Padovan > > --- > > 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 Oops, this needs an EXPORT_SYMBOL(fence_array_ops); -Chris -- Chris Wilson, Intel Open Source Technology Centre