[PATCH] selftests/mm: use long for dwRegionSize

Siddarth G posted 1 patch 7 months, 3 weeks ago
tools/testing/selftests/mm/pagemap_ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] selftests/mm: use long for dwRegionSize
Posted by Siddarth G 7 months, 3 weeks ago
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
Re: [PATCH] selftests/mm: use long for dwRegionSize
Posted by Andrew Morton 7 months, 3 weeks ago
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?