All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carlos Llamas <cmllamas@google.com>
To: Anish Moorthy <amoorthy@google.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Rename get_unused_fd_flags to get_unused_fd
Date: Sun, 18 May 2025 20:43:36 +0000	[thread overview]
Message-ID: <aCpGePN3w0efNtpr@google.com> (raw)
In-Reply-To: <20250515170945.278255-1-amoorthy@google.com>

On Thu, May 15, 2025 at 05:09:45PM +0000, Anish Moorthy wrote:
> The current name can be misread as having something to do with unused
> *flags*. And without a get_unused_fd() function already floating around,
> it's easy to resolve this by dropping the suffix.

I don't understand the "unused flags" argument. Did you interpret the
current naming as "get the flags not used by a certain fd"?

Note there _used_ to be a get_unused_fd() that would take no arguments
and thus the naming behind this _flags() version (just FYI).

> I'm not sure if there's any appetite for refactors like this: they're tedious
> for sure. I couldn't find any discouragement in the docs though, so I figured
> I'd just post the patch and let it find me.

If it helps, this kind of patches are usually tagged as "treewide:" and
are often implemented using coccinelle scripts.

Also, for this patch in particular I would:
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>

> diff --git a/drivers/android/binder.c b/drivers/android/binder.c
> index 76052006bd87..e162d92e8c1d 100644
> --- a/drivers/android/binder.c
> +++ b/drivers/android/binder.c
> @@ -4618,7 +4618,7 @@ static int binder_apply_fd_fixups(struct binder_proc *proc,
>  	int ret = 0;
>  
>  	list_for_each_entry(fixup, &t->fd_fixups, fixup_entry) {
> -		int fd = get_unused_fd_flags(O_CLOEXEC);
> +		int fd = get_unused_fd(O_CLOEXEC);
>  
>  		if (fd < 0) {
>  			binder_debug(BINDER_DEBUG_TRANSACTION,

This is the only reason I found this patch (binder), and fwiw the
renaming looks OK to me.

Cheers,
Carlos Llamas

  reply	other threads:[~2025-05-18 20:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-15 17:09 [PATCH] Rename get_unused_fd_flags to get_unused_fd Anish Moorthy
2025-05-18 20:43 ` Carlos Llamas [this message]
2025-05-20 18:16   ` Anish Moorthy

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=aCpGePN3w0efNtpr@google.com \
    --to=cmllamas@google.com \
    --cc=amoorthy@google.com \
    --cc=linux-kernel@vger.kernel.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 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.