<div dir="ltr">I'm ok with this. I like the subject/verb/direct object naming of the ioctls.<div><br></div><div>--joel</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 4, 2024 at 12:34 PM <<a href="mailto:berndmoessner80@gmail.com">berndmoessner80@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Bernd Moessner <<a href="mailto:berndmoessner80@gmail.com" target="_blank">berndmoessner80@gmail.com</a>><br>
<br>
---<br>
 cpukit/dev/flash/flashdev.c           | 16 ++++++++--------<br>
 cpukit/include/dev/flash/flashdev.h   | 16 ++++++++--------<br>
 cpukit/libmisc/shell/main_flashdev.c  | 12 ++++++------<br>
 testsuites/libtests/flashdev01/init.c | 16 ++++++++--------<br>
 4 files changed, 30 insertions(+), 30 deletions(-)<br>
<br>
diff --git a/cpukit/dev/flash/flashdev.c b/cpukit/dev/flash/flashdev.c<br>
index be85593201..40666290e0 100644<br>
--- a/cpukit/dev/flash/flashdev.c<br>
+++ b/cpukit/dev/flash/flashdev.c<br>
@@ -362,32 +362,32 @@ static int rtems_flashdev_ioctl(<br>
       rtems_flashdev_release( flash );<br>
       err = 0;<br>
       break;<br>
-    case RTEMS_FLASHDEV_IOCTL_JEDEC_ID:<br>
+    case RTEMS_FLASHDEV_IOCTL_GET_JEDEC_ID:<br>
       *( (uint32_t *) arg ) = rtems_flashdev_ioctl_jedec_id( flash );<br>
       err = 0;<br>
       break;<br>
     case RTEMS_FLASHDEV_IOCTL_ERASE:<br>
       err = rtems_flashdev_ioctl_erase( flash, iop, arg );<br>
       break;<br>
-    case RTEMS_FLASHDEV_IOCTL_REGION_SET:<br>
+    case RTEMS_FLASHDEV_IOCTL_SET_REGION:<br>
       err = rtems_flashdev_ioctl_set_region( flash, iop, arg );<br>
       break;<br>
-    case RTEMS_FLASHDEV_IOCTL_REGION_UNSET:<br>
+    case RTEMS_FLASHDEV_IOCTL_UNSET_REGION:<br>
       err = rtems_flashdev_ioctl_clear_region( flash, iop );<br>
       break;<br>
-    case RTEMS_FLASHDEV_IOCTL_TYPE:<br>
+    case RTEMS_FLASHDEV_IOCTL_GET_TYPE:<br>
       err = rtems_flashdev_ioctl_flash_type( flash, arg );<br>
       break;<br>
-    case RTEMS_FLASHDEV_IOCTL_PAGEINFO_BY_OFFSET:<br>
+    case RTEMS_FLASHDEV_IOCTL_GET_PAGEINFO_BY_OFFSET:<br>
       err = rtems_flashdev_ioctl_pageinfo_offset( flash, arg );<br>
       break;<br>
-    case RTEMS_FLASHDEV_IOCTL_PAGEINFO_BY_INDEX:<br>
+    case RTEMS_FLASHDEV_IOCTL_GET_PAGEINFO_BY_INDEX:<br>
       err = rtems_flashdev_ioctl_pageinfo_index( flash, arg );<br>
       break;<br>
-    case RTEMS_FLASHDEV_IOCTL_PAGE_COUNT:<br>
+    case RTEMS_FLASHDEV_IOCTL_GET_PAGE_COUNT:<br>
       err = rtems_flashdev_ioctl_page_count( flash, arg );<br>
       break;<br>
-    case RTEMS_FLASHDEV_IOCTL_WRITE_BLOCK_SIZE:<br>
+    case RTEMS_FLASHDEV_IOCTL_GET_WRITE_BLOCK_SIZE:<br>
       err = rtems_flashdev_ioctl_write_block_size( flash, arg );<br>
       break;<br>
   }<br>
diff --git a/cpukit/include/dev/flash/flashdev.h b/cpukit/include/dev/flash/flashdev.h<br>
index 6759357206..59028a8cba 100644<br>
--- a/cpukit/include/dev/flash/flashdev.h<br>
+++ b/cpukit/include/dev/flash/flashdev.h<br>
@@ -77,7 +77,7 @@ typedef struct rtems_flashdev rtems_flashdev;<br>
  * @param[out] jedec_id Pointer to uint32_t in which the JEDEC ID is<br>
  * returned in.<br>
  */<br>
-#define RTEMS_FLASHDEV_IOCTL_JEDEC_ID 2<br>
+#define RTEMS_FLASHDEV_IOCTL_GET_JEDEC_ID 2<br>
 /**<br>
  * @brief Erases flash device.<br>
  *<br>
@@ -94,20 +94,20 @@ typedef struct rtems_flashdev rtems_flashdev;<br>
  * @param[in] region Pointer to rtems_flashdev_region struct containing<br>
  * base and length of defined region.<br>
  */<br>
