All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs: eventfd: fix obsolete comment
@ 2019-12-07  7:45 linmiaohe
  2019-12-07 17:01 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: linmiaohe @ 2019-12-07  7:45 UTC (permalink / raw)
  To: viro; +Cc: linmiaohe, linux-fsdevel, linux-kernel

From: Miaohe Lin <linmiaohe@huawei.com>

since commit 36a7411724b1 ("eventfd_ctx_fdget(): use fdget() instead of
fget()"), this comment become outdated and looks confusing. Fix it with
the correct function name.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 fs/eventfd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/eventfd.c b/fs/eventfd.c
index 8aa0ea8c55e8..0b8466b12932 100644
--- a/fs/eventfd.c
+++ b/fs/eventfd.c
@@ -352,7 +352,7 @@ EXPORT_SYMBOL_GPL(eventfd_fget);
  * Returns a pointer to the internal eventfd context, otherwise the error
  * pointers returned by the following functions:
  *
- * eventfd_fget
+ * fdget
  */
 struct eventfd_ctx *eventfd_ctx_fdget(int fd)
 {
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* Re: [PATCH] fs: eventfd: fix obsolete comment
@ 2019-12-09  2:44 linmiaohe
  0 siblings, 0 replies; 3+ messages in thread
From: linmiaohe @ 2019-12-09  2:44 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Davide Libenzi, viro, linux-fsdevel, linux-kernel

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-09  2:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-07  7:45 [PATCH] fs: eventfd: fix obsolete comment linmiaohe
2019-12-07 17:01 ` Matthew Wilcox
2019-12-09  2:44 linmiaohe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.