From: Andre Przywara Date: Thu, 27 Mar 2025 15:33:10 +0000 (+0000) Subject: mtd: rawnand: nand_base: annotate switch/case fallthrough X-Git-Tag: v2025.07-rc1~108^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f61113c276ffe52380cec159b47e6024249ee2d;p=pandora-u-boot.git mtd: rawnand: nand_base: annotate switch/case fallthrough The raw NAND flash code uses an implicit switch/case fallthrough to share code when dealing with different ECC modes, and also when handling some read command. Add our "fallthrough;" statement-like macro before the respective labels in the NAND code, to avoid a warning when GCC's -Wimplicit-fallthrough warning option is enabled. This copies the fallthrough annotations that the original kernel code gained, before this function got refactored there. Signed-off-by: Andre Przywara Reviewed-by: Michael Trimrachi --- diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 1b65c6f6443..daf12807c67 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -774,6 +774,7 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command, NAND_NCE | NAND_CTRL_CHANGE); /* This applies to read commands */ + fallthrough; default: /* * If we don't have access to the busy pin, we apply the given @@ -4974,6 +4975,7 @@ int nand_scan_tail(struct mtd_info *mtd) if (!ecc->read_page) ecc->read_page = nand_read_page_hwecc_oob_first; + fallthrough; case NAND_ECC_HW: /* Use standard hwecc read page function? */ if (!ecc->read_page) @@ -4993,6 +4995,7 @@ int nand_scan_tail(struct mtd_info *mtd) if (!ecc->write_subpage && ecc->hwctl && ecc->calculate) ecc->write_subpage = nand_write_subpage_hwecc; + fallthrough; case NAND_ECC_HW_SYNDROME: if ((!ecc->calculate || !ecc->correct || !ecc->hwctl) && (!ecc->read_page || @@ -5027,6 +5030,7 @@ int nand_scan_tail(struct mtd_info *mtd) ecc->size, mtd->writesize); ecc->mode = NAND_ECC_SOFT; + fallthrough; case NAND_ECC_SOFT: ecc->calculate = nand_calculate_ecc; ecc->correct = nand_correct_data;