-#define RTEMS_FLASHDEV_IOCTL_REGION_SET 4<br>
+#define RTEMS_FLASHDEV_IOCTL_SET_REGION 4<br>
 /**<br>
  * @brief Removes the set region on the file descriptor.<br>
  *<br>
  * This command has no argument.<br>
  */<br>
-#define RTEMS_FLASHDEV_IOCTL_REGION_UNSET 5<br>
+#define RTEMS_FLASHDEV_IOCTL_UNSET_REGION 5<br>
 /**<br>
  * @brief Returns the type of flash device (e.g. NOR or NAND).<br>
  *<br>
  * @param[out] flash_type Pointer to integer which is set to the flash<br>
  * type macro value.<br>
  */<br>
-#define RTEMS_FLASHDEV_IOCTL_TYPE 6<br>
+#define RTEMS_FLASHDEV_IOCTL_GET_TYPE 6<br>
<br>
 /**<br>
  * @brief Get the size and address of flash page at given offset<br>
@@ -118,7 +118,7 @@ typedef struct rtems_flashdev rtems_flashdev;<br>
  * @param[in,out] rtems_flashdev_ioctl_page_info arg Pointer to struct<br>
  * with offset and space for return values.<br>
  */<br>
-#define RTEMS_FLASHDEV_IOCTL_PAGEINFO_BY_OFFSET 7<br>
+#define RTEMS_FLASHDEV_IOCTL_GET_PAGEINFO_BY_OFFSET 7<br>
<br>
 /**<br>
  * @brief Get the size and address of nth flash page where n is index passed in.<br>
@@ -128,21 +128,21 @@ typedef struct rtems_flashdev rtems_flashdev;<br>
  * @param[in,out] rtems_flashdev_ioctl_page_info arg Pointer to struct<br>
  * with index and space for return values.<br>
  */<br>
-#define RTEMS_FLASHDEV_IOCTL_PAGEINFO_BY_INDEX 8<br>
+#define RTEMS_FLASHDEV_IOCTL_GET_PAGEINFO_BY_INDEX 8<br>
<br>
 /**<br>
  * @brief Get the number of pages in flash device.<br>
  *<br>
  * @param[out] count Integer containing the number of pages.<br>
  */<br>
-#define RTEMS_FLASHDEV_IOCTL_PAGE_COUNT 9<br>
+#define RTEMS_FLASHDEV_IOCTL_GET_PAGE_COUNT 9<br>
<br>
 /**<br>
  * @brief Get the minimum write size supported by the driver.<br>
  *<br>
  * @param[out] count Integer containing the minimum write size.<br>
  */<br>
-#define RTEMS_FLASHDEV_IOCTL_WRITE_BLOCK_SIZE 10<br>
+#define RTEMS_FLASHDEV_IOCTL_GET_WRITE_BLOCK_SIZE 10<br>
<br>
 /**<br>
  * @brief The maximum number of region limited file descriptors<br>
diff --git a/cpukit/libmisc/shell/main_flashdev.c b/cpukit/libmisc/shell/main_flashdev.c<br>
index ca2454b33c..969b0687d2 100644<br>
--- a/cpukit/libmisc/shell/main_flashdev.c<br>
+++ b/cpukit/libmisc/shell/main_flashdev.c<br>
@@ -385,7 +385,7 @@ int flashdev_shell_type( char *dev_path )<br>
   /* Get type */<br>
   status = flashdev_shell_ioctl_value(<br>
     dev_path,<br>
-    RTEMS_FLASHDEV_IOCTL_TYPE,<br>
+    RTEMS_FLASHDEV_IOCTL_GET_TYPE,<br>
     &type<br>
   );<br>
<br>
@@ -416,7 +416,7 @@ int flashdev_shell_jedecid( char *dev_path ) {<br>
   /* Get JEDEC Id */<br>
   status = flashdev_shell_ioctl_value(<br>
     dev_path,<br>
-    RTEMS_FLASHDEV_IOCTL_JEDEC_ID,<br>
+    RTEMS_FLASHDEV_IOCTL_GET_JEDEC_ID,<br>
     &ret<br>
   );<br>
<br>
@@ -440,7 +440,7 @@ static int flashdev_shell_page_off(<br>
     dev_path,<br>
     argc,<br>
     argv,<br>
-    RTEMS_FLASHDEV_IOCTL_PAGEINFO_BY_OFFSET<br>
+    RTEMS_FLASHDEV_IOCTL_GET_PAGEINFO_BY_OFFSET<br>
   );<br>
 }<br>
<br>
@@ -454,7 +454,7 @@ static int flashdev_shell_page_idx(<br>
     dev_path,<br>
     argc,<br>
     argv,<br>
-    RTEMS_FLASHDEV_IOCTL_PAGEINFO_BY_INDEX<br>
+    RTEMS_FLASHDEV_IOCTL_GET_PAGEINFO_BY_INDEX<br>
   );<br>
 }<br>
<br>
@@ -466,7 +466,7 @@ static int flashdev_shell_pg_count( char *dev_path )<br>
   /* Get Page Count */<br>
   status = flashdev_shell_ioctl_value(<br>
     dev_path,<br>
-    RTEMS_FLASHDEV_IOCTL_PAGE_COUNT,<br>
+    RTEMS_FLASHDEV_IOCTL_GET_PAGE_COUNT,<br>
     &ret<br>
   );<br>
<br>
@@ -488,7 +488,7 @@ static int flashdev_shell_wb_size( char *dev_path )<br>
   /* Get Write Block Size */<br>
   status = flashdev_shell_ioctl_value(<br>
     dev_path,<br>
-    RTEMS_FLASHDEV_IOCTL_WRITE_BLOCK_SIZE,<br>
+    RTEMS_FLASHDEV_IOCTL_GET_WRITE_BLOCK_SIZE,<br>
     &ret<br>
   );<br>
<br>
diff --git a/testsuites/libtests/flashdev01/init.c b/testsuites/libtests/flashdev01/init.c<br>
index 6ce9709496..30af3f33c1 100644<br>
--- a/testsuites/libtests/flashdev01/init.c<br>
+++ b/testsuites/libtests/flashdev01/init.c<br>
@@ -103,44 +103,44 @@ static void run_test(void) {<br>
   rtems_test_assert(buff[0] == 0);<br>
<br>
   /* Test getting JEDEC ID */<br>
-  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_JEDEC_ID, &jedec);<br>
+  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_GET_JEDEC_ID, &jedec);<br>
   rtems_test_assert(!status);<br>
   rtems_test_assert(jedec == 0x00ABCDEF);<br>
<br>
   /* Test getting flash type */<br>
-  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_TYPE, &type);<br>
+  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_GET_TYPE, &type);<br>
   rtems_test_assert(!status);<br>
   rtems_test_assert(type == RTEMS_FLASHDEV_NOR);<br>
<br>
   /* Test getting page info from offset */<br>
   pg_info.location = PAGE_SIZE + PAGE_SIZE/2;<br>
<br>
-  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_PAGEINFO_BY_OFFSET, &pg_info);<br>
+  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_GET_PAGEINFO_BY_OFFSET, &pg_info);<br>
   rtems_test_assert(!status);<br>
   rtems_test_assert(pg_info.page_info.offset == PAGE_SIZE);<br>
   rtems_test_assert(pg_info.page_info.size == PAGE_SIZE);<br>
<br>
   /* Test getting page info from index */<br>
   pg_info.location = 2;<br>
-  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_PAGEINFO_BY_INDEX, &pg_info);<br>
+  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_GET_PAGEINFO_BY_INDEX, &pg_info);<br>
   rtems_test_assert(!status);<br>
   rtems_test_assert(pg_info.page_info.offset == 2*PAGE_SIZE);<br>
   rtems_test_assert(pg_info.page_info.size == PAGE_SIZE);<br>
<br>
   /* Test getting page count */<br>
-  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_PAGE_COUNT, &page_count);<br>
+  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_GET_PAGE_COUNT, &page_count);<br>
   rtems_test_assert(!status);<br>
   rtems_test_assert(page_count == PAGE_COUNT);<br>
<br>
   /* Test getting write block size */<br>
-  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_WRITE_BLOCK_SIZE, &wb_size);<br>
+  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_GET_WRITE_BLOCK_SIZE, &wb_size);<br>
   rtems_test_assert(!status);<br>
   rtems_test_assert(wb_size == WB_SIZE);<br>
<br>
   /* Test Regions */<br>
   region.offset = 0x400;<br>
   region.size = 0x200;<br>
-  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_REGION_SET, &region);<br>
+  status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_SET_REGION, &region);<br>
   rtems_test_assert(!status);<br>
<br>
   /* Test read to larger then region */<br>
@@ -155,7 +155,7 @@ static void run_test(void) {<br>
   /* Write to base unset region and check the writes location */<br>
   fseek(file, 0x0, SEEK_SET);<br>
   fwrite("HELLO WORLD", 11, 1, file);<br>
-  ioctl(fd, RTEMS_FLASHDEV_IOCTL_REGION_UNSET, NULL);<br>
+  ioctl(fd, RTEMS_FLASHDEV_IOCTL_UNSET_REGION, NULL);<br>
   fseek(file, 0x400, SEEK_SET);<br>
   fgets(buff, 11, file);<br>
   rtems_test_assert(strncmp(buff, "HELLO WORLD", 11));<br>
-- <br>
2.34.1<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>