[PATCH v1 4/4] libmisc/shell: Improve print messages for flashdev command

Kinsey Moore kinsey.moore at oarcorp.com
Thu Oct 19 13:32:07 UTC 2023


This patch looks good.

On Thu, Oct 19, 2023 at 12:43 AM <aaron.nyholm at unfoldedeffective.com> wrote:

> From: Aaron Nyholm <aaron.nyholm at southerninnovation.com>
>
> ---
>  cpukit/libmisc/shell/main_flashdev.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/cpukit/libmisc/shell/main_flashdev.c
> b/cpukit/libmisc/shell/main_flashdev.c
> index ca2454b33c..dc73d3f9db 100644
> --- a/cpukit/libmisc/shell/main_flashdev.c
> +++ b/cpukit/libmisc/shell/main_flashdev.c
> @@ -199,7 +199,7 @@ int flashdev_shell_read(
>    }
>
>    /* Print buffer out in 32bit blocks */
> -  printf("Reading %s at 0x%08x for %d bytes\n", dev_path, address, bytes);
> +  printf("Reading %s at 0x%08x for 0x%x bytes\n", dev_path, address,
> bytes);
>    for (int i = 0; i < (bytes/4); i++) {
>      printf("%08x ", ((uint32_t*)buffer)[i]);
>      if ((i+1)%4 == 0) {
> @@ -281,6 +281,13 @@ int flashdev_shell_write(
>      return -1;
>    }
>
> +  printf(
> +    "Writing %s to %s at 0x%08x for 0x%jx bytes\n",
> +    file_path,
> +    dev_path,
> +    address,
> +    length
> +  );
>    /* Create buffer */
>    buffer = calloc(1, 0x1000);
>
> @@ -358,7 +365,7 @@ int flashdev_shell_erase(
>      return -1;
>    }
>
> -  printf("Erasing at %08x for %x bytes\n", address, bytes);
> +  printf("Erasing at 0x%08x for 0x%x bytes\n", address, bytes);
>
>    /* Erase flash */
>    args.offset = address;
> --
> 2.25.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20231019/3f35b9f1/attachment.htm>


More information about the devel mailing list