History

treewide: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Gustavo A. R. Silva committed 6 years ago

Commit df561f61 parent d012a711148 files · +2667 −2737Browse files

Showing the changes to kernel/debug (3 of 1148 files). Show all

Unified · Split

3 files
  1. kernel/debug/gdbstub.c +3 −3
  2. kernel/debug/kdb/kdb_keyboard.c +2 −2
  3. kernel/debug/kdb/kdb_support.c +3 −3
kernel/debug/gdbstub.c+3−3
@@ -1046,14 +1046,14 @@ int gdb_serial_stub(struct kgdb_state *ks) · 1045 unmodified lines
10461046 return DBG_PASS_EVENT;
10471047 }
10481048 #endif
1049− /* Fall through */
1049+ fallthrough;
10501050 case 'C': /* Exception passing */
10511051 tmp = gdb_cmd_exception_pass(ks);
10521052 if (tmp > 0)
10531053 goto default_handle;
10541054 if (tmp == 0)
10551055 break;
1056− /* Fall through - on tmp < 0 */
1056+ fallthrough; /* on tmp < 0 */
10571057 case 'c': /* Continue packet */
10581058 case 's': /* Single step packet */
10591059 if (kgdb_contthread && kgdb_contthread != current) {
@@ -1062,7 +1062,7 @@ int gdb_serial_stub(struct kgdb_state *ks) · 2 unmodified lines
10621062 break;
10631063 }
10641064 dbg_activate_sw_breakpoints();
1065− /* Fall through - to default processing */
1065+ fallthrough; /* to default processing */
10661066 default:
10671067 default_handle:
10681068 error = kgdb_arch_handle_exception(ks->ex_vector,
kernel/debug/kdb/kdb_keyboard.c+2−2
@@ -173,11 +173,11 @@ int kdb_get_kbd_char(void) · 172 unmodified lines
173173 case KT_LATIN:
174174 if (isprint(keychar))
175175 break; /* printable characters */
176− /* fall through */
176+ fallthrough;
177177 case KT_SPEC:
178178 if (keychar == K_ENTER)
179179 break;
180− /* fall through */
180+ fallthrough;
181181 default:
182182 return -1; /* ignore unprintables */
183183 }
kernel/debug/kdb/kdb_support.c+3−3
@@ -432,7 +432,7 @@ int kdb_getphysword(unsigned long *word, unsigned long addr, size_t size) · 431 unmodified lines
432432 *word = w8;
433433 break;
434434 }
435− /* fall through */
435+ fallthrough;
436436 default:
437437 diag = KDB_BADWIDTH;
438438 kdb_printf("kdb_getphysword: bad width %ld\n", (long) size);
@@ -481,7 +481,7 @@ int kdb_getword(unsigned long *word, unsigned long addr, size_t size) · 42 unmodified lines
481481 *word = w8;
482482 break;
483483 }
484− /* fall through */
484+ fallthrough;
485485 default:
486486 diag = KDB_BADWIDTH;
487487 kdb_printf("kdb_getword: bad width %ld\n", (long) size);
@@ -525,7 +525,7 @@ int kdb_putword(unsigned long addr, unsigned long word, size_t size) · 37 unmodified lines
525525 diag = kdb_putarea(addr, w8);
526526 break;
527527 }
528− /* fall through */
528+ fallthrough;
529529 default:
530530 diag = KDB_BADWIDTH;
531531 kdb_printf("kdb_putword: bad width %ld\n", (long) size);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t