mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Gustavo Padovan <gustavo@padovan.org>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	"Daniel Stone" <daniels@collabora.com>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Rob Clark" <robdclark@gmail.com>,
	"Greg Hackmann" <ghackmann@google.com>,
	"John Harrison" <John.C.Harrison@Intel.com>,
	laurent.pinchart@ideasonboard.com, seanpaul@google.com,
	marcheu@google.com, m.chehab@samsung.com,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Gustavo Padovan" <gustavo.padovan@collabora.co.uk>,
	"Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH v2 2/4] dma-buf/sync_file: rework fence storage in struct file
Date: Fri, 1 Jul 2016 14:19:59 +0100	[thread overview]
Message-ID: <20160701131959.GD1306@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <1467378307-28088-3-git-send-email-gustavo@padovan.org>

On Fri, Jul 01, 2016 at 10:05:05AM -0300, Gustavo Padovan wrote:
> @@ -333,16 +384,16 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
>  	if (!info.num_fences)
>  		goto no_fences;
>  
> -	if (info.num_fences < sync_file->num_fences)
> +	if (info.num_fences < num_fences)
>  		return -EINVAL;
>  
> -	size = sync_file->num_fences * sizeof(*fence_info);
> +	size = num_fences * sizeof(*fence_info);
>  	fence_info = kzalloc(size, GFP_KERNEL);

Does size get used elsewhere? Otherwise it would be safer to reduce this
to kcalloc(num_fences, sizeof(*fence_info), GFP_KERNEL)

>  	if (!fence_info)
>  		return -ENOMEM;
>  

> diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c
> index 5f57499..0638a06 100644
> --- a/drivers/staging/android/sync_debug.c
> +++ b/drivers/staging/android/sync_debug.c
> @@ -159,10 +159,15 @@ static void sync_print_sync_file(struct seq_file *s,
>  	int i;
>  
>  	seq_printf(s, "[%p] %s: %s\n", sync_file, sync_file->name,
> -		   sync_status_str(atomic_read(&sync_file->status)));
> -
> -	for (i = 0; i < sync_file->num_fences; ++i)
> -		sync_print_fence(s, sync_file->cbs[i].fence, true);
> +		   sync_status_str(!fence_is_signaled(sync_file->fence)));
> +
> +	if (fence_is_array(sync_file->fence)) {
> +		struct fence_array *array = to_fence_array(sync_file->fence);

checkpatch will complain about the missing line between decl and code
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2016-07-01 13:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-01 13:05 [PATCH v2 0/4] dma-buf/sync_file: rework fences on struct sync_file Gustavo Padovan
2016-07-01 13:05 ` [PATCH v2 1/4] dma-buf/fence-array: add fence_is_array() Gustavo Padovan
2016-07-01 13:05 ` [PATCH v2 2/4] dma-buf/sync_file: rework fence storage in struct file Gustavo Padovan
2016-07-01 13:19   ` Chris Wilson [this message]
2016-07-01 13:05 ` [PATCH v2 3/4] dma-buf/sync_file: add sync_file_get_fence() Gustavo Padovan
2016-07-01 13:21   ` Chris Wilson
2016-07-01 13:05 ` [PATCH v2 4/4] Documentation: add doc for sync_file_get_fence() Gustavo Padovan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160701131959.GD1306@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=John.C.Harrison@Intel.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniels@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ghackmann@google.com \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=gustavo@padovan.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marcheu@google.com \
    --cc=robdclark@gmail.com \
    --cc=seanpaul@google.com \
    --cc=sumit.semwal@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®