Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

afs: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly adding multiple fallthrough pseudo-keywords in
places where the code is intended to fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
cc: linux-afs@lists.infradead.org
cc: linux-hardening@vger.kernel.org
Link: https://lore.kernel.org/r/51150b54e0b0431a2c401cd54f2c4e7f50e94601.1605896059.git.gustavoars@kernel.org/ # v1
Link: https://lore.kernel.org/r/20210420211615.GA51432@embeddedor/ # v2
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Gustavo A. R. Silva and committed by
Linus Torvalds
b2db6c35 a050a6d2

+10
+5
fs/afs/cmservice.c
··· 322 322 return ret; 323 323 324 324 call->unmarshall++; 325 + fallthrough; 326 + 325 327 case 5: 326 328 break; 327 329 } ··· 420 418 r->node[loop] = ntohl(b[loop + 5]); 421 419 422 420 call->unmarshall++; 421 + fallthrough; 423 422 424 423 case 2: 425 424 break; ··· 533 530 r->node[loop] = ntohl(b[loop + 5]); 534 531 535 532 call->unmarshall++; 533 + fallthrough; 536 534 537 535 case 2: 538 536 break; ··· 667 663 668 664 afs_extract_to_tmp(call); 669 665 call->unmarshall++; 666 + fallthrough; 670 667 671 668 case 3: 672 669 break;
+4
fs/afs/fsclient.c
··· 388 388 req->file_size = vp->scb.status.size; 389 389 390 390 call->unmarshall++; 391 + fallthrough; 391 392 392 393 case 5: 393 394 break; ··· 1409 1408 _debug("motd '%s'", p); 1410 1409 1411 1410 call->unmarshall++; 1411 + fallthrough; 1412 1412 1413 1413 case 8: 1414 1414 break; ··· 1847 1845 xdr_decode_AFSVolSync(&bp, &op->volsync); 1848 1846 1849 1847 call->unmarshall++; 1848 + fallthrough; 1850 1849 1851 1850 case 6: 1852 1851 break; ··· 1982 1979 xdr_decode_AFSVolSync(&bp, &op->volsync); 1983 1980 1984 1981 call->unmarshall++; 1982 + fallthrough; 1985 1983 1986 1984 case 4: 1987 1985 break;
+1
fs/afs/vlclient.c
··· 593 593 if (ret < 0) 594 594 return ret; 595 595 call->unmarshall = 6; 596 + fallthrough; 596 597 597 598 case 6: 598 599 break;