public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: ye.xingchen@zte.com.cn, sumit.semwal@linaro.org
Cc: gustavo@padovan.org, linux-media@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dma-buf/sync_file: Use fdget()
Date: Fri, 5 May 2023 10:22:09 +0200	[thread overview]
Message-ID: <b9ceed26-bf64-6314-3ec5-562542b2b1c6@amd.com> (raw)
In-Reply-To: <202305051103396748797@zte.com.cn>

Am 05.05.23 um 05:03 schrieb ye.xingchen@zte.com.cn:
> From: Ye Xingchen <ye.xingchen@zte.com.cn>
>
> convert the fget() use to fdget().

Well the rational is missing. Why should we do that?

Christian.

>
> 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;
>   }
>


  reply	other threads:[~2023-05-05  8:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05  3:03 [PATCH] dma-buf/sync_file: Use fdget() ye.xingchen
2023-05-05  8:22 ` Christian König [this message]
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=b9ceed26-bf64-6314-3ec5-562542b2b1c6@amd.com \
    --to=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 \
    --cc=ye.xingchen@zte.com.cn \
    /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