Loading drivers/staging/android/sync.c +13 −13 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading @@ -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; } Loading drivers/staging/android/uapi/sync.h +4 −5 Original line number Diff line number Diff line Loading @@ -46,15 +46,15 @@ struct sync_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 * @sync_fence_info: array of sync_fence_info for every fence in the sync_file */ struct sync_file_info_data { struct sync_file_info { __u32 len; char name[32]; __s32 status; Loading Loading @@ -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 */ Loading
drivers/staging/android/sync.c +13 −13 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading @@ -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; } Loading
drivers/staging/android/uapi/sync.h +4 −5 Original line number Diff line number Diff line Loading @@ -46,15 +46,15 @@ struct sync_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 * @sync_fence_info: array of sync_fence_info for every fence in the sync_file */ struct sync_file_info_data { struct sync_file_info { __u32 len; char name[32]; __s32 status; Loading Loading @@ -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 */