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

RDMA/core: Make FD destroy callback void

All FD object destroy implementations return 0, so declare this callback
void.

Link: https://lore.kernel.org/r/20201104144556.3809085-3-leon@kernel.org
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

authored by

Leon Romanovsky and committed by
Jason Gunthorpe
c5633a72 efa968ee

+11 -14
+2 -1
drivers/infiniband/core/rdma_core.c
··· 571 571 const struct uverbs_obj_fd_type *fd_type = container_of( 572 572 uobj->uapi_object->type_attrs, struct uverbs_obj_fd_type, type); 573 573 574 - return fd_type->destroy_object(uobj, why); 574 + fd_type->destroy_object(uobj, why); 575 + return 0; 575 576 } 576 577 577 578 static void remove_handle_fd_uobject(struct ib_uobject *uobj)
+1 -2
drivers/infiniband/core/uverbs_std_types.c
··· 154 154 spin_unlock_irq(&event_queue->lock); 155 155 } 156 156 157 - static int 157 + static void 158 158 uverbs_completion_event_file_destroy_uobj(struct ib_uobject *uobj, 159 159 enum rdma_remove_reason why) 160 160 { ··· 163 163 uobj); 164 164 165 165 ib_uverbs_free_event_queue(&file->ev_queue); 166 - return 0; 167 166 } 168 167 169 168 int uverbs_destroy_def_handler(struct uverbs_attr_bundle *attrs)
+2 -3
drivers/infiniband/core/uverbs_std_types_async_fd.c
··· 19 19 return 0; 20 20 } 21 21 22 - static int uverbs_async_event_destroy_uobj(struct ib_uobject *uobj, 23 - enum rdma_remove_reason why) 22 + static void uverbs_async_event_destroy_uobj(struct ib_uobject *uobj, 23 + enum rdma_remove_reason why) 24 24 { 25 25 struct ib_uverbs_async_event_file *event_file = 26 26 container_of(uobj, struct ib_uverbs_async_event_file, uobj); ··· 30 30 if (why == RDMA_REMOVE_DRIVER_REMOVE) 31 31 ib_uverbs_async_handler(event_file, 0, IB_EVENT_DEVICE_FATAL, 32 32 NULL, NULL); 33 - return 0; 34 33 } 35 34 36 35 int uverbs_async_event_release(struct inode *inode, struct file *filp)
+4 -6
drivers/infiniband/hw/mlx5/devx.c
··· 2594 2594 .llseek = no_llseek, 2595 2595 }; 2596 2596 2597 - static int devx_async_cmd_event_destroy_uobj(struct ib_uobject *uobj, 2598 - enum rdma_remove_reason why) 2597 + static void devx_async_cmd_event_destroy_uobj(struct ib_uobject *uobj, 2598 + enum rdma_remove_reason why) 2599 2599 { 2600 2600 struct devx_async_cmd_event_file *comp_ev_file = 2601 2601 container_of(uobj, struct devx_async_cmd_event_file, ··· 2617 2617 kvfree(entry); 2618 2618 } 2619 2619 spin_unlock_irq(&comp_ev_file->ev_queue.lock); 2620 - return 0; 2621 2620 }; 2622 2621 2623 - static int devx_async_event_destroy_uobj(struct ib_uobject *uobj, 2624 - enum rdma_remove_reason why) 2622 + static void devx_async_event_destroy_uobj(struct ib_uobject *uobj, 2623 + enum rdma_remove_reason why) 2625 2624 { 2626 2625 struct devx_async_event_file *ev_file = 2627 2626 container_of(uobj, struct devx_async_event_file, ··· 2664 2665 mutex_unlock(&dev->devx_event_table.event_xa_lock); 2665 2666 2666 2667 put_device(&dev->ib_dev.dev); 2667 - return 0; 2668 2668 }; 2669 2669 2670 2670 DECLARE_UVERBS_NAMED_METHOD(
+2 -2
include/rdma/uverbs_types.h
··· 138 138 * because the driver is removed or the FD is closed. 139 139 */ 140 140 struct uverbs_obj_type type; 141 - int (*destroy_object)(struct ib_uobject *uobj, 142 - enum rdma_remove_reason why); 141 + void (*destroy_object)(struct ib_uobject *uobj, 142 + enum rdma_remove_reason why); 143 143 const struct file_operations *fops; 144 144 const char *name; 145 145 int flags;