The net_check_prereq() routine in the generic network handling code
mixes case: labels with #ifdef's, which makes predicting fallthrough
situations tricky. We had two "fall through" comments in the code, but
at the wrong places.

Remove one unneeded comment (no annotations necessary between just empty
labels), and move one other instance to the right place (before any
label sequence).
This makes GCC's implicit fallthrough checker happy.

Signed-off-by: Andre Przywara <andre.przyw...@arm.com>
---
 net/net.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/net.c b/net/net.c
index 5219367e391..f191f16357c 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1525,7 +1525,6 @@ static int net_check_prereq(enum proto_t protocol)
 #if defined(CONFIG_CMD_NFS)
        case NFS:
 #endif
-               /* Fall through */
        case TFTPGET:
        case TFTPPUT:
                if (IS_ENABLED(CONFIG_IPV6) && use_ip6) {
@@ -1539,11 +1538,11 @@ static int net_check_prereq(enum proto_t protocol)
                        puts("*** ERROR: `serverip' not set\n");
                        return 1;
                }
+               fallthrough;
 #if    defined(CONFIG_CMD_PING) || \
        defined(CONFIG_CMD_DNS) || defined(CONFIG_PROT_UDP)
 common:
 #endif
-               /* Fall through */
 
        case NETCONS:
        case FASTBOOT_UDP:
-- 
2.25.1

Reply via email to