Commit c5633a72 authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Jason Gunthorpe

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.orgReviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent efa968ee
...@@ -571,7 +571,8 @@ static int __must_check destroy_hw_fd_uobject(struct ib_uobject *uobj, ...@@ -571,7 +571,8 @@ static int __must_check destroy_hw_fd_uobject(struct ib_uobject *uobj,
const struct uverbs_obj_fd_type *fd_type = container_of( const struct uverbs_obj_fd_type *fd_type = container_of(
uobj->uapi_object->type_attrs, struct uverbs_obj_fd_type, type); uobj->uapi_object->type_attrs, struct uverbs_obj_fd_type, type);
return fd_type->destroy_object(uobj, why); fd_type->destroy_object(uobj, why);
return 0;
} }
static void remove_handle_fd_uobject(struct ib_uobject *uobj) static void remove_handle_fd_uobject(struct ib_uobject *uobj)
......
...@@ -154,7 +154,7 @@ void ib_uverbs_free_event_queue(struct ib_uverbs_event_queue *event_queue) ...@@ -154,7 +154,7 @@ void ib_uverbs_free_event_queue(struct ib_uverbs_event_queue *event_queue)
spin_unlock_irq(&event_queue->lock); spin_unlock_irq(&event_queue->lock);
} }
static int static void
uverbs_completion_event_file_destroy_uobj(struct ib_uobject *uobj, uverbs_completion_event_file_destroy_uobj(struct ib_uobject *uobj,
enum rdma_remove_reason why) enum rdma_remove_reason why)
{ {
...@@ -163,7 +163,6 @@ uverbs_completion_event_file_destroy_uobj(struct ib_uobject *uobj, ...@@ -163,7 +163,6 @@ uverbs_completion_event_file_destroy_uobj(struct ib_uobject *uobj,
uobj); uobj);
ib_uverbs_free_event_queue(&file->ev_queue); ib_uverbs_free_event_queue(&file->ev_queue);
return 0;
} }
int uverbs_destroy_def_handler(struct uverbs_attr_bundle *attrs) int uverbs_destroy_def_handler(struct uverbs_attr_bundle *attrs)
......
...@@ -19,7 +19,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_ASYNC_EVENT_ALLOC)( ...@@ -19,7 +19,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_ASYNC_EVENT_ALLOC)(
return 0; return 0;
} }
static int uverbs_async_event_destroy_uobj(struct ib_uobject *uobj, static void uverbs_async_event_destroy_uobj(struct ib_uobject *uobj,
enum rdma_remove_reason why) enum rdma_remove_reason why)
{ {
struct ib_uverbs_async_event_file *event_file = struct ib_uverbs_async_event_file *event_file =
...@@ -30,7 +30,6 @@ static int uverbs_async_event_destroy_uobj(struct ib_uobject *uobj, ...@@ -30,7 +30,6 @@ static int uverbs_async_event_destroy_uobj(struct ib_uobject *uobj,
if (why == RDMA_REMOVE_DRIVER_REMOVE) if (why == RDMA_REMOVE_DRIVER_REMOVE)
ib_uverbs_async_handler(event_file, 0, IB_EVENT_DEVICE_FATAL, ib_uverbs_async_handler(event_file, 0, IB_EVENT_DEVICE_FATAL,
NULL, NULL); NULL, NULL);
return 0;
} }
int uverbs_async_event_release(struct inode *inode, struct file *filp) int uverbs_async_event_release(struct inode *inode, struct file *filp)
......
...@@ -2594,7 +2594,7 @@ static const struct file_operations devx_async_event_fops = { ...@@ -2594,7 +2594,7 @@ static const struct file_operations devx_async_event_fops = {
.llseek = no_llseek, .llseek = no_llseek,
}; };
static int devx_async_cmd_event_destroy_uobj(struct ib_uobject *uobj, static void devx_async_cmd_event_destroy_uobj(struct ib_uobject *uobj,
enum rdma_remove_reason why) enum rdma_remove_reason why)
{ {
struct devx_async_cmd_event_file *comp_ev_file = struct devx_async_cmd_event_file *comp_ev_file =
...@@ -2617,10 +2617,9 @@ static int devx_async_cmd_event_destroy_uobj(struct ib_uobject *uobj, ...@@ -2617,10 +2617,9 @@ static int devx_async_cmd_event_destroy_uobj(struct ib_uobject *uobj,
kvfree(entry); kvfree(entry);
} }
spin_unlock_irq(&comp_ev_file->ev_queue.lock); spin_unlock_irq(&comp_ev_file->ev_queue.lock);
return 0;
}; };
static int devx_async_event_destroy_uobj(struct ib_uobject *uobj, static void devx_async_event_destroy_uobj(struct ib_uobject *uobj,
enum rdma_remove_reason why) enum rdma_remove_reason why)
{ {
struct devx_async_event_file *ev_file = struct devx_async_event_file *ev_file =
...@@ -2665,7 +2664,6 @@ static int devx_async_event_destroy_uobj(struct ib_uobject *uobj, ...@@ -2665,7 +2664,6 @@ static int devx_async_event_destroy_uobj(struct ib_uobject *uobj,
mutex_unlock(&dev->devx_event_table.event_xa_lock); mutex_unlock(&dev->devx_event_table.event_xa_lock);
put_device(&dev->ib_dev.dev); put_device(&dev->ib_dev.dev);
return 0;
}; };
DECLARE_UVERBS_NAMED_METHOD( DECLARE_UVERBS_NAMED_METHOD(
......
...@@ -138,7 +138,7 @@ struct uverbs_obj_fd_type { ...@@ -138,7 +138,7 @@ struct uverbs_obj_fd_type {
* because the driver is removed or the FD is closed. * because the driver is removed or the FD is closed.
*/ */
struct uverbs_obj_type type; struct uverbs_obj_type type;
int (*destroy_object)(struct ib_uobject *uobj, void (*destroy_object)(struct ib_uobject *uobj,
enum rdma_remove_reason why); enum rdma_remove_reason why);
const struct file_operations *fops; const struct file_operations *fops;
const char *name; const char *name;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment