<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div>This should be merged with a previous patch.</div><div><br></div><div>Kinsey<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 4, 2024 at 12:35 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         | 6 +++---<br>
 cpukit/include/dev/flash/flashdev.h | 6 ++++++<br>
 2 files changed, 9 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/cpukit/dev/flash/flashdev.c b/cpukit/dev/flash/flashdev.c<br>
index ee06007a53..b3cec5af35 100644<br>
--- a/cpukit/dev/flash/flashdev.c<br>
+++ b/cpukit/dev/flash/flashdev.c<br>
@@ -40,6 +40,7 @@<br>
 #include <string.h><br>
 #include <unistd.h><br>
 #include <assert.h><br>
+#include <inttypes.h><br>
<br>
 #define RTEMS_FLASHDEV_MAX_PARTITIONS 16<br>
 #define RTEMS_FLASHDEV_PARTITION_ALLOC_FULL 0xFFFFFFFFUL<br>
@@ -316,9 +317,8 @@ static int rtems_flashdev_do_init(<br>
   void ( *destroy )( rtems_flashdev *flash )<br>
 )<br>
 {<br>
-  char mtx_name[19];<br>
-  sprintf(mtx_name, "FDEV_MTX_%08x", (unsigned int) flash);<br>
-  rtems_recursive_mutex_init( &flash->mutex, (const char*) &mtx_name);<br>
+  sprintf(flash->mtx_name, "FDEV_MTX_%" PRIXPTR, (uintptr_t) flash);<br>
+  rtems_recursive_mutex_init( &flash->mutex, (const char*) flash->mtx_name);<br>
   flash->destroy = destroy;<br>
   flash->read = NULL;<br>
   flash->write = NULL;<br>
diff --git a/cpukit/include/dev/flash/flashdev.h b/cpukit/include/dev/flash/flashdev.h<br>
index 7d7a70f5bc..47b488abe3 100644<br>
--- a/cpukit/include/dev/flash/flashdev.h<br>
+++ b/cpukit/include/dev/flash/flashdev.h<br>
@@ -427,6 +427,12 @@ struct rtems_flashdev {<br>
    * @brief Partition table<br>
    */<br>
   rtems_flashdev_partition *partition_table;<br>
+<br>
+  /**<br>
+   * @brief Storage for mutex name<br>
+   */<br>
+  char mtx_name[10 + sizeof(uintptr_t)];<br>
+<br>
 };<br>
<br>
 /**<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>