Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1318962
| From | Gustavo Padovan <gustavo@padovan.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 03/11] staging/android: remove .fill_driver_data() timeline ops |
| Date | 2016-01-27 14:40 +0100 |
| Message-ID | <qVyuh-49M-67@gated-at.bofh.it> (permalink) |
| References | <qVyue-49M-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
The .fill_driver_data() ops was just a useless abstraction for
fence_ops op of the same name.
Now that we use fence->seqno to store the value it is cleaner to
remove the abstraction and fill the data directly.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
drivers/staging/android/sw_sync.c | 14 --------------
drivers/staging/android/sync.c | 9 +++++----
drivers/staging/android/sync.h | 7 -------
3 files changed, 5 insertions(+), 25 deletions(-)
diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c
index b9d53d3..428e22c 100644
--- a/drivers/staging/android/sw_sync.c
+++ b/drivers/staging/android/sw_sync.c
@@ -38,19 +38,6 @@ struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value)
}
EXPORT_SYMBOL(sw_sync_pt_create);
-static int sw_sync_fill_driver_data(struct fence *fence,
- void *data, int size)
-{
- struct sw_sync_pt *pt = (struct sw_sync_pt *)fence;
-
- if (size < sizeof(pt->value))
- return -ENOMEM;
-
- memcpy(data, &pt->value, sizeof(pt->value));
-
- return sizeof(pt->value);
-}
-
static void sw_sync_timeline_value_str(struct sync_timeline *sync_timeline,
char *str, int size)
{
@@ -68,7 +55,6 @@ static void sw_sync_fence_value_str(struct fence *fence, char *str, int size)
static struct sync_timeline_ops sw_sync_timeline_ops = {
.driver_name = "sw_sync",
- .fill_driver_data = sw_sync_fill_driver_data,
.timeline_value_str = sw_sync_timeline_value_str,
.fence_value_str = sw_sync_fence_value_str,
};
diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index 4eea5c3..39af5fb 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -185,11 +185,12 @@ static bool android_fence_enable_signaling(struct fence *fence)
static int android_fence_fill_driver_data(struct fence *fence,
void *data, int size)
{
- struct sync_timeline *parent = fence_parent(fence);
+ if (size < sizeof(fence->seqno))
+ return -ENOMEM;
+
+ memcpy(data, &fence->seqno, sizeof(fence->seqno));
- if (!parent->ops->fill_driver_data)
- return 0;
- return parent->ops->fill_driver_data(fence, data, size);
+ return sizeof(fence->seqno);
}
static void android_fence_value_str(struct fence *fence,
diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h
index 4d3dfbf..500838b 100644
--- a/drivers/staging/android/sync.h
+++ b/drivers/staging/android/sync.h
@@ -27,10 +27,6 @@ struct sync_timeline;
/**
* struct sync_timeline_ops - sync object implementation ops
* @driver_name: name of the implementation
- * @fill_driver_data: write implementation specific driver data to data.
- * should return an error if there is not enough room
- * as specified by size. This information is returned
- * to userspace by SYNC_IOC_FENCE_INFO.
* @timeline_value_str: fill str with the value of the sync_timeline's counter
* @fence_value_str: fill str with the value of the fence
*/
@@ -38,9 +34,6 @@ struct sync_timeline_ops {
const char *driver_name;
/* optional */
- int (*fill_driver_data)(struct fence *fence, void *data, int size);
-
- /* optional */
void (*timeline_value_str)(struct sync_timeline *timeline, char *str,
int size);
--
2.5.0
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2 00/11] sync framework de-staging: part 2 - de-stage Gustavo Padovan <gustavo@padovan.org> - 2016-01-27 14:40 +0100 [PATCH v2 08/11] staging/android: rename android_fence to timeline_fence Gustavo Padovan <gustavo@padovan.org> - 2016-01-27 14:40 +0100 [PATCH v2 09/11] dma-buf/sync_timeline: de-stage sync_timeline Gustavo Padovan <gustavo@padovan.org> - 2016-01-27 14:40 +0100 [PATCH v2 10/11] dma-buf/sync_file: bring debug back to sync file Gustavo Padovan <gustavo@padovan.org> - 2016-01-27 14:40 +0100 [PATCH v2 02/11] staging/android: store last signaled value on sync timeline Gustavo Padovan <gustavo@padovan.org> - 2016-01-27 14:40 +0100 [PATCH v2 06/11] staging/android: remove sw_sync_timeline and sw_sync_pt Gustavo Padovan <gustavo@padovan.org> - 2016-01-27 14:40 +0100 [PATCH v2 05/11] staging/android: remove struct sync_timeline_ops Gustavo Padovan <gustavo@padovan.org> - 2016-01-27 14:40 +0100 [PATCH v2 11/11] dma-buf/sync_file: bring sync_dump() back Gustavo Padovan <gustavo@padovan.org> - 2016-01-27 14:40 +0100 [PATCH v2 07/11] staging/android: remove sw_sync.[ch] files Gustavo Padovan <gustavo@padovan.org> - 2016-01-27 14:40 +0100 [PATCH v2 03/11] staging/android: remove .fill_driver_data() timeline ops Gustavo Padovan <gustavo@padovan.org> - 2016-01-27 14:40 +0100
csiph-web