]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
mtd: ubi: annotate fallthrough
authorAndre Przywara <andre.przywara@arm.com>
Thu, 27 Mar 2025 15:33:07 +0000 (15:33 +0000)
committerTom Rini <trini@konsulko.com>
Tue, 8 Apr 2025 22:23:51 +0000 (16:23 -0600)
The UBI code uses an implicit switch/case fallthrough when handling two
related cases of bad header errors. Also there is a switch/case for unit
prefix handling (G/M/K), which accumulates multiplications.

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

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
drivers/mtd/ubi/attach.c
drivers/mtd/ubi/build.c

index 2ef8fde3d3249240e85d29f19aff5160a5e86f0e..306da509ec4cf90cfaf1c31af8c92e64f637850f 100644 (file)
@@ -934,6 +934,7 @@ static int scan_peb(struct ubi_device *ubi, struct ubi_attach_info *ai,
                         * be a result of power cut during erasure.
                         */
                        ai->maybe_bad_peb_count += 1;
+               fallthrough;
        case UBI_IO_BAD_HDR:
                if (ec_err)
                        /*
index 104537784abb2ae2f9618c755286a446267a31bd..50e43928af08a413c419837e85094de5eab6d632 100644 (file)
@@ -1400,12 +1400,15 @@ static int __init bytes_str_to_int(const char *str)
        switch (*endp) {
        case 'G':
                result *= 1024;
+               fallthrough;
        case 'M':
                result *= 1024;
+               fallthrough;
        case 'K':
                result *= 1024;
                if (endp[1] == 'i' && endp[2] == 'B')
                        endp += 2;
+               fallthrough;
        case '\0':
                break;
        default: