summaryrefslogtreecommitdiffstats
path: root/drivers/dma-buf
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-06-29 08:59:28 -0400
committerGustavo Padovan <gustavo.padovan@collabora.com>2017-06-29 17:52:34 -0400
commit3b52ce44e720c240afc4c4b03140d7b7811b23bd (patch)
tree0f718c53cb9d6eab201f7847b74d18832c15e553 /drivers/dma-buf
parenta6aa8fca4d792c72947e341d7842d2f700534335 (diff)
dma-buf/sw-sync: sync_pt is private and of fixed size
Since sync_pt is only allocated from a single location and is no longer the base class for fences (that is struct dma_fence) it no longer needs a generic unsized allocator. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: Sean Paul <seanpaul@chromium.org> Cc: Gustavo Padovan <gustavo@padovan.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170629125930.821-5-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/dma-buf')
-rw-r--r--drivers/dma-buf/sw_sync.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c
index fc733621987d..6effa1ce010e 100644
--- a/drivers/dma-buf/sw_sync.c
+++ b/drivers/dma-buf/sw_sync.c
@@ -155,7 +155,6 @@ static void sync_timeline_signal(struct sync_timeline *obj, unsigned int inc)
155/** 155/**
156 * sync_pt_create() - creates a sync pt 156 * sync_pt_create() - creates a sync pt
157 * @parent: fence's parent sync_timeline 157 * @parent: fence's parent sync_timeline
158 * @size: size to allocate for this pt
159 * @inc: value of the fence 158 * @inc: value of the fence
160 * 159 *
161 * Creates a new sync_pt as a child of @parent. @size bytes will be 160 * Creates a new sync_pt as a child of @parent. @size bytes will be
@@ -163,15 +162,12 @@ static void sync_timeline_signal(struct sync_timeline *obj, unsigned int inc)
163 * the generic sync_timeline struct. Returns the sync_pt object or 162 * the generic sync_timeline struct. Returns the sync_pt object or
164 * NULL in case of error. 163 * NULL in case of error.
165 */ 164 */
166static struct sync_pt *sync_pt_create(struct sync_timeline *obj, int size, 165static struct sync_pt *sync_pt_create(struct sync_timeline *obj,
167 unsigned int value) 166 unsigned int value)
168{ 167{
169 struct sync_pt *pt; 168 struct sync_pt *pt;
170 169
171 if (size < sizeof(*pt)) 170 pt = kzalloc(sizeof(*pt), GFP_KERNEL);
172 return NULL;
173
174 pt = kzalloc(size, GFP_KERNEL);
175 if (!pt) 171 if (!pt)
176 return NULL; 172 return NULL;
177 173
@@ -312,7 +308,7 @@ static long sw_sync_ioctl_create_fence(struct sync_timeline *obj,
312 goto err; 308 goto err;
313 } 309 }
314 310
315 pt = sync_pt_create(obj, sizeof(*pt), data.value); 311 pt = sync_pt_create(obj, data.value);
316 if (!pt) { 312 if (!pt) {
317 err = -ENOMEM; 313 err = -ENOMEM;
318 goto err; 314 goto err;