Skip to content

Commit 38052c2

Browse files
author
Al Viro
committed
deal with the last remaing boolean uses of fd_file()
Reviewed-by: Christian Brauner <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 457a654 commit 38052c2

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

drivers/infiniband/core/uverbs_cmd.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ static int ib_uverbs_open_xrcd(struct uverbs_attr_bundle *attrs)
584584
if (cmd.fd != -1) {
585585
/* search for file descriptor */
586586
f = fdget(cmd.fd);
587-
if (!fd_file(f)) {
587+
if (fd_empty(f)) {
588588
ret = -EBADF;
589589
goto err_tree_mutex_unlock;
590590
}
@@ -632,8 +632,7 @@ static int ib_uverbs_open_xrcd(struct uverbs_attr_bundle *attrs)
632632
atomic_inc(&xrcd->usecnt);
633633
}
634634

635-
if (fd_file(f))
636-
fdput(f);
635+
fdput(f);
637636

638637
mutex_unlock(&ibudev->xrcd_tree_mutex);
639638
uobj_finalize_uobj_create(&obj->uobject, attrs);
@@ -648,8 +647,7 @@ static int ib_uverbs_open_xrcd(struct uverbs_attr_bundle *attrs)
648647
uobj_alloc_abort(&obj->uobject, attrs);
649648

650649
err_tree_mutex_unlock:
651-
if (fd_file(f))
652-
fdput(f);
650+
fdput(f);
653651

654652
mutex_unlock(&ibudev->xrcd_tree_mutex);
655653

include/linux/cleanup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ const volatile void * __must_check_fn(const volatile void *val)
234234
* DEFINE_CLASS(fdget, struct fd, fdput(_T), fdget(fd), int fd)
235235
*
236236
* CLASS(fdget, f)(fd);
237-
* if (!fd_file(f))
237+
* if (fd_empty(f))
238238
* return -EBADF;
239239
*
240240
* // use 'f' without concern

sound/core/pcm_native.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2250,7 +2250,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
22502250
bool nonatomic = substream->pcm->nonatomic;
22512251
CLASS(fd, f)(fd);
22522252

2253-
if (!fd_file(f))
2253+
if (fd_empty(f))
22542254
return -EBADFD;
22552255
if (!is_pcm_file(fd_file(f)))
22562256
return -EBADFD;

0 commit comments

Comments
 (0)