Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1410580
| From | Gustavo Padovan <gustavo@padovan.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 05/18] staging/android: remove sw_sync.[ch] files |
| Date | 2016-05-31 22:10 +0200 |
| Message-ID | <rEY9b-7d9-7@gated-at.bofh.it> (permalink) |
| References | <rEXZw-6Uz-27@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
We can glue the sw_sync file operations directly on the sync framework
without the need to pass through sw_sync wrappers.
It only builds sw_sync debugfs file support if CONFIG_SW_SYNC is enabled.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
drivers/staging/android/Makefile | 1 -
drivers/staging/android/sw_sync.c | 45 ----------------------------------
drivers/staging/android/sw_sync.h | 47 ------------------------------------
drivers/staging/android/sync_debug.c | 17 ++++++++++---
4 files changed, 13 insertions(+), 97 deletions(-)
delete mode 100644 drivers/staging/android/sw_sync.c
delete mode 100644 drivers/staging/android/sw_sync.h
diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile
index 980d6dc..bf45967 100644
--- a/drivers/staging/android/Makefile
+++ b/drivers/staging/android/Makefile
@@ -5,4 +5,3 @@ obj-y += ion/
obj-$(CONFIG_ASHMEM) += ashmem.o
obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o
obj-$(CONFIG_SYNC) += sync.o sync_debug.o
-obj-$(CONFIG_SW_SYNC) += sw_sync.o
diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c
deleted file mode 100644
index 461dbd9..0000000
--- a/drivers/staging/android/sw_sync.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * drivers/base/sw_sync.c
- *
- * Copyright (C) 2012 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/export.h>
-#include <linux/file.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/syscalls.h>
-#include <linux/uaccess.h>
-
-#include "sw_sync.h"
-
-struct fence *sw_sync_pt_create(struct sync_timeline *obj, u32 value)
-{
- return sync_pt_create(obj, sizeof(struct fence), value);
-}
-EXPORT_SYMBOL(sw_sync_pt_create);
-
-struct sync_timeline *sw_sync_timeline_create(const char *name)
-{
- return sync_timeline_create(sizeof(struct sync_timeline),
- "sw_sync", name);
-}
-EXPORT_SYMBOL(sw_sync_timeline_create);
-
-void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc)
-{
- sync_timeline_signal(obj, inc);
-}
-EXPORT_SYMBOL(sw_sync_timeline_inc);
diff --git a/drivers/staging/android/sw_sync.h b/drivers/staging/android/sw_sync.h
deleted file mode 100644
index 9f26c62..0000000
--- a/drivers/staging/android/sw_sync.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * include/linux/sw_sync.h
- *
- * Copyright (C) 2012 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _LINUX_SW_SYNC_H
-#define _LINUX_SW_SYNC_H
-
-#include <linux/types.h>
-#include <linux/kconfig.h>
-#include "sync.h"
-#include "uapi/sw_sync.h"
-
-#if IS_ENABLED(CONFIG_SW_SYNC)
-struct sync_timeline *sw_sync_timeline_create(const char *name);
-void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc);
-
-struct fence *sw_sync_pt_create(struct sync_timeline *obj, u32 value);
-#else
-static inline struct sync_timeline *sw_sync_timeline_create(const char *name)
-{
- return NULL;
-}
-
-static inline void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc)
-{
-}
-
-static inline struct fence *sw_sync_pt_create(struct sync_timeline *obj,
- u32 value)
-{
- return NULL;
-}
-#endif /* IS_ENABLED(CONFIG_SW_SYNC) */
-
-#endif /* _LINUX_SW_SYNC_H */
diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c
index e207a4d..dc85d5f 100644
--- a/drivers/staging/android/sync_debug.c
+++ b/drivers/staging/android/sync_debug.c
@@ -27,7 +27,11 @@
#include <linux/anon_inodes.h>
#include <linux/time64.h>
#include <linux/sync_file.h>
-#include "sw_sync.h"
+#include <linux/types.h>
+#include <linux/kconfig.h>
+
+#include "uapi/sw_sync.h"
+#include "sync.h"
#ifdef CONFIG_DEBUG_FS
@@ -200,6 +204,7 @@ static const struct file_operations sync_info_debugfs_fops = {
.release = single_release,
};
+#if IS_ENABLED(CONFIG_SW_SYNC)
/*
* *WARNING*
*
@@ -214,7 +219,7 @@ static int sw_sync_debugfs_open(struct inode *inode, struct file *file)
get_task_comm(task_comm, current);
- obj = sw_sync_timeline_create(task_comm);
+ obj = sync_timeline_create(sizeof(*obj), "sw_sync", task_comm);
if (!obj)
return -ENOMEM;
@@ -248,7 +253,7 @@ static long sw_sync_ioctl_create_fence(struct sync_timeline *obj,
goto err;
}
- fence = sw_sync_pt_create(obj, data.value);
+ fence = sync_pt_create(obj, sizeof(*fence), data.value);
if (!fence) {
err = -ENOMEM;
goto err;
@@ -284,7 +289,7 @@ static long sw_sync_ioctl_inc(struct sync_timeline *obj, unsigned long arg)
if (copy_from_user(&value, (void __user *)arg, sizeof(value)))
return -EFAULT;
- sw_sync_timeline_inc(obj, value);
+ sync_timeline_signal(obj, value);
return 0;
}
@@ -312,14 +317,18 @@ static const struct file_operations sw_sync_debugfs_fops = {
.unlocked_ioctl = sw_sync_ioctl,
.compat_ioctl = sw_sync_ioctl,
};
+#endif
static __init int sync_debugfs_init(void)
{
dbgfs = debugfs_create_dir("sync", NULL);
debugfs_create_file("info", 0444, dbgfs, NULL, &sync_info_debugfs_fops);
+
+#if IS_ENABLED(CONFIG_SW_SYNC)
debugfs_create_file("sw_sync", 0644, dbgfs, NULL,
&sw_sync_debugfs_fops);
+#endif
return 0;
}
--
2.5.5
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/18] staging/android: clean up SW_SYNC Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:00 +0200
[PATCH 08/18] staging/android: remove size arg of sync_timeline_create() Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 16/18] staging/android: remove drv_name from sync_timeline Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 04/18] staging/android: remove sw_sync_timeline and sw_sync_pt Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 17/18] staging/android: rename sync.h to sync_debug.h Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 05/18] staging/android: remove sw_sync.[ch] files Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 13/18] staging/android: make sw_ioctl info internal to sw_sync.c Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 10/18] staging/android: move sw_sync related code to sw_sync.c Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 12/18] staging/android: make sync_timeline internal to sw_sync Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 07/18] staging/android: remove unnecessary check for fence Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 09/18] staging/android: bring struct sync_pt back Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 14/18] staging/android: remove 'destroyed' member from struct sync_timeline Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 18/18] staging/android: add DEBUG_FS dependence on Kconfig Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 02/18] staging/android: remove .{fence,timeline}_value_str() from timeline_ops Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 01/18] staging/android: store last signaled value on sync timeline Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 11/18] staging/android: clean up #includes in the sync framework Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 15/18] staging/android: remove sync_timeline_destroy() Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 03/18] staging/android: remove struct sync_timeline_ops Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
[PATCH 06/18] staging/android: rename android_fence to timeline_fence Gustavo Padovan <gustavo@padovan.org> - 2016-05-31 22:10 +0200
Re: [PATCH 00/18] staging/android: clean up SW_SYNC Gustavo Padovan <gustavo@padovan.org> - 2016-06-08 21:10 +0200
Re: [PATCH 00/18] staging/android: clean up SW_SYNC Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-06-09 07:50 +0200
Re: [PATCH 00/18] staging/android: clean up SW_SYNC Daniel Vetter <daniel@ffwll.ch> - 2016-06-09 10:30 +0200
Re: [PATCH 00/18] staging/android: clean up SW_SYNC Sumit Semwal <sumit.semwal@linaro.org> - 2016-06-09 16:00 +0200
csiph-web