Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging/android: remove driver_data from struct sync_fence_info

It is unclear in what situations driver_data should be used thus better do
not upstream it for now. If a need arises in the future a discussion can
be started to re-add it.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Gustavo Padovan and committed by
Greg Kroah-Hartman
c7434b84 b5b24ac5

+1 -46
-14
drivers/staging/android/sw_sync.c
··· 47 47 return (pt->value > obj->value) ? 0 : 1; 48 48 } 49 49 50 - static int sw_sync_fill_driver_data(struct fence *fence, 51 - void *data, int size) 52 - { 53 - struct sw_sync_pt *pt = (struct sw_sync_pt *)fence; 54 - 55 - if (size < sizeof(pt->value)) 56 - return -ENOMEM; 57 - 58 - memcpy(data, &pt->value, sizeof(pt->value)); 59 - 60 - return sizeof(pt->value); 61 - } 62 - 63 50 static void sw_sync_timeline_value_str(struct sync_timeline *sync_timeline, 64 51 char *str, int size) 65 52 { ··· 65 78 static struct sync_timeline_ops sw_sync_timeline_ops = { 66 79 .driver_name = "sw_sync", 67 80 .has_signaled = sw_sync_fence_has_signaled, 68 - .fill_driver_data = sw_sync_fill_driver_data, 69 81 .timeline_value_str = sw_sync_timeline_value_str, 70 82 .fence_value_str = sw_sync_fence_value_str, 71 83 };
-21
drivers/staging/android/sync.c
··· 351 351 return true; 352 352 } 353 353 354 - static int android_fence_fill_driver_data(struct fence *fence, 355 - void *data, int size) 356 - { 357 - struct sync_timeline *parent = fence_parent(fence); 358 - 359 - if (!parent->ops->fill_driver_data) 360 - return 0; 361 - return parent->ops->fill_driver_data(fence, data, size); 362 - } 363 - 364 354 static void android_fence_value_str(struct fence *fence, 365 355 char *str, int size) 366 356 { ··· 384 394 .signaled = android_fence_signaled, 385 395 .wait = fence_default_wait, 386 396 .release = android_fence_release, 387 - .fill_driver_data = android_fence_fill_driver_data, 388 397 .fence_value_str = android_fence_value_str, 389 398 .timeline_value_str = android_fence_timeline_value_str, 390 399 }; ··· 482 493 static int sync_fill_fence_info(struct fence *fence, void *data, int size) 483 494 { 484 495 struct sync_fence_info *info = data; 485 - int ret; 486 496 487 497 if (size < sizeof(*info)) 488 498 return -ENOMEM; 489 499 490 500 info->len = sizeof(*info); 491 - 492 - if (fence->ops->fill_driver_data) { 493 - ret = fence->ops->fill_driver_data(fence, info->driver_data, 494 - size - sizeof(*info)); 495 - if (ret < 0) 496 - return ret; 497 - 498 - info->len += ret; 499 - } 500 501 501 502 strlcpy(info->obj_name, fence->ops->get_timeline_name(fence), 502 503 sizeof(info->obj_name));
-7
drivers/staging/android/sync.h
··· 32 32 * 1 if pt has signaled 33 33 * 0 if pt has not signaled 34 34 * <0 on error 35 - * @fill_driver_data: write implementation specific driver data to data. 36 - * should return an error if there is not enough room 37 - * as specified by size. This information is returned 38 - * to userspace by SYNC_IOC_FENCE_INFO. 39 35 * @timeline_value_str: fill str with the value of the sync_timeline's counter 40 36 * @fence_value_str: fill str with the value of the fence 41 37 */ ··· 40 44 41 45 /* required */ 42 46 int (*has_signaled)(struct fence *fence); 43 - 44 - /* optional */ 45 - int (*fill_driver_data)(struct fence *fence, void *data, int size); 46 47 47 48 /* optional */ 48 49 void (*timeline_value_str)(struct sync_timeline *timeline, char *str,
+1 -4
drivers/staging/android/uapi/sync.h
··· 28 28 29 29 /** 30 30 * struct sync_fence_info - detailed fence information 31 - * @len: length of sync_fence_info including any driver_data 31 + * @len: length of sync_fence_info 32 32 * @obj_name: name of parent sync_timeline 33 33 * @driver_name: name of driver implementing the parent 34 34 * @status: status of the fence 0:active 1:signaled <0:error 35 35 * @timestamp_ns: timestamp of status change in nanoseconds 36 - * @driver_data: any driver dependent data 37 36 */ 38 37 struct sync_fence_info { 39 38 __u32 len; ··· 40 41 char driver_name[32]; 41 42 __s32 status; 42 43 __u64 timestamp_ns; 43 - 44 - __u8 driver_data[0]; 45 44 }; 46 45 47 46 /**