Skip to content

Commit 04d29b0

Browse files
author
Roland Dreier
committed
IB/uverbs: Make ib_uverbs_release_event_file() static
ib_uverbs_release_event_file() is only used in uverbs_main.c, so make it static to that file. Also move the definition before the first use, so a forward declaration is not needed. Signed-off-by: Roland Dreier <rolandd@cisco.com>
1 parent a394f83 commit 04d29b0

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

drivers/infiniband/core/uverbs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ void idr_remove_uobj(struct idr *idp, struct ib_uobject *uobj);
148148

149149
struct file *ib_uverbs_alloc_event_file(struct ib_uverbs_file *uverbs_file,
150150
int is_async, int *fd);
151-
void ib_uverbs_release_event_file(struct kref *ref);
152151
struct ib_uverbs_event_file *ib_uverbs_lookup_comp_file(int fd);
153152

154153
void ib_uverbs_release_ucq(struct ib_uverbs_file *file,

drivers/infiniband/core/uverbs_main.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,14 @@ static void ib_uverbs_release_dev(struct kref *ref)
125125
complete(&dev->comp);
126126
}
127127

128+
static void ib_uverbs_release_event_file(struct kref *ref)
129+
{
130+
struct ib_uverbs_event_file *file =
131+
container_of(ref, struct ib_uverbs_event_file, ref);
132+
133+
kfree(file);
134+
}
135+
128136
void ib_uverbs_release_ucq(struct ib_uverbs_file *file,
129137
struct ib_uverbs_event_file *ev_file,
130138
struct ib_ucq_object *uobj)
@@ -331,14 +339,6 @@ static unsigned int ib_uverbs_event_poll(struct file *filp,
331339
return pollflags;
332340
}
333341

334-
void ib_uverbs_release_event_file(struct kref *ref)
335-
{
336-
struct ib_uverbs_event_file *file =
337-
container_of(ref, struct ib_uverbs_event_file, ref);
338-
339-
kfree(file);
340-
}
341-
342342
static int ib_uverbs_event_fasync(int fd, struct file *filp, int on)
343343
{
344344
struct ib_uverbs_event_file *file = filp->private_data;

0 commit comments

Comments
 (0)