]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
deal with the last remaing boolean uses of fd_file()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 6 Jun 2024 23:29:04 +0000 (19:29 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 3 Nov 2024 06:28:07 +0000 (01:28 -0500)
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/infiniband/core/uverbs_cmd.c
include/linux/cleanup.h
sound/core/pcm_native.c

index a4cce360df21789096042f4593540c946e977a55..66b02fbf077ac5672b256100a4a0cadead5c6a7c 100644 (file)
@@ -584,7 +584,7 @@ static int ib_uverbs_open_xrcd(struct uverbs_attr_bundle *attrs)
        if (cmd.fd != -1) {
                /* search for file descriptor */
                f = fdget(cmd.fd);
-               if (!fd_file(f)) {
+               if (fd_empty(f)) {
                        ret = -EBADF;
                        goto err_tree_mutex_unlock;
                }
@@ -632,8 +632,7 @@ static int ib_uverbs_open_xrcd(struct uverbs_attr_bundle *attrs)
                atomic_inc(&xrcd->usecnt);
        }
 
-       if (fd_file(f))
-               fdput(f);
+       fdput(f);
 
        mutex_unlock(&ibudev->xrcd_tree_mutex);
        uobj_finalize_uobj_create(&obj->uobject, attrs);
@@ -648,8 +647,7 @@ err:
        uobj_alloc_abort(&obj->uobject, attrs);
 
 err_tree_mutex_unlock:
-       if (fd_file(f))
-               fdput(f);
+       fdput(f);
 
        mutex_unlock(&ibudev->xrcd_tree_mutex);
 
index 038b2d523bf884e969e67e3ab038ed5f7d6657da..875c998275c099463a6febd287acc25105fe183c 100644 (file)
@@ -234,7 +234,7 @@ const volatile void * __must_check_fn(const volatile void *val)
  * DEFINE_CLASS(fdget, struct fd, fdput(_T), fdget(fd), int fd)
  *
  *     CLASS(fdget, f)(fd);
- *     if (!fd_file(f))
+ *     if (fd_empty(f))
  *             return -EBADF;
  *
  *     // use 'f' without concern
index b465fb6e1f5f0da620c21724428ea7d6432db1ed..3320cce35a03727fe58f5bd2c439b92d152e5106 100644 (file)
@@ -2250,7 +2250,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
        bool nonatomic = substream->pcm->nonatomic;
        CLASS(fd, f)(fd);
 
-       if (!fd_file(f))
+       if (fd_empty(f))
                return -EBADFD;
        if (!is_pcm_file(fd_file(f)))
                return -EBADFD;