[PATCH] NFSD: Drop redundant conversion to bool

Xichao Zhao posted 1 patch 1 month, 2 weeks ago
fs/nfsd/debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] NFSD: Drop redundant conversion to bool
Posted by Xichao Zhao 1 month, 2 weeks ago
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
Re: [PATCH] NFSD: Drop redundant conversion to bool
Posted by Chuck Lever 1 month, 2 weeks ago
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
Re: [PATCH] NFSD: Drop redundant conversion to bool
Posted by Jeff Layton 1 month, 2 weeks ago
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>