mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	dri-devel@lists.freedesktop.org,
	"Daniel Stone" <daniels@collabora.com>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Riley Andrews" <riandrews@android.com>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Rob Clark" <robdclark@gmail.com>,
	"Greg Hackmann" <ghackmann@google.com>,
	"John Harrison" <John.C.Harrison@Intel.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Gustavo Padovan" <gustavo.padovan@collabora.co.uk>
Subject: [PATCH 03/10] staging/android: rename sync_file_info_data to sync_file_info
Date: Fri, 29 Jan 2016 19:20:19 -0200	[thread overview]
Message-ID: <1454102426-20637-4-git-send-email-gustavo@padovan.org> (raw)
In-Reply-To: <1454102426-20637-1-git-send-email-gustavo@padovan.org>

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

info_data is a bit redundant, let's keep it as only sync_file_info. It is
also smaller.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/staging/android/sync.c      | 26 +++++++++++++-------------
 drivers/staging/android/uapi/sync.h |  9 ++++-----
 2 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index ed63001..a1cf9fd 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -525,7 +525,7 @@ static int sync_fill_fence_info(struct fence *fence, void *data, int size)
 static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
 					unsigned long arg)
 {
-	struct sync_file_info_data *data;
+	struct sync_file_info *info;
 	__u32 size;
 	__u32 len = 0;
 	int ret, i;
@@ -533,27 +533,27 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
 	if (copy_from_user(&size, (void __user *)arg, sizeof(size)))
 		return -EFAULT;
 
-	if (size < sizeof(struct sync_file_info_data))
+	if (size < sizeof(struct sync_file_info))
 		return -EINVAL;
 
 	if (size > 4096)
 		size = 4096;
 
-	data = kzalloc(size, GFP_KERNEL);
-	if (!data)
+	info = kzalloc(size, GFP_KERNEL);
+	if (!info)
 		return -ENOMEM;
 
-	strlcpy(data->name, sync_file->name, sizeof(data->name));
-	data->status = atomic_read(&sync_file->status);
-	if (data->status >= 0)
-		data->status = !data->status;
+	strlcpy(info->name, sync_file->name, sizeof(info->name));
+	info->status = atomic_read(&sync_file->status);
+	if (info->status >= 0)
+		info->status = !info->status;
 
-	len = sizeof(struct sync_file_info_data);
+	len = sizeof(struct sync_file_info);
 
 	for (i = 0; i < sync_file->num_fences; ++i) {
 		struct fence *fence = sync_file->cbs[i].fence;
 
-		ret = sync_fill_fence_info(fence, (u8 *)data + len, size - len);
+		ret = sync_fill_fence_info(fence, (u8 *)info + len, size - len);
 
 		if (ret < 0)
 			goto out;
@@ -561,15 +561,15 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
 		len += ret;
 	}
 
-	data->len = len;
+	info->len = len;
 
-	if (copy_to_user((void __user *)arg, data, len))
+	if (copy_to_user((void __user *)arg, info, len))
 		ret = -EFAULT;
 	else
 		ret = 0;
 
 out:
-	kfree(data);
+	kfree(info);
 
 	return ret;
 }
diff --git a/drivers/staging/android/uapi/sync.h b/drivers/staging/android/uapi/sync.h
index c4703ec..70d05ad 100644
--- a/drivers/staging/android/uapi/sync.h
+++ b/drivers/staging/android/uapi/sync.h
@@ -46,15 +46,15 @@ struct fence_info {
 };
 
 /**
- * struct sync_file_info_data - data returned from fence info ioctl
+ * struct sync_file_info - data returned from fence info ioctl
  * @len:	ioctl caller writes the size of the buffer its passing in.
- *		ioctl returns length of sync_file_info_data returned to
+ *		ioctl returns length of sync_file_info returned to
  *		userspace including pt_info.
  * @name:	name of fence
  * @status:	status of fence. 1: signaled 0:active <0:error
  * @fence_info:	a fence_info struct for every fence in the sync_file
  */
-struct sync_file_info_data {
+struct sync_file_info {
 	__u32	len;
 	char	name[32];
 	__s32	status;
@@ -84,7 +84,6 @@ struct sync_file_info_data {
  * pt_info is a buffer containing sync_pt_infos for every sync_pt in the fence.
  * To iterate over the sync_pt_infos, use the sync_pt_info.len field.
  */
-#define SYNC_IOC_FENCE_INFO	_IOWR(SYNC_IOC_MAGIC, 2,\
-	struct sync_file_info_data)
+#define SYNC_IOC_FENCE_INFO	_IOWR(SYNC_IOC_MAGIC, 2, struct sync_file_info)
 
 #endif /* _UAPI_LINUX_SYNC_H */
-- 
2.5.0

  parent reply	other threads:[~2016-01-29 21:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29 21:20 [PATCH 00/10] android sync framework: clean up IOCTLs and ABI Gustavo Padovan
2016-01-29 21:20 ` [PATCH 01/10] staging/android: remove SYNC_WAIT ioctl Gustavo Padovan
2016-01-29 21:20 ` [PATCH 02/10] staging/android: rename sync_pt_info to fence_info Gustavo Padovan
2016-01-29 21:20 ` Gustavo Padovan [this message]
2016-01-29 21:20 ` [PATCH 04/10] staging/android: remove driver_data from struct fence_info Gustavo Padovan
2016-01-29 21:20 ` [PATCH 05/10] staging/android: remove len field " Gustavo Padovan
2016-01-29 21:20 ` [PATCH 06/10] staging/android: turn fence_info into a __64 pointer Gustavo Padovan
2016-01-30 18:04   ` Emil Velikov
2016-02-01  8:41   ` Maarten Lankhorst
2016-02-01 18:00     ` Gustavo Padovan
2016-02-02 13:04       ` Gustavo Padovan
2016-01-29 21:20 ` [PATCH 07/10] staging/android: add num_fences field to struct sync_file_info Gustavo Padovan
2016-01-29 21:20 ` [PATCH 08/10] staging/android: rename SYNC_IOC_FENCE_INFO Gustavo Padovan
2016-01-29 21:20 ` [PATCH 09/10] staging/android: add flags member to sync ioctl structs Gustavo Padovan
2016-01-30 18:12   ` Emil Velikov
2016-02-01 13:24     ` Gustavo Padovan
2016-02-01  8:39   ` Maarten Lankhorst
2016-01-29 21:20 ` [PATCH 10/10] staging/android: remove redundant comments on sync_merge_data 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=1454102426-20637-4-git-send-email-gustavo@padovan.org \
    --to=gustavo@padovan.org \
    --cc=John.C.Harrison@Intel.com \
    --cc=arve@android.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniels@collabora.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ghackmann@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=riandrews@android.com \
    --cc=robdclark@gmail.com \
    /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®