linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lib/test_hmm: drop redundant conversion to bool
@ 2025-08-19  7:04 Xichao Zhao
  2025-08-27 23:59 ` Alistair Popple
  0 siblings, 1 reply; 2+ messages in thread
From: Xichao Zhao @ 2025-08-19  7:04 UTC (permalink / raw)
  To: jgg, leon, akpm; +Cc: linux-mm, linux-kernel, Xichao Zhao

The result of integer comparison already evaluates to bool. No need for
explicit conversion.

No functional impact.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 lib/test_hmm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/test_hmm.c b/lib/test_hmm.c
index 761725bc713c..83e3d8208a54 100644
--- a/lib/test_hmm.c
+++ b/lib/test_hmm.c
@@ -140,7 +140,7 @@ static int dmirror_bounce_init(struct dmirror_bounce *bounce,
 static bool dmirror_is_private_zone(struct dmirror_device *mdevice)
 {
 	return (mdevice->zone_device_type ==
-		HMM_DMIRROR_MEMORY_DEVICE_PRIVATE) ? true : false;
+		HMM_DMIRROR_MEMORY_DEVICE_PRIVATE);
 }
 
 static enum migrate_vma_direction
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] lib/test_hmm: drop redundant conversion to bool
  2025-08-19  7:04 [PATCH] lib/test_hmm: drop redundant conversion to bool Xichao Zhao
@ 2025-08-27 23:59 ` Alistair Popple
  0 siblings, 0 replies; 2+ messages in thread
From: Alistair Popple @ 2025-08-27 23:59 UTC (permalink / raw)
  To: Xichao Zhao; +Cc: jgg, leon, akpm, linux-mm, linux-kernel

On 2025-08-19 at 17:04 +1000, Xichao Zhao <zhao.xichao@vivo.com> wrote...
> The result of integer comparison already evaluates to bool. No need for
> explicit conversion.

Seems reasonable.

Reviewed-by: Alistair Popple <apopple@nvidia.com>

> No functional impact.
> 
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
>  lib/test_hmm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/test_hmm.c b/lib/test_hmm.c
> index 761725bc713c..83e3d8208a54 100644
> --- a/lib/test_hmm.c
> +++ b/lib/test_hmm.c
> @@ -140,7 +140,7 @@ static int dmirror_bounce_init(struct dmirror_bounce *bounce,
>  static bool dmirror_is_private_zone(struct dmirror_device *mdevice)
>  {
>  	return (mdevice->zone_device_type ==
> -		HMM_DMIRROR_MEMORY_DEVICE_PRIVATE) ? true : false;
> +		HMM_DMIRROR_MEMORY_DEVICE_PRIVATE);
>  }
>  
>  static enum migrate_vma_direction
> -- 
> 2.34.1
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-27 23:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19  7:04 [PATCH] lib/test_hmm: drop redundant conversion to bool Xichao Zhao
2025-08-27 23:59 ` Alistair Popple

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).