[PATCH] testsuites/flashdev01: Use correct page_size type

Kinsey Moore kinsey.moore at oarcorp.com
Fri Jun 9 16:15:53 UTC 2023


The page size ioctl requires an int pointer to retrieve the page size.
The test currently uses a size_t which mostly works fine for systems
where size_t and int are the same size, but can leave junk data in the
upper bits when they differ in size causing an assert in the test to
fail in some cases. This updates the variable to the correct type.
---
 testsuites/libtests/flashdev01/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuites/libtests/flashdev01/init.c b/testsuites/libtests/flashdev01/init.c
index 8896ad796c..6ce9709496 100644
--- a/testsuites/libtests/flashdev01/init.c
+++ b/testsuites/libtests/flashdev01/init.c
@@ -57,7 +57,7 @@ static void run_test(void) {
   rtems_flashdev_ioctl_page_info pg_info;
   rtems_flashdev_region region;
   uint32_t jedec;
-  size_t page_count;
+  int page_count;
   int type;
   size_t wb_size;
 
-- 
2.30.2



More information about the devel mailing list