From: <ye.xingchen@zte.com.cn>
To: <sumit.semwal@linaro.org>
Cc: <gustavo@padovan.org>, <christian.koenig@amd.com>,
<linux-media@vger.kernel.org>, <dri-devel@lists.freedesktop.org>,
<linaro-mm-sig@lists.linaro.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] dma-buf/sync_file: Use fdget()
Date: Fri, 5 May 2023 11:03:39 +0800 (CST) [thread overview]
Message-ID: <202305051103396748797@zte.com.cn> (raw)
From: Ye Xingchen <ye.xingchen@zte.com.cn>
convert the fget() use to fdget().
Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>
---
drivers/dma-buf/sync_file.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index af57799c86ce..222b13b1bdb8 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -78,18 +78,18 @@ EXPORT_SYMBOL(sync_file_create);
static struct sync_file *sync_file_fdget(int fd)
{
- struct file *file = fget(fd);
+ struct struct fd f = fdget(fd);
- if (!file)
+ if (!f.file)
return NULL;
- if (file->f_op != &sync_file_fops)
+ if (f.file->f_op != &sync_file_fops)
goto err;
- return file->private_data;
+ return f.file->private_data;
err:
- fput(file);
+ fdput(f);
return NULL;
}
--
2.25.1
next reply other threads:[~2023-05-05 3:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-05 3:03 ye.xingchen [this message]
2023-05-05 8:22 ` [PATCH] dma-buf/sync_file: Use fdget() Christian König
2023-05-11 6:40 ` Al Viro
2023-05-11 5:43 ` Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202305051103396748797@zte.com.cn \
--to=ye.xingchen@zte.com.cn \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavo@padovan.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=sumit.semwal@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox