lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1452869739-3304-17-git-send-email-gustavo@padovan.org>
Date:	Fri, 15 Jan 2016 12:55:26 -0200
From:	Gustavo Padovan <gustavo@...ovan.org>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
	dri-devel@...ts.freedesktop.org, daniels@...labora.com,
	Arve Hjønnevåg <arve@...roid.com>,
	Riley Andrews <riandrews@...roid.com>,
	Daniel Vetter <daniel.vetter@...ll.ch>,
	Rob Clark <robdclark@...il.com>,
	Greg Hackmann <ghackmann@...gle.com>,
	John Harrison <John.C.Harrison@...el.com>,
	Maarten Lankhorst <maarten.lankhorst@...onical.com>,
	Gustavo Padovan <gustavo.padovan@...labora.co.uk>
Subject: [RFC 16/29] dma-buf/fence: create fence_default_timeline_name()

From: Gustavo Padovan <gustavo.padovan@...labora.co.uk>

The fence timeline struct already receives the name of the timeline so
we can use a default function to return the timeline name.

Signed-off-by: Gustavo Padovan <gustavo.padovan@...labora.co.uk>
---
 drivers/dma-buf/fence.c        | 14 ++++++++++++++
 drivers/staging/android/sync.c |  9 +--------
 include/linux/fence.h          |  1 +
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/dma-buf/fence.c b/drivers/dma-buf/fence.c
index 85b5074..f77d6a9 100644
--- a/drivers/dma-buf/fence.c
+++ b/drivers/dma-buf/fence.c
@@ -456,6 +456,20 @@ const char *fence_default_get_driver_name(struct fence *fence)
 EXPORT_SYMBOL(fence_default_get_driver_name);
 
 /**
+ * fence_default_get_timeline_name - default get_timeline_name op
+ * @fence:	[in]	the fence to retrieve timeline name
+ *
+ * This function returns the name of the timeline which the fence belongs to.
+ */
+const char *fence_default_get_timeline_name(struct fence *fence)
+{
+	struct fence_timeline *parent = fence_parent(fence);
+
+	return parent->name;
+}
+EXPORT_SYMBOL(fence_default_get_timeline_name);
+
+/**
  * fence_default_enable_signaling - default op for .enable_signaling
  * @fence:	[in]	the fence to enable signaling
  *
diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index c3386a6..f8b3c6b 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -321,13 +321,6 @@ int sync_fence_wait(struct sync_fence *sync_fence, long timeout)
 }
 EXPORT_SYMBOL(sync_fence_wait);
 
-static const char *sync_fence_get_timeline_name(struct fence *fence)
-{
-	struct fence_timeline *parent = fence_parent(fence);
-
-	return parent->name;
-}
-
 static bool sync_fence_signaled(struct fence *fence)
 {
 	struct fence_timeline *parent = fence_parent(fence);
@@ -377,7 +370,7 @@ static void sync_fence_timeline_value_str(struct fence *fence,
 
 static const struct fence_ops sync_fence_ops = {
 	.get_driver_name = fence_default_get_driver_name,
-	.get_timeline_name = sync_fence_get_timeline_name,
+	.get_timeline_name = fence_default_get_timeline_name,
 	.enable_signaling = fence_default_enable_signaling,
 	.signaled = sync_fence_signaled,
 	.wait = fence_default_wait,
diff --git a/include/linux/fence.h b/include/linux/fence.h
index f355c28a..e8f9f12 100644
--- a/include/linux/fence.h
+++ b/include/linux/fence.h
@@ -295,6 +295,7 @@ static inline void fence_put(struct fence *fence)
 int fence_signal(struct fence *fence);
 int fence_signal_locked(struct fence *fence);
 const char *fence_default_get_driver_name(struct fence *fence);
+const char *fence_default_get_timeline_name(struct fence *fence);
 bool fence_default_enable_signaling(struct fence *fence);
 signed long fence_default_wait(struct fence *fence, bool intr, signed long timeout);
 void fence_default_release(struct fence *fence);
-- 
2.5.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