cmd: spl: annotate switch/case fallthrough
authorAndre Przywara <andre.przywara@arm.com>
Thu, 27 Mar 2025 15:33:12 +0000 (15:33 +0000)
committerTom Rini <trini@konsulko.com>
Tue, 8 Apr 2025 22:23:51 +0000 (16:23 -0600)
The argument parsing in the SPL configuration command uses an implicit
switch/case fallthrough when dealing with a different number of
arguments.

Add our "fallthrough;" statement-like macro before the respective labels
in the bootm code, to avoid a warning when GCC's -Wimplicit-fallthrough
warning option is enabled.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
cmd/spl.c

index 76fe337..379b512 100644 (file)
--- a/cmd/spl.c
+++ b/cmd/spl.c
@@ -60,8 +60,10 @@ static int call_bootm(int argc, char *const argv[], const char *subcommand[])
        switch (argc) {
        case 3:
                bootm_argv[4] = argv[2]; /* fdt addr */
+               fallthrough;
        case 2:
                bootm_argv[3] = argv[1]; /* initrd addr */
+               fallthrough;
        case 1:
                bootm_argv[2] = argv[0]; /* kernel addr */
        }