* [PATCH] NFSD: Drop redundant conversion to bool
@ 2025-08-18 10:03 Xichao Zhao
2025-08-18 11:43 ` Jeff Layton
2025-08-18 14:01 ` Chuck Lever
0 siblings, 2 replies; 3+ messages in thread
From: Xichao Zhao @ 2025-08-18 10:03 UTC (permalink / raw)
To: chuck.lever, jlayton
Cc: neil, okorniev, Dai.Ngo, tom, linux-nfs, linux-kernel,
Xichao Zhao
The result of integer comparison already evaluates to bool. No need for
explicit conversion.
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
fs/nfsd/debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfsd/debugfs.c b/fs/nfsd/debugfs.c
index 84b0c8b559dc..f07d790d56aa 100644
--- a/fs/nfsd/debugfs.c
+++ b/fs/nfsd/debugfs.c
@@ -26,7 +26,7 @@ static int nfsd_dsr_get(void *data, u64 *val)
static int nfsd_dsr_set(void *data, u64 val)
{
- nfsd_disable_splice_read = (val > 0) ? true : false;
+ nfsd_disable_splice_read = (val > 0);
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] NFSD: Drop redundant conversion to bool
2025-08-18 10:03 [PATCH] NFSD: Drop redundant conversion to bool Xichao Zhao
@ 2025-08-18 11:43 ` Jeff Layton
2025-08-18 14:01 ` Chuck Lever
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2025-08-18 11:43 UTC (permalink / raw)
To: Xichao Zhao, chuck.lever
Cc: neil, okorniev, Dai.Ngo, tom, linux-nfs, linux-kernel
On Mon, 2025-08-18 at 18:03 +0800, Xichao Zhao wrote:
> The result of integer comparison already evaluates to bool. No need for
> explicit conversion.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
> fs/nfsd/debugfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/nfsd/debugfs.c b/fs/nfsd/debugfs.c
> index 84b0c8b559dc..f07d790d56aa 100644
> --- a/fs/nfsd/debugfs.c
> +++ b/fs/nfsd/debugfs.c
> @@ -26,7 +26,7 @@ static int nfsd_dsr_get(void *data, u64 *val)
>
> static int nfsd_dsr_set(void *data, u64 val)
> {
> - nfsd_disable_splice_read = (val > 0) ? true : false;
> + nfsd_disable_splice_read = (val > 0);
> return 0;
> }
>
Sure...
Reviewed-by: Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] NFSD: Drop redundant conversion to bool
2025-08-18 10:03 [PATCH] NFSD: Drop redundant conversion to bool Xichao Zhao
2025-08-18 11:43 ` Jeff Layton
@ 2025-08-18 14:01 ` Chuck Lever
1 sibling, 0 replies; 3+ messages in thread
From: Chuck Lever @ 2025-08-18 14:01 UTC (permalink / raw)
To: jlayton, Xichao Zhao
Cc: Chuck Lever, neil, okorniev, Dai.Ngo, tom, linux-nfs,
linux-kernel
From: Chuck Lever <chuck.lever@oracle.com>
On Mon, 18 Aug 2025 18:03:20 +0800, Xichao Zhao wrote:
> The result of integer comparison already evaluates to bool. No need for
> explicit conversion.
>
>
Applied to nfsd-testing, thanks!
[1/1] NFSD: Drop redundant conversion to bool
commit: 1baa19c0b871e309dbbd4e26f244944db2589ac4
--
Chuck Lever
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-18 14:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18 10:03 [PATCH] NFSD: Drop redundant conversion to bool Xichao Zhao
2025-08-18 11:43 ` Jeff Layton
2025-08-18 14:01 ` Chuck Lever
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).