]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fiptool: print new lines of usage to stdout instead of stderr
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 2 Feb 2017 07:34:14 +0000 (16:34 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 11 Feb 2017 04:00:27 +0000 (13:00 +0900)
The strings in usage functions are sent to stdout by printf(),
but some new lines are sent to stderr by fputc(..., stderr).

This inconsistency will break the usage format when users re-direct
stdout or stderr.  Just use printf() for consistency.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
tools/fiptool/fiptool.c

index 865aeae1d900c369b045a130541808f05d1fc8b0..8cf7ecec5dfceb1e639d465a5f8ed80d2655691e 100644 (file)
@@ -826,7 +826,7 @@ static void create_usage(void)
            "pointed to by file.\n");
        printf("  --plat-toc-flags <value>\t16-bit platform specific flag field "
            "occupying bits 32-47 in 64-bit ToC header.\n");
-       fputc('\n', stderr);
+       printf("\n");
        printf("Specific images are packed with the following options:\n");
        for (; toc_entry->cmdline_name != NULL; toc_entry++)
                printf("  --%-16s FILENAME\t%s\n", toc_entry->cmdline_name,
@@ -943,7 +943,7 @@ static void update_usage(void)
        printf("  --out FIP_FILENAME\t\tSet an alternative output FIP file.\n");
        printf("  --plat-toc-flags <value>\t16-bit platform specific flag field "
            "occupying bits 32-47 in 64-bit ToC header.\n");
-       fputc('\n', stderr);
+       printf("\n");
        printf("Specific images are packed with the following options:\n");
        for (; toc_entry->cmdline_name != NULL; toc_entry++)
                printf("  --%-16s FILENAME\t%s\n", toc_entry->cmdline_name,
@@ -1081,12 +1081,12 @@ static void unpack_usage(void)
        printf("  --force\t\t\tIf the output file already exists, use --force to "
            "overwrite it.\n");
        printf("  --out path\t\t\tSet the output directory path.\n");
-       fputc('\n', stderr);
+       printf("\n");
        printf("Specific images are unpacked with the following options:\n");
        for (; toc_entry->cmdline_name != NULL; toc_entry++)
                printf("  --%-16s FILENAME\t%s\n", toc_entry->cmdline_name,
                    toc_entry->name);
-       fputc('\n', stderr);
+       printf("\n");
        printf("If no options are provided, all images will be unpacked.\n");
        exit(1);
 }
@@ -1210,7 +1210,7 @@ static void remove_usage(void)
        printf("  --force\t\tIf the output FIP file already exists, use --force to "
            "overwrite it.\n");
        printf("  --out FIP_FILENAME\tSet an alternative output FIP file.\n");
-       fputc('\n', stderr);
+       printf("\n");
        printf("Specific images are removed with the following options:\n");
        for (; toc_entry->cmdline_name != NULL; toc_entry++)
                printf("  --%-16s\t%s\n", toc_entry->cmdline_name,
@@ -1258,7 +1258,7 @@ static void usage(void)
        printf("usage: fiptool [--verbose] <command> [<args>]\n");
        printf("Global options supported:\n");
        printf("  --verbose\tEnable verbose output for all commands.\n");
-       fputc('\n', stderr);
+       printf("\n");
        printf("Commands supported:\n");
        printf("  info\t\tList images contained in FIP.\n");
        printf("  create\tCreate a new FIP with the given images.\n");