]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tools: avoid implicit fallthrough in fdt_add_pubkey
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 1 Apr 2023 06:09:34 +0000 (08:09 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 6 Apr 2023 23:10:08 +0000 (19:10 -0400)
When building with -Wimplicit-fallthrough we get a warning

    tools/fdt_add_pubkey.c:52:25: warning:
    this statement may fall through [-Wimplicit-fallthrough=]
       52 |                         print_help();
          |

Explicitly declare which functions don't return.

Fixes: 30238e99619c ("tools: add fdt_add_pubkey")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/fdt_add_pubkey.c

index 999f5a7e83b7b92d796ce80e8f06a6aa73331bb4..5582d7a8efe7b7840f7512067135bd00b3cd682e 100644 (file)
@@ -10,7 +10,7 @@ static const char *keyname = "key"; /* -n <keyname> */
 static const char *require_keys; /* -r <conf|image> */
 static const char *keydest; /* argv[n] */
 
-static void print_usage(const char *msg)
+static void __attribute__((__noreturn__)) print_usage(const char *msg)
 {
        fprintf(stderr, "Error: %s\n", msg);
        fprintf(stderr, "Usage: %s [-a <algo>] [-k <keydir>] [-n <keyname>] [-r <conf|image>]"
@@ -19,7 +19,7 @@ static void print_usage(const char *msg)
        exit(EXIT_FAILURE);
 }
 
-static void print_help(void)
+static void __attribute__((__noreturn__)) print_help(void)
 {
        fprintf(stderr, "Options:\n"
                "\t-a <algo>       Cryptographic algorithm. Optional parameter, default value: sha1,rsa2048\n"