diff options
author | Gustavo A. R. Silva <gustavo@embeddedor.com> | 2019-05-19 19:43:53 -0400 |
---|---|---|
committer | Gustavo A. R. Silva <gustavo@embeddedor.com> | 2019-07-25 21:09:49 -0400 |
commit | 2988160827b780eec3f958ade2100cc223d4d2d6 (patch) | |
tree | e7f9b5b7628c6bacd7757da699c3ef3e560a77b7 /fs | |
parent | 35a3a90cc56cee54fb4d45afbbc6dfea0835de0c (diff) |
afs: fsclient: 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:
Warning level 3 was used: -Wimplicit-fallthrough=3
fs/afs/fsclient.c: In function ‘afs_deliver_fs_fetch_acl’:
fs/afs/fsclient.c:2199:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
call->unmarshall++;
~~~~~~~~~~~~~~~~^~
fs/afs/fsclient.c:2202:2: note: here
case 1:
^~~~
fs/afs/fsclient.c:2216:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
call->unmarshall++;
~~~~~~~~~~~~~~~~^~
fs/afs/fsclient.c:2219:2: note: here
case 2:
^~~~
fs/afs/fsclient.c:2225:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
call->unmarshall++;
~~~~~~~~~~~~~~~~^~
fs/afs/fsclient.c:2228:2: note: here
case 3:
^~~~
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')
-rw-r--r-- | fs/afs/fsclient.c | 51 |
1 files changed, 33 insertions, 18 deletions
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c index 1ce73e014139..114f281f3687 100644 --- a/fs/afs/fsclient.c +++ b/fs/afs/fsclient.c | |||
@@ -339,8 +339,9 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call) | |||
339 | call->tmp_u = htonl(0); | 339 | call->tmp_u = htonl(0); |
340 | afs_extract_to_tmp(call); | 340 | afs_extract_to_tmp(call); |
341 | } | 341 | } |
342 | /* Fall through */ | ||
342 | 343 | ||
343 | /* Fall through - and extract the returned data length */ | 344 | /* extract the returned data length */ |
344 | case 1: | 345 | case 1: |
345 | _debug("extract data length"); | 346 | _debug("extract data length"); |
346 | ret = afs_extract_data(call, true); | 347 | ret = afs_extract_data(call, true); |
@@ -366,8 +367,9 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call) | |||
366 | call->bvec[0].bv_page = req->pages[req->index]; | 367 | call->bvec[0].bv_page = req->pages[req->index]; |
367 | iov_iter_bvec(&call->iter, READ, call->bvec, 1, size); | 368 | iov_iter_bvec(&call->iter, READ, call->bvec, 1, size); |
368 | ASSERTCMP(size, <=, PAGE_SIZE); | 369 | ASSERTCMP(size, <=, PAGE_SIZE); |
370 | /* Fall through */ | ||
369 | 371 | ||
370 | /* Fall through - and extract the returned data */ | 372 | /* extract the returned data */ |
371 | case 2: | 373 | case 2: |
372 | _debug("extract data %zu/%llu", | 374 | _debug("extract data %zu/%llu", |
373 | iov_iter_count(&call->iter), req->remain); | 375 | iov_iter_count(&call->iter), req->remain); |
@@ -394,8 +396,8 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call) | |||
394 | /* Discard any excess data the server gave us */ | 396 | /* Discard any excess data the server gave us */ |
395 | iov_iter_discard(&call->iter, READ, req->actual_len - req->len); | 397 | iov_iter_discard(&call->iter, READ, req->actual_len - req->len); |
396 | call->unmarshall = 3; | 398 | call->unmarshall = 3; |
397 | |||
398 | /* Fall through */ | 399 | /* Fall through */ |
400 | |||
399 | case 3: | 401 | case 3: |
400 | _debug("extract discard %zu/%llu", | 402 | _debug("extract discard %zu/%llu", |
401 | iov_iter_count(&call->iter), req->actual_len - req->len); | 403 | iov_iter_count(&call->iter), req->actual_len - req->len); |
@@ -407,8 +409,9 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call) | |||
407 | no_more_data: | 409 | no_more_data: |
408 | call->unmarshall = 4; | 410 | call->unmarshall = 4; |
409 | afs_extract_to_buf(call, (21 + 3 + 6) * 4); | 411 | afs_extract_to_buf(call, (21 + 3 + 6) * 4); |
412 | /* Fall through */ | ||
410 | 413 | ||
411 | /* Fall through - and extract the metadata */ | 414 | /* extract the metadata */ |
412 | case 4: | 415 | case 4: |
413 | ret = afs_extract_data(call, false); | 416 | ret = afs_extract_data(call, false); |
414 | if (ret < 0) | 417 | if (ret < 0) |
@@ -1471,8 +1474,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1471 | case 0: | 1474 | case 0: |
1472 | call->unmarshall++; | 1475 | call->unmarshall++; |
1473 | afs_extract_to_buf(call, 12 * 4); | 1476 | afs_extract_to_buf(call, 12 * 4); |
1477 | /* Fall through */ | ||
1474 | 1478 | ||
1475 | /* Fall through - and extract the returned status record */ | 1479 | /* extract the returned status record */ |
1476 | case 1: | 1480 | case 1: |
1477 | _debug("extract status"); | 1481 | _debug("extract status"); |
1478 | ret = afs_extract_data(call, true); | 1482 | ret = afs_extract_data(call, true); |
@@ -1483,8 +1487,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1483 | xdr_decode_AFSFetchVolumeStatus(&bp, call->out_volstatus); | 1487 | xdr_decode_AFSFetchVolumeStatus(&bp, call->out_volstatus); |
1484 | call->unmarshall++; | 1488 | call->unmarshall++; |
1485 | afs_extract_to_tmp(call); | 1489 | afs_extract_to_tmp(call); |
1490 | /* Fall through */ | ||
1486 | 1491 | ||
1487 | /* Fall through - and extract the volume name length */ | 1492 | /* extract the volume name length */ |
1488 | case 2: | 1493 | case 2: |
1489 | ret = afs_extract_data(call, true); | 1494 | ret = afs_extract_data(call, true); |
1490 | if (ret < 0) | 1495 | if (ret < 0) |
@@ -1498,8 +1503,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1498 | size = (call->count + 3) & ~3; /* It's padded */ | 1503 | size = (call->count + 3) & ~3; /* It's padded */ |
1499 | afs_extract_to_buf(call, size); | 1504 | afs_extract_to_buf(call, size); |
1500 | call->unmarshall++; | 1505 | call->unmarshall++; |
1506 | /* Fall through */ | ||
1501 | 1507 | ||
1502 | /* Fall through - and extract the volume name */ | 1508 | /* extract the volume name */ |
1503 | case 3: | 1509 | case 3: |
1504 | _debug("extract volname"); | 1510 | _debug("extract volname"); |
1505 | ret = afs_extract_data(call, true); | 1511 | ret = afs_extract_data(call, true); |
@@ -1511,8 +1517,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1511 | _debug("volname '%s'", p); | 1517 | _debug("volname '%s'", p); |
1512 | afs_extract_to_tmp(call); | 1518 | afs_extract_to_tmp(call); |
1513 | call->unmarshall++; | 1519 | call->unmarshall++; |
1520 | /* Fall through */ | ||
1514 | 1521 | ||
1515 | /* Fall through - and extract the offline message length */ | 1522 | /* extract the offline message length */ |
1516 | case 4: | 1523 | case 4: |
1517 | ret = afs_extract_data(call, true); | 1524 | ret = afs_extract_data(call, true); |
1518 | if (ret < 0) | 1525 | if (ret < 0) |
@@ -1526,8 +1533,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1526 | size = (call->count + 3) & ~3; /* It's padded */ | 1533 | size = (call->count + 3) & ~3; /* It's padded */ |
1527 | afs_extract_to_buf(call, size); | 1534 | afs_extract_to_buf(call, size); |
1528 | call->unmarshall++; | 1535 | call->unmarshall++; |
1536 | /* Fall through */ | ||
1529 | 1537 | ||
1530 | /* Fall through - and extract the offline message */ | 1538 | /* extract the offline message */ |
1531 | case 5: | 1539 | case 5: |
1532 | _debug("extract offline"); | 1540 | _debug("extract offline"); |
1533 | ret = afs_extract_data(call, true); | 1541 | ret = afs_extract_data(call, true); |
@@ -1540,8 +1548,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1540 | 1548 | ||
1541 | afs_extract_to_tmp(call); | 1549 | afs_extract_to_tmp(call); |
1542 | call->unmarshall++; | 1550 | call->unmarshall++; |
1551 | /* Fall through */ | ||
1543 | 1552 | ||
1544 | /* Fall through - and extract the message of the day length */ | 1553 | /* extract the message of the day length */ |
1545 | case 6: | 1554 | case 6: |
1546 | ret = afs_extract_data(call, true); | 1555 | ret = afs_extract_data(call, true); |
1547 | if (ret < 0) | 1556 | if (ret < 0) |
@@ -1555,8 +1564,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1555 | size = (call->count + 3) & ~3; /* It's padded */ | 1564 | size = (call->count + 3) & ~3; /* It's padded */ |
1556 | afs_extract_to_buf(call, size); | 1565 | afs_extract_to_buf(call, size); |
1557 | call->unmarshall++; | 1566 | call->unmarshall++; |
1567 | /* Fall through */ | ||
1558 | 1568 | ||
1559 | /* Fall through - and extract the message of the day */ | 1569 | /* extract the message of the day */ |
1560 | case 7: | 1570 | case 7: |
1561 | _debug("extract motd"); | 1571 | _debug("extract motd"); |
1562 | ret = afs_extract_data(call, false); | 1572 | ret = afs_extract_data(call, false); |
@@ -1850,8 +1860,9 @@ static int afs_deliver_fs_get_capabilities(struct afs_call *call) | |||
1850 | case 0: | 1860 | case 0: |
1851 | afs_extract_to_tmp(call); | 1861 | afs_extract_to_tmp(call); |
1852 | call->unmarshall++; | 1862 | call->unmarshall++; |
1863 | /* Fall through */ | ||
1853 | 1864 | ||
1854 | /* Fall through - and extract the capabilities word count */ | 1865 | /* Extract the capabilities word count */ |
1855 | case 1: | 1866 | case 1: |
1856 | ret = afs_extract_data(call, true); | 1867 | ret = afs_extract_data(call, true); |
1857 | if (ret < 0) | 1868 | if (ret < 0) |
@@ -1863,8 +1874,9 @@ static int afs_deliver_fs_get_capabilities(struct afs_call *call) | |||
1863 | call->count2 = count; | 1874 | call->count2 = count; |
1864 | iov_iter_discard(&call->iter, READ, count * sizeof(__be32)); | 1875 | iov_iter_discard(&call->iter, READ, count * sizeof(__be32)); |
1865 | call->unmarshall++; | 1876 | call->unmarshall++; |
1877 | /* Fall through */ | ||
1866 | 1878 | ||
1867 | /* Fall through - and extract capabilities words */ | 1879 | /* Extract capabilities words */ |
1868 | case 2: | 1880 | case 2: |
1869 | ret = afs_extract_data(call, false); | 1881 | ret = afs_extract_data(call, false); |
1870 | if (ret < 0) | 1882 | if (ret < 0) |
@@ -2020,9 +2032,9 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
2020 | case 0: | 2032 | case 0: |
2021 | afs_extract_to_tmp(call); | 2033 | afs_extract_to_tmp(call); |
2022 | call->unmarshall++; | 2034 | call->unmarshall++; |
2035 | /* Fall through */ | ||
2023 | 2036 | ||
2024 | /* Extract the file status count and array in two steps */ | 2037 | /* Extract the file status count and array in two steps */ |
2025 | /* Fall through */ | ||
2026 | case 1: | 2038 | case 1: |
2027 | _debug("extract status count"); | 2039 | _debug("extract status count"); |
2028 | ret = afs_extract_data(call, true); | 2040 | ret = afs_extract_data(call, true); |
@@ -2039,8 +2051,8 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
2039 | call->unmarshall++; | 2051 | call->unmarshall++; |
2040 | more_counts: | 2052 | more_counts: |
2041 | afs_extract_to_buf(call, 21 * sizeof(__be32)); | 2053 | afs_extract_to_buf(call, 21 * sizeof(__be32)); |
2042 | |||
2043 | /* Fall through */ | 2054 | /* Fall through */ |
2055 | |||
2044 | case 2: | 2056 | case 2: |
2045 | _debug("extract status array %u", call->count); | 2057 | _debug("extract status array %u", call->count); |
2046 | ret = afs_extract_data(call, true); | 2058 | ret = afs_extract_data(call, true); |
@@ -2060,9 +2072,9 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
2060 | call->count = 0; | 2072 | call->count = 0; |
2061 | call->unmarshall++; | 2073 | call->unmarshall++; |
2062 | afs_extract_to_tmp(call); | 2074 | afs_extract_to_tmp(call); |
2075 | /* Fall through */ | ||
2063 | 2076 | ||
2064 | /* Extract the callback count and array in two steps */ | 2077 | /* Extract the callback count and array in two steps */ |
2065 | /* Fall through */ | ||
2066 | case 3: | 2078 | case 3: |
2067 | _debug("extract CB count"); | 2079 | _debug("extract CB count"); |
2068 | ret = afs_extract_data(call, true); | 2080 | ret = afs_extract_data(call, true); |
@@ -2078,8 +2090,8 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
2078 | call->unmarshall++; | 2090 | call->unmarshall++; |
2079 | more_cbs: | 2091 | more_cbs: |
2080 | afs_extract_to_buf(call, 3 * sizeof(__be32)); | 2092 | afs_extract_to_buf(call, 3 * sizeof(__be32)); |
2081 | |||
2082 | /* Fall through */ | 2093 | /* Fall through */ |
2094 | |||
2083 | case 4: | 2095 | case 4: |
2084 | _debug("extract CB array"); | 2096 | _debug("extract CB array"); |
2085 | ret = afs_extract_data(call, true); | 2097 | ret = afs_extract_data(call, true); |
@@ -2096,8 +2108,8 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
2096 | 2108 | ||
2097 | afs_extract_to_buf(call, 6 * sizeof(__be32)); | 2109 | afs_extract_to_buf(call, 6 * sizeof(__be32)); |
2098 | call->unmarshall++; | 2110 | call->unmarshall++; |
2099 | |||
2100 | /* Fall through */ | 2111 | /* Fall through */ |
2112 | |||
2101 | case 5: | 2113 | case 5: |
2102 | ret = afs_extract_data(call, false); | 2114 | ret = afs_extract_data(call, false); |
2103 | if (ret < 0) | 2115 | if (ret < 0) |
@@ -2193,6 +2205,7 @@ static int afs_deliver_fs_fetch_acl(struct afs_call *call) | |||
2193 | case 0: | 2205 | case 0: |
2194 | afs_extract_to_tmp(call); | 2206 | afs_extract_to_tmp(call); |
2195 | call->unmarshall++; | 2207 | call->unmarshall++; |
2208 | /* Fall through */ | ||
2196 | 2209 | ||
2197 | /* extract the returned data length */ | 2210 | /* extract the returned data length */ |
2198 | case 1: | 2211 | case 1: |
@@ -2210,6 +2223,7 @@ static int afs_deliver_fs_fetch_acl(struct afs_call *call) | |||
2210 | acl->size = call->count2; | 2223 | acl->size = call->count2; |
2211 | afs_extract_begin(call, acl->data, size); | 2224 | afs_extract_begin(call, acl->data, size); |
2212 | call->unmarshall++; | 2225 | call->unmarshall++; |
2226 | /* Fall through */ | ||
2213 | 2227 | ||
2214 | /* extract the returned data */ | 2228 | /* extract the returned data */ |
2215 | case 2: | 2229 | case 2: |
@@ -2219,6 +2233,7 @@ static int afs_deliver_fs_fetch_acl(struct afs_call *call) | |||
2219 | 2233 | ||
2220 | afs_extract_to_buf(call, (21 + 6) * 4); | 2234 | afs_extract_to_buf(call, (21 + 6) * 4); |
2221 | call->unmarshall++; | 2235 | call->unmarshall++; |
2236 | /* Fall through */ | ||
2222 | 2237 | ||
2223 | /* extract the metadata */ | 2238 | /* extract the metadata */ |
2224 | case 3: | 2239 | case 3: |