* [PATCH] binderfs: Use PTR_ERR_OR_ZERO() to simplify code
@ 2025-07-29 9:37 Xichao Zhao
2025-07-29 16:56 ` Al Viro
0 siblings, 1 reply; 2+ messages in thread
From: Xichao Zhao @ 2025-07-29 9:37 UTC (permalink / raw)
To: gregkh, arve, tkjos, maco, joelagnelf, brauner, cmllamas, surenb
Cc: linux-kernel, Xichao Zhao
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);
}
static int init_binder_logs(struct super_block *sb)
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] binderfs: Use PTR_ERR_OR_ZERO() to simplify code
2025-07-29 9:37 [PATCH] binderfs: Use PTR_ERR_OR_ZERO() to simplify code Xichao Zhao
@ 2025-07-29 16:56 ` Al Viro
0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2025-07-29 16:56 UTC (permalink / raw)
To: Xichao Zhao
Cc: gregkh, arve, tkjos, maco, joelagnelf, brauner, cmllamas, surenb,
linux-kernel
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-29 16:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-29 9:37 [PATCH] binderfs: Use PTR_ERR_OR_ZERO() to simplify code Xichao Zhao
2025-07-29 16:56 ` Al Viro
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®