On Thu, Jan 4, 2024 at 12:35 PM <[email protected]> wrote:

> From: Bernd Moessner <[email protected]>
>
> ---
>  cpukit/dev/flash/flashdev.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/cpukit/dev/flash/flashdev.c b/cpukit/dev/flash/flashdev.c
> index 8bd3d11246..0020e8d2c1 100644
> --- a/cpukit/dev/flash/flashdev.c
> +++ b/cpukit/dev/flash/flashdev.c
> @@ -34,6 +34,7 @@
>
>  #include <errno.h>
>  #include <fcntl.h>
> +#include <stdio.h>
>  #include <stdlib.h>
>  #include <string.h>
>  #include <unistd.h>
> @@ -490,7 +491,9 @@ static int rtems_flashdev_do_init(
>    void ( *destroy )( rtems_flashdev *flash )
>  )
>  {
> -  rtems_recursive_mutex_init( &flash->mutex, "RTEMS_FLASHDEV Flash" );
> +  char mtx_name[19];
> +  sprintf(mtx_name, "FDEV_MTX_%08x", (unsigned int) flash);
> +  rtems_recursive_mutex_init( &flash->mutex, (const char*) &mtx_name);
>

None of the other uses of mutexes in cpukit differentiate between various
instantiations and the information you've added here is already available
if you know the mutex address and know that it's a flash mutex.

Is there a reason this needs to differentiate between the various instances
where others don't?

Kinsey
_______________________________________________
devel mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to