Skip to content

Commit 26b2482

Browse files
Andre-ARMtrini
authored andcommitted
use proper fallthrough annotations
In some cases in the generic code, we were already using switch/case fallthrough annotations comments, though in a way which might not be understood by most compilers. Replace two non-standard /* no break */ comments with our fallthrough; statement-like macro, to make this visible to the compiler. Also use this macro in place of an /* Fall through */ comment, to be more consistent. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Tom Rini <trini@konsulko.com>
1 parent 2938eb1 commit 26b2482

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

common/command.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ int cmd_get_data_size(const char *arg, int default_size)
484484
case 'q':
485485
if (MEM_SUPPORT_64BIT_DATA)
486486
return 8;
487-
/* no break */
487+
fallthrough;
488488
default:
489489
return CMD_DATA_SIZE_ERR;
490490
}

lib/tiny-printf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
282282
break;
283283
}
284284
islong = true;
285-
/* no break */
285+
fallthrough;
286286
case 'x':
287287
if (islong) {
288288
num = va_arg(va, unsigned long);

net/net.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,7 @@ static int net_check_prereq(enum proto_t protocol)
15591559
puts("*** ERROR: `ipaddr' not set\n");
15601560
return 1;
15611561
}
1562-
/* Fall through */
1562+
fallthrough;
15631563

15641564
#ifdef CONFIG_CMD_RARP
15651565
case RARP:

0 commit comments

Comments
 (0)