linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: linmiaohe <linmiaohe@huawei.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Davide Libenzi <davidel@xmailserver.org>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs: eventfd: fix obsolete comment
Date: Mon, 9 Dec 2019 02:44:06 +0000	[thread overview]
Message-ID: <d23f9f8e10854e0faca4e05fedc0df95@huawei.com> (raw)

Matthew Wilcox <willy@infradead.org> wrote:
>On Sat, Dec 07, 2019 at 03:45:33PM +0800, linmiaohe wrote:
>> From: Miaohe Lin <linmiaohe@huawei.com>
>> 
>>   *
>> - * eventfd_fget
>> + * fdget
>
>But this is wrong.  The error pointer is returned from eventfd_ctx_fileget(), not from fdget.
>
>Looking at the three callers of eventfd_ctx_fileget(), I think it would make sense to do this:

Many thanks for your review and nice advice. But I think this patch should belong to you as you found this.
I really did nothing about it. Maybe a Reviewed-by tag for me is enough.

>diff --git a/drivers/vfio/virqfd.c b/drivers/vfio/virqfd.c index 997cb5d0a657..c35b614e3770 100644
>--- a/drivers/vfio/virqfd.c
>+++ b/drivers/vfio/virqfd.c
>@@ -126,11 +126,6 @@ int vfio_virqfd_enable(void *opaque,
> 	INIT_WORK(&virqfd->inject, virqfd_inject);
> 
> 	irqfd = fdget(fd);
>-	if (!irqfd.file) {
>-		ret = -EBADF;
>-		goto err_fd;
>-	}
>-
> 	ctx = eventfd_ctx_fileget(irqfd.file);
> 	if (IS_ERR(ctx)) {
> 		ret = PTR_ERR(ctx);

The err_fd label should further be removed, as after this change, it's no longer used.
Other callers should drop unused jump label too.

>(not even compile tested)

Thanks again.

             reply	other threads:[~2019-12-09  2:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09  2:44 linmiaohe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-12-07  7:45 [PATCH] fs: eventfd: fix obsolete comment linmiaohe
2019-12-07 17:01 ` Matthew Wilcox

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=d23f9f8e10854e0faca4e05fedc0df95@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=davidel@xmailserver.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).