diff mbox

[U-Boot,RFC,08/22] dm: Use '*' to indicate a device is activated

Message ID 1400966481-14131-9-git-send-email-sjg@chromium.org
State RFC
Headers show

Commit Message

Simon Glass May 24, 2014, 9:21 p.m. UTC
Make both dm enumeration commands support showing whether a driver is active
or not, and use a consistent indicator (an asterisk).

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 test/dm/cmd_dm.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

Jon Loeliger May 27, 2014, 2:25 p.m. UTC | #1
Why is '*' better than 'active' here?

At the very least, you need to convince me in the
log message.

Thanks,
jdl


On Sat, May 24, 2014 at 4:21 PM, Simon Glass <sjg@chromium.org> wrote:
> Make both dm enumeration commands support showing whether a driver is active
> or not, and use a consistent indicator (an asterisk).
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  test/dm/cmd_dm.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c
> index c6b2eb8..ee02314 100644
> --- a/test/dm/cmd_dm.c
> +++ b/test/dm/cmd_dm.c
> @@ -23,9 +23,9 @@ static int display_succ(struct device *in, char *buf)
>         char local[16];
>         struct device *pos, *n, *prev = NULL;
>
> -       printf("%s- %s @ %08x", buf, in->name, (uint)map_to_sysmem(in));
> -       if (in->flags & DM_FLAG_ACTIVATED)
> -               puts(" - activated");
> +       printf("%s- %c %s @ %08x", buf,
> +              in->flags & DM_FLAG_ACTIVATED ? '*' : ' ',
> +              in->name, (uint)map_to_sysmem(in));
>         puts("\n");
>
>         if (list_empty(&in->child_head))
> @@ -84,8 +84,9 @@ static int do_dm_dump_uclass(cmd_tbl_t *cmdtp, int flag, int argc,
>                 for (ret = uclass_first_device(id, &dev);
>                      dev;
>                      ret = uclass_next_device(&dev)) {
> -                       printf("  %s @ %08x:\n", dev->name,
> -                              (uint)map_to_sysmem(dev));
> +                       printf("  %c %s @ %08x:\n",
> +                              dev->flags & DM_FLAG_ACTIVATED ? '*' : ' ',
> +                              dev->name, (uint)map_to_sysmem(dev));
>                 }
>                 puts("\n");
>         }
> --
> 1.9.1.423.g4596e3a
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
Simon Glass May 30, 2014, 2:37 p.m. UTC | #2
Hi Jon,

On 27 May 2014 08:25, Jon Loeliger <loeliger@gmail.com> wrote:
> Why is '*' better than 'active' here?
>
> At the very least, you need to convince me in the
> log message.

I'll add something like this:

    This is more consise that using the word 'activated' and easily fits in the
    left side of the display, thus appears in the same column on each line. It
    is therefore easier to see which devices are activated.

Regards,
Simon
Marek Vasut June 1, 2014, 5:35 p.m. UTC | #3
On Tuesday, May 27, 2014 at 04:25:31 PM, Jon Loeliger wrote:
> Why is '*' better than 'active' here?
> 
> At the very least, you need to convince me in the
> log message.

Please stop top-posting ;-)

The asterisk is wasting less space and it's pretty clear anyway.

Please add my:

Acked-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut
Simon Glass June 21, 2014, 4:14 p.m. UTC | #4
On 24 May 2014 15:21, Simon Glass <sjg@chromium.org> wrote:
> Make both dm enumeration commands support showing whether a driver is active
> or not, and use a consistent indicator (an asterisk).
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  test/dm/cmd_dm.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>

Rebased to master and applied to u-boot-dm/master.
diff mbox

Patch

diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c
index c6b2eb8..ee02314 100644
--- a/test/dm/cmd_dm.c
+++ b/test/dm/cmd_dm.c
@@ -23,9 +23,9 @@  static int display_succ(struct device *in, char *buf)
 	char local[16];
 	struct device *pos, *n, *prev = NULL;
 
-	printf("%s- %s @ %08x", buf, in->name, (uint)map_to_sysmem(in));
-	if (in->flags & DM_FLAG_ACTIVATED)
-		puts(" - activated");
+	printf("%s- %c %s @ %08x", buf,
+	       in->flags & DM_FLAG_ACTIVATED ? '*' : ' ',
+	       in->name, (uint)map_to_sysmem(in));
 	puts("\n");
 
 	if (list_empty(&in->child_head))
@@ -84,8 +84,9 @@  static int do_dm_dump_uclass(cmd_tbl_t *cmdtp, int flag, int argc,
 		for (ret = uclass_first_device(id, &dev);
 		     dev;
 		     ret = uclass_next_device(&dev)) {
-			printf("  %s @ %08x:\n", dev->name,
-			       (uint)map_to_sysmem(dev));
+			printf("  %c %s @ %08x:\n",
+			       dev->flags & DM_FLAG_ACTIVATED ? '*' : ' ',
+			       dev->name, (uint)map_to_sysmem(dev));
 		}
 		puts("\n");
 	}