Thanks for the patch Mohammad.

Sanjay, I thought we detect terminal size at startup. Can we change this dynamically?


On Mon, Apr 21, 2014 at 1:44 PM, Mohammad Merajul Islam Molla <meraj.enigma@gmail.com> wrote:
Hello,


While displaying information about "Regulators" output becomes really messy (zig zag) on Samsung Arndale Board (Exynos 5250, Cortex A-15). It looks like the output field size "11" for printing regulator name is not enough. Some regulators have longer names. Hence proposing to increase this field size to a higher value, i.e. 25.

Patch goes here - 
----------------------------

diff --git a/regulator.c b/regulator.c

index 9cd89fd..045cceb 100644

--- a/regulator.c

+++ b/regulator.c

@@ -127,7 +127,7 @@ static int regulator_display_cb(struct tree *t, void *data)

        if (!strlen(reg->name))

                return 0;


-       if (asprintf(&buf, "%-11s %-11s %-11s %-11s %-11d %-11d %-11d %-12d",

+       if (asprintf(&buf, "%-25s %-11s %-11s %-11s %-11d %-11d %-11d %-12d",

                     reg->name, reg->status, reg->state, reg->type,

                     reg->num_users, reg->microvolts, reg->min_microvolts,

                     reg->max_microvolts) < 0)

@@ -147,7 +147,7 @@ static int regulator_print_header(void)

        char *buf;

        int ret;


-       if (asprintf(&buf, "%-11s %-11s %-11s %-11s %-11s %-11s %-11s %-12s",

+       if (asprintf(&buf, "%-25s %-11s %-11s %-11s %-11s %-11s %-11s %-12s",

                     "Name", "Status", "State", "Type", "Users", "Microvolts",

                     "Min u-volts", "Max u-volts") < 0)

                return -1;



​--
Thanks,
-Meraj

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev