From: Al Viro <viro@zeniv.linux.org.uk>
To: Xichao Zhao <zhao.xichao@vivo.com>
Cc: gregkh@linuxfoundation.org, arve@android.com, tkjos@android.com,
maco@android.com, joelagnelf@nvidia.com, brauner@kernel.org,
cmllamas@google.com, surenb@google.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] binderfs: Use PTR_ERR_OR_ZERO() to simplify code
Date: Tue, 29 Jul 2025 17:56:59 +0100 [thread overview]
Message-ID: <20250729165659.GJ222315@ZenIV> (raw)
In-Reply-To: <20250729093704.596293-1-zhao.xichao@vivo.com>
On Tue, Jul 29, 2025 at 05:37:04PM +0800, Xichao Zhao wrote:
> Use the standard error pointer macro to shorten the code and simplify.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
> drivers/android/binderfs.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c
> index 0d9d95a7fb60..729e3ed94b89 100644
> --- a/drivers/android/binderfs.c
> +++ b/drivers/android/binderfs.c
> @@ -598,10 +598,8 @@ static int init_binder_features(struct super_block *sb)
> dentry = binderfs_create_file(dir, "freeze_notification",
> &binder_features_fops,
> &binder_features.freeze_notification);
> - if (IS_ERR(dentry))
> - return PTR_ERR(dentry);
>
> - return 0;
> + return PTR_ERR_OR_ZERO(dentry);
> }
NAK. Take a look at the failure exits before this one; keeping them
consistent is a good thing.
prev parent reply other threads:[~2025-07-29 16:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 9:37 Xichao Zhao
2025-07-29 16:56 ` Al Viro [this message]
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=20250729165659.GJ222315@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=arve@android.com \
--cc=brauner@kernel.org \
--cc=cmllamas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=joelagnelf@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@android.com \
--cc=surenb@google.com \
--cc=tkjos@android.com \
--cc=zhao.xichao@vivo.com \
/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
all inboxes | Powered by JetHome®