summaryrefslogtreecommitdiffstats
path: root/fs/afs/yfsclient.c
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2019-05-19 19:56:50 -0400
committerGustavo A. R. Silva <gustavo@embeddedor.com>2019-07-25 21:09:46 -0400
commit35a3a90cc56cee54fb4d45afbbc6dfea0835de0c (patch)
tree918e2beba4ac6c90651248d3530b06a35ca1d08a /fs/afs/yfsclient.c
parent5a8dadbcfa6b04ea3be6f0ffa04eba173c865378 (diff)
afs: yfsclient: Mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warnings: fs/afs/yfsclient.c: In function ‘yfs_deliver_fs_fetch_opaque_acl’: fs/afs/yfsclient.c:1984:19: warning: this statement may fall through [-Wimplicit-fallthrough=] call->unmarshall++; ~~~~~~~~~~~~~~~~^~ fs/afs/yfsclient.c:1987:2: note: here case 1: ^~~~ fs/afs/yfsclient.c:2005:19: warning: this statement may fall through [-Wimplicit-fallthrough=] call->unmarshall++; ~~~~~~~~~~~~~~~~^~ fs/afs/yfsclient.c:2008:2: note: here case 2: ^~~~ fs/afs/yfsclient.c:2014:19: warning: this statement may fall through [-Wimplicit-fallthrough=] call->unmarshall++; ~~~~~~~~~~~~~~~~^~ fs/afs/yfsclient.c:2017:2: note: here case 3: ^~~~ fs/afs/yfsclient.c:2035:19: warning: this statement may fall through [-Wimplicit-fallthrough=] call->unmarshall++; ~~~~~~~~~~~~~~~~^~ fs/afs/yfsclient.c:2038:2: note: here case 4: ^~~~ fs/afs/yfsclient.c:2047:19: warning: this statement may fall through [-Wimplicit-fallthrough=] call->unmarshall++; ~~~~~~~~~~~~~~~~^~ fs/afs/yfsclient.c:2050:2: note: here case 5: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 Also, fix some commenting style issues. This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Diffstat (limited to 'fs/afs/yfsclient.c')
-rw-r--r--fs/afs/yfsclient.c54
1 files changed, 35 insertions, 19 deletions
diff --git a/fs/afs/yfsclient.c b/fs/afs/yfsclient.c
index 18722aaeda33..2575503170fc 100644
--- a/fs/afs/yfsclient.c
+++ b/fs/afs/yfsclient.c
@@ -450,8 +450,9 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
450 req->offset = req->pos & (PAGE_SIZE - 1); 450 req->offset = req->pos & (PAGE_SIZE - 1);
451 afs_extract_to_tmp64(call); 451 afs_extract_to_tmp64(call);
452 call->unmarshall++; 452 call->unmarshall++;
453 /* Fall through */
453 454
454 /* Fall through - and extract the returned data length */ 455 /* extract the returned data length */
455 case 1: 456 case 1:
456 _debug("extract data length"); 457 _debug("extract data length");
457 ret = afs_extract_data(call, true); 458 ret = afs_extract_data(call, true);
@@ -477,8 +478,9 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
477 call->bvec[0].bv_page = req->pages[req->index]; 478 call->bvec[0].bv_page = req->pages[req->index];
478 iov_iter_bvec(&call->iter, READ, call->bvec, 1, size); 479 iov_iter_bvec(&call->iter, READ, call->bvec, 1, size);
479 ASSERTCMP(size, <=, PAGE_SIZE); 480 ASSERTCMP(size, <=, PAGE_SIZE);
481 /* Fall through */
480 482
481 /* Fall through - and extract the returned data */ 483 /* extract the returned data */
482 case 2: 484 case 2:
483 _debug("extract data %zu/%llu", 485 _debug("extract data %zu/%llu",
484 iov_iter_count(&call->iter), req->remain); 486 iov_iter_count(&call->iter), req->remain);
@@ -505,8 +507,8 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
505 /* Discard any excess data the server gave us */ 507 /* Discard any excess data the server gave us */
506 iov_iter_discard(&call->iter, READ, req->actual_len - req->len); 508 iov_iter_discard(&call->iter, READ, req->actual_len - req->len);
507 call->unmarshall = 3; 509 call->unmarshall = 3;
508
509 /* Fall through */ 510 /* Fall through */
511
510 case 3: 512 case 3:
511 _debug("extract discard %zu/%llu", 513 _debug("extract discard %zu/%llu",
512 iov_iter_count(&call->iter), req->actual_len - req->len); 514 iov_iter_count(&call->iter), req->actual_len - req->len);
@@ -521,8 +523,9 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
521 sizeof(struct yfs_xdr_YFSFetchStatus) + 523 sizeof(struct yfs_xdr_YFSFetchStatus) +
522 sizeof(struct yfs_xdr_YFSCallBack) + 524 sizeof(struct yfs_xdr_YFSCallBack) +
523 sizeof(struct yfs_xdr_YFSVolSync)); 525 sizeof(struct yfs_xdr_YFSVolSync));
526 /* Fall through */
524 527
525 /* Fall through - and extract the metadata */ 528 /* extract the metadata */
526 case 4: 529 case 4:
527 ret = afs_extract_data(call, false); 530 ret = afs_extract_data(call, false);
528 if (ret < 0) 531 if (ret < 0)
@@ -539,8 +542,8 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
539 req->file_size = call->out_scb->status.size; 542 req->file_size = call->out_scb->status.size;
540 543
541 call->unmarshall++; 544 call->unmarshall++;
542
543 /* Fall through */ 545 /* Fall through */
546
544 case 5: 547 case 5:
545 break; 548 break;
546 } 549 }
@@ -1429,8 +1432,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
1429 case 0: 1432 case 0:
1430 call->unmarshall++; 1433 call->unmarshall++;
1431 afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchVolumeStatus)); 1434 afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchVolumeStatus));
1435 /* Fall through */
1432 1436
1433 /* Fall through - and extract the returned status record */ 1437 /* extract the returned status record */
1434 case 1: 1438 case 1:
1435 _debug("extract status"); 1439 _debug("extract status");
1436 ret = afs_extract_data(call, true); 1440 ret = afs_extract_data(call, true);
@@ -1441,8 +1445,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
1441 xdr_decode_YFSFetchVolumeStatus(&bp, call->out_volstatus); 1445 xdr_decode_YFSFetchVolumeStatus(&bp, call->out_volstatus);
1442 call->unmarshall++; 1446 call->unmarshall++;
1443 afs_extract_to_tmp(call); 1447 afs_extract_to_tmp(call);
1448 /* Fall through */
1444 1449
1445 /* Fall through - and extract the volume name length */ 1450 /* extract the volume name length */
1446 case 2: 1451 case 2:
1447 ret = afs_extract_data(call, true); 1452 ret = afs_extract_data(call, true);
1448 if (ret < 0) 1453 if (ret < 0)
@@ -1456,8 +1461,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
1456 size = (call->count + 3) & ~3; /* It's padded */ 1461 size = (call->count + 3) & ~3; /* It's padded */
1457 afs_extract_to_buf(call, size); 1462 afs_extract_to_buf(call, size);
1458 call->unmarshall++; 1463 call->unmarshall++;
1464 /* Fall through */
1459 1465
1460 /* Fall through - and extract the volume name */ 1466 /* extract the volume name */
1461 case 3: 1467 case 3:
1462 _debug("extract volname"); 1468 _debug("extract volname");
1463 ret = afs_extract_data(call, true); 1469 ret = afs_extract_data(call, true);
@@ -1469,8 +1475,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
1469 _debug("volname '%s'", p); 1475 _debug("volname '%s'", p);
1470 afs_extract_to_tmp(call); 1476 afs_extract_to_tmp(call);
1471 call->unmarshall++; 1477 call->unmarshall++;
1478 /* Fall through */
1472 1479
1473 /* Fall through - and extract the offline message length */ 1480 /* extract the offline message length */
1474 case 4: 1481 case 4:
1475 ret = afs_extract_data(call, true); 1482 ret = afs_extract_data(call, true);
1476 if (ret < 0) 1483 if (ret < 0)
@@ -1484,8 +1491,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
1484 size = (call->count + 3) & ~3; /* It's padded */ 1491 size = (call->count + 3) & ~3; /* It's padded */
1485 afs_extract_to_buf(call, size); 1492 afs_extract_to_buf(call, size);
1486 call->unmarshall++; 1493 call->unmarshall++;
1494 /* Fall through */
1487 1495
1488 /* Fall through - and extract the offline message */ 1496 /* extract the offline message */
1489 case 5: 1497 case 5:
1490 _debug("extract offline"); 1498 _debug("extract offline");
1491 ret = afs_extract_data(call, true); 1499 ret = afs_extract_data(call, true);
@@ -1498,8 +1506,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
1498 1506
1499 afs_extract_to_tmp(call); 1507 afs_extract_to_tmp(call);
1500 call->unmarshall++; 1508 call->unmarshall++;
1509 /* Fall through */
1501 1510
1502 /* Fall through - and extract the message of the day length */ 1511 /* extract the message of the day length */
1503 case 6: 1512 case 6:
1504 ret = afs_extract_data(call, true); 1513 ret = afs_extract_data(call, true);
1505 if (ret < 0) 1514 if (ret < 0)
@@ -1513,8 +1522,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
1513 size = (call->count + 3) & ~3; /* It's padded */ 1522 size = (call->count + 3) & ~3; /* It's padded */
1514 afs_extract_to_buf(call, size); 1523 afs_extract_to_buf(call, size);
1515 call->unmarshall++; 1524 call->unmarshall++;
1525 /* Fall through */
1516 1526
1517 /* Fall through - and extract the message of the day */ 1527 /* extract the message of the day */
1518 case 7: 1528 case 7:
1519 _debug("extract motd"); 1529 _debug("extract motd");
1520 ret = afs_extract_data(call, false); 1530 ret = afs_extract_data(call, false);
@@ -1526,8 +1536,8 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
1526 _debug("motd '%s'", p); 1536 _debug("motd '%s'", p);
1527 1537
1528 call->unmarshall++; 1538 call->unmarshall++;
1529
1530 /* Fall through */ 1539 /* Fall through */
1540
1531 case 8: 1541 case 8:
1532 break; 1542 break;
1533 } 1543 }
@@ -1805,9 +1815,9 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
1805 case 0: 1815 case 0:
1806 afs_extract_to_tmp(call); 1816 afs_extract_to_tmp(call);
1807 call->unmarshall++; 1817 call->unmarshall++;
1818 /* Fall through */
1808 1819
1809 /* Extract the file status count and array in two steps */ 1820 /* Extract the file status count and array in two steps */
1810 /* Fall through */
1811 case 1: 1821 case 1:
1812 _debug("extract status count"); 1822 _debug("extract status count");
1813 ret = afs_extract_data(call, true); 1823 ret = afs_extract_data(call, true);
@@ -1824,8 +1834,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
1824 call->unmarshall++; 1834 call->unmarshall++;
1825 more_counts: 1835 more_counts:
1826 afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchStatus)); 1836 afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchStatus));
1827
1828 /* Fall through */ 1837 /* Fall through */
1838
1829 case 2: 1839 case 2:
1830 _debug("extract status array %u", call->count); 1840 _debug("extract status array %u", call->count);
1831 ret = afs_extract_data(call, true); 1841 ret = afs_extract_data(call, true);
@@ -1845,9 +1855,9 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
1845 call->count = 0; 1855 call->count = 0;
1846 call->unmarshall++; 1856 call->unmarshall++;
1847 afs_extract_to_tmp(call); 1857 afs_extract_to_tmp(call);
1858 /* Fall through */
1848 1859
1849 /* Extract the callback count and array in two steps */ 1860 /* Extract the callback count and array in two steps */
1850 /* Fall through */
1851 case 3: 1861 case 3:
1852 _debug("extract CB count"); 1862 _debug("extract CB count");
1853 ret = afs_extract_data(call, true); 1863 ret = afs_extract_data(call, true);
@@ -1863,8 +1873,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
1863 call->unmarshall++; 1873 call->unmarshall++;
1864 more_cbs: 1874 more_cbs:
1865 afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSCallBack)); 1875 afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSCallBack));
1866
1867 /* Fall through */ 1876 /* Fall through */
1877
1868 case 4: 1878 case 4:
1869 _debug("extract CB array"); 1879 _debug("extract CB array");
1870 ret = afs_extract_data(call, true); 1880 ret = afs_extract_data(call, true);
@@ -1881,8 +1891,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
1881 1891
1882 afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSVolSync)); 1892 afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSVolSync));
1883 call->unmarshall++; 1893 call->unmarshall++;
1884
1885 /* Fall through */ 1894 /* Fall through */
1895
1886 case 5: 1896 case 5:
1887 ret = afs_extract_data(call, false); 1897 ret = afs_extract_data(call, false);
1888 if (ret < 0) 1898 if (ret < 0)
@@ -1892,8 +1902,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
1892 xdr_decode_YFSVolSync(&bp, call->out_volsync); 1902 xdr_decode_YFSVolSync(&bp, call->out_volsync);
1893 1903
1894 call->unmarshall++; 1904 call->unmarshall++;
1895
1896 /* Fall through */ 1905 /* Fall through */
1906
1897 case 6: 1907 case 6:
1898 break; 1908 break;
1899 } 1909 }
@@ -1978,6 +1988,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
1978 case 0: 1988 case 0:
1979 afs_extract_to_tmp(call); 1989 afs_extract_to_tmp(call);
1980 call->unmarshall++; 1990 call->unmarshall++;
1991 /* Fall through */
1981 1992
1982 /* Extract the file ACL length */ 1993 /* Extract the file ACL length */
1983 case 1: 1994 case 1:
@@ -1999,6 +2010,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
1999 iov_iter_discard(&call->iter, READ, size); 2010 iov_iter_discard(&call->iter, READ, size);
2000 } 2011 }
2001 call->unmarshall++; 2012 call->unmarshall++;
2013 /* Fall through */
2002 2014
2003 /* Extract the file ACL */ 2015 /* Extract the file ACL */
2004 case 2: 2016 case 2:
@@ -2008,6 +2020,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
2008 2020
2009 afs_extract_to_tmp(call); 2021 afs_extract_to_tmp(call);
2010 call->unmarshall++; 2022 call->unmarshall++;
2023 /* Fall through */
2011 2024
2012 /* Extract the volume ACL length */ 2025 /* Extract the volume ACL length */
2013 case 3: 2026 case 3:
@@ -2029,6 +2042,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
2029 iov_iter_discard(&call->iter, READ, size); 2042 iov_iter_discard(&call->iter, READ, size);
2030 } 2043 }
2031 call->unmarshall++; 2044 call->unmarshall++;
2045 /* Fall through */
2032 2046
2033 /* Extract the volume ACL */ 2047 /* Extract the volume ACL */
2034 case 4: 2048 case 4:
@@ -2041,6 +2055,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
2041 sizeof(struct yfs_xdr_YFSFetchStatus) + 2055 sizeof(struct yfs_xdr_YFSFetchStatus) +
2042 sizeof(struct yfs_xdr_YFSVolSync)); 2056 sizeof(struct yfs_xdr_YFSVolSync));
2043 call->unmarshall++; 2057 call->unmarshall++;
2058 /* Fall through */
2044 2059
2045 /* extract the metadata */ 2060 /* extract the metadata */
2046 case 5: 2061 case 5:
@@ -2057,6 +2072,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
2057 xdr_decode_YFSVolSync(&bp, call->out_volsync); 2072 xdr_decode_YFSVolSync(&bp, call->out_volsync);
2058 2073
2059 call->unmarshall++; 2074 call->unmarshall++;
2075 /* Fall through */
2060 2076
2061 case 6: 2077 case 6:
2062 break; 2078 break;