linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/mm: use long for dwRegionSize
@ 2025-04-27 10:26 Siddarth G
  2025-04-28  0:13 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Siddarth G @ 2025-04-27 10:26 UTC (permalink / raw)
  To: akpm; +Cc: shuah, linux-kernel, linux-kselftest, linux-mm, Siddarth G

Change the type of 'dwRegionSize' in wp_init() and wp_free()
from int to long to match callers that pass long or
unsigned long long values.

wp_addr_range function is left unchanged because it passes
'dwRegionSize' parameter directly to pagemap_ioctl, which expects
an int.

Signed-off-by: Siddarth G <siddarthsgml@gmail.com>
---
 tools/testing/selftests/mm/pagemap_ioctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c
index 57b4bba2b45f..5773666f07ea 100644
--- a/tools/testing/selftests/mm/pagemap_ioctl.c
+++ b/tools/testing/selftests/mm/pagemap_ioctl.c
@@ -112,7 +112,7 @@ int init_uffd(void)
 	return 0;
 }
 
-int wp_init(void *lpBaseAddress, int dwRegionSize)
+int wp_init(void *lpBaseAddress, long dwRegionSize)
 {
 	struct uffdio_register uffdio_register;
 	struct uffdio_writeprotect wp;
@@ -136,7 +136,7 @@ int wp_init(void *lpBaseAddress, int dwRegionSize)
 	return 0;
 }
 
-int wp_free(void *lpBaseAddress, int dwRegionSize)
+int wp_free(void *lpBaseAddress, long dwRegionSize)
 {
 	struct uffdio_register uffdio_register;
 
-- 
2.43.0



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

* Re: [PATCH] selftests/mm: use long for dwRegionSize
  2025-04-27 10:26 [PATCH] selftests/mm: use long for dwRegionSize Siddarth G
@ 2025-04-28  0:13 ` Andrew Morton
  2025-04-28  8:27   ` siddarth
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2025-04-28  0:13 UTC (permalink / raw)
  To: Siddarth G; +Cc: shuah, linux-kernel, linux-kselftest, linux-mm

On Sun, 27 Apr 2025 15:56:39 +0530 Siddarth G <siddarthsgml@gmail.com> wrote:

> Change the type of 'dwRegionSize' in wp_init() and wp_free()
> from int to long to match callers that pass long or
> unsigned long long values.
> 
> wp_addr_range function is left unchanged because it passes
> 'dwRegionSize' parameter directly to pagemap_ioctl, which expects
> an int.

Thanks.  Does this fix any known compile-time or runtime issues?


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

* Re: [PATCH] selftests/mm: use long for dwRegionSize
  2025-04-28  0:13 ` Andrew Morton
@ 2025-04-28  8:27   ` siddarth
  0 siblings, 0 replies; 3+ messages in thread
From: siddarth @ 2025-04-28  8:27 UTC (permalink / raw)
  To: Andrew Morton; +Cc: shuah, linux-kernel, linux-kselftest, linux-mm

[-- Attachment #1: Type: text/plain, Size: 1286 bytes --]

On Mon, Apr 28, 2025 at 5:43 AM Andrew Morton <akpm@linux-foundation.org>
wrote:

> On Sun, 27 Apr 2025 15:56:39 +0530 Siddarth G <siddarthsgml@gmail.com>
> wrote:
>
> > Change the type of 'dwRegionSize' in wp_init() and wp_free()
> > from int to long to match callers that pass long or
> > unsigned long long values.
> >
> > wp_addr_range function is left unchanged because it passes
> > 'dwRegionSize' parameter directly to pagemap_ioctl, which expects
> > an int.
>
> Thanks.  Does this fix any known compile-time or runtime issues?
>

On Mon, Apr 28, 2025 at 5:43 AM Andrew Morton <akpm@linux-foundation.org>
wrote:
On Sun, 27 Apr 2025 15:56:39 +0530 Siddarth G <siddarthsgml@gmail.com>
wrote:

> Change the type of 'dwRegionSize' in wp_init() and wp_free()
> from int to long to match callers that pass long or
> unsigned long long values.
>
> wp_addr_range function is left unchanged because it passes
> 'dwRegionSize' parameter directly to pagemap_ioctl, which expects
> an int.

Thanks.  Does this fix any known compile-time or runtime issues?
Hi, thanks for the review. This patch does not fix any actual known issues.
It aligns parameter types with their actual usage and avoids any potential
future issues.

With gratitude
Siddarth G

[-- Attachment #2: Type: text/html, Size: 1926 bytes --]

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

end of thread, other threads:[~2025-04-28  8:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-27 10:26 [PATCH] selftests/mm: use long for dwRegionSize Siddarth G
2025-04-28  0:13 ` Andrew Morton
2025-04-28  8:27   ` siddarth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox