Commit 35a3a90c authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva

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: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
parent 5a8dadbc
...@@ -450,8 +450,9 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call) ...@@ -450,8 +450,9 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
req->offset = req->pos & (PAGE_SIZE - 1); req->offset = req->pos & (PAGE_SIZE - 1);
afs_extract_to_tmp64(call); afs_extract_to_tmp64(call);
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* Fall through - and extract the returned data length */ /* extract the returned data length */
case 1: case 1:
_debug("extract data length"); _debug("extract data length");
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
...@@ -477,8 +478,9 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call) ...@@ -477,8 +478,9 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
call->bvec[0].bv_page = req->pages[req->index]; call->bvec[0].bv_page = req->pages[req->index];
iov_iter_bvec(&call->iter, READ, call->bvec, 1, size); iov_iter_bvec(&call->iter, READ, call->bvec, 1, size);
ASSERTCMP(size, <=, PAGE_SIZE); ASSERTCMP(size, <=, PAGE_SIZE);
/* Fall through */
/* Fall through - and extract the returned data */ /* extract the returned data */
case 2: case 2:
_debug("extract data %zu/%llu", _debug("extract data %zu/%llu",
iov_iter_count(&call->iter), req->remain); iov_iter_count(&call->iter), req->remain);
...@@ -505,8 +507,8 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call) ...@@ -505,8 +507,8 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
/* Discard any excess data the server gave us */ /* Discard any excess data the server gave us */
iov_iter_discard(&call->iter, READ, req->actual_len - req->len); iov_iter_discard(&call->iter, READ, req->actual_len - req->len);
call->unmarshall = 3; call->unmarshall = 3;
/* Fall through */ /* Fall through */
case 3: case 3:
_debug("extract discard %zu/%llu", _debug("extract discard %zu/%llu",
iov_iter_count(&call->iter), req->actual_len - req->len); 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,8 +523,9 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
sizeof(struct yfs_xdr_YFSFetchStatus) + sizeof(struct yfs_xdr_YFSFetchStatus) +
sizeof(struct yfs_xdr_YFSCallBack) + sizeof(struct yfs_xdr_YFSCallBack) +
sizeof(struct yfs_xdr_YFSVolSync)); sizeof(struct yfs_xdr_YFSVolSync));
/* Fall through */
/* Fall through - and extract the metadata */ /* extract the metadata */
case 4: case 4:
ret = afs_extract_data(call, false); ret = afs_extract_data(call, false);
if (ret < 0) if (ret < 0)
...@@ -539,8 +542,8 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call) ...@@ -539,8 +542,8 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
req->file_size = call->out_scb->status.size; req->file_size = call->out_scb->status.size;
call->unmarshall++; call->unmarshall++;
/* Fall through */ /* Fall through */
case 5: case 5:
break; break;
} }
...@@ -1429,8 +1432,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) ...@@ -1429,8 +1432,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
case 0: case 0:
call->unmarshall++; call->unmarshall++;
afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchVolumeStatus)); afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchVolumeStatus));
/* Fall through */
/* Fall through - and extract the returned status record */ /* extract the returned status record */
case 1: case 1:
_debug("extract status"); _debug("extract status");
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
...@@ -1441,8 +1445,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) ...@@ -1441,8 +1445,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
xdr_decode_YFSFetchVolumeStatus(&bp, call->out_volstatus); xdr_decode_YFSFetchVolumeStatus(&bp, call->out_volstatus);
call->unmarshall++; call->unmarshall++;
afs_extract_to_tmp(call); afs_extract_to_tmp(call);
/* Fall through */
/* Fall through - and extract the volume name length */ /* extract the volume name length */
case 2: case 2:
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
if (ret < 0) if (ret < 0)
...@@ -1456,8 +1461,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) ...@@ -1456,8 +1461,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
size = (call->count + 3) & ~3; /* It's padded */ size = (call->count + 3) & ~3; /* It's padded */
afs_extract_to_buf(call, size); afs_extract_to_buf(call, size);
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* Fall through - and extract the volume name */ /* extract the volume name */
case 3: case 3:
_debug("extract volname"); _debug("extract volname");
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
...@@ -1469,8 +1475,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) ...@@ -1469,8 +1475,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
_debug("volname '%s'", p); _debug("volname '%s'", p);
afs_extract_to_tmp(call); afs_extract_to_tmp(call);
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* Fall through - and extract the offline message length */ /* extract the offline message length */
case 4: case 4:
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
if (ret < 0) if (ret < 0)
...@@ -1484,8 +1491,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) ...@@ -1484,8 +1491,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
size = (call->count + 3) & ~3; /* It's padded */ size = (call->count + 3) & ~3; /* It's padded */
afs_extract_to_buf(call, size); afs_extract_to_buf(call, size);
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* Fall through - and extract the offline message */ /* extract the offline message */
case 5: case 5:
_debug("extract offline"); _debug("extract offline");
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
...@@ -1498,8 +1506,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) ...@@ -1498,8 +1506,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
afs_extract_to_tmp(call); afs_extract_to_tmp(call);
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* Fall through - and extract the message of the day length */ /* extract the message of the day length */
case 6: case 6:
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
if (ret < 0) if (ret < 0)
...@@ -1513,8 +1522,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) ...@@ -1513,8 +1522,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
size = (call->count + 3) & ~3; /* It's padded */ size = (call->count + 3) & ~3; /* It's padded */
afs_extract_to_buf(call, size); afs_extract_to_buf(call, size);
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* Fall through - and extract the message of the day */ /* extract the message of the day */
case 7: case 7:
_debug("extract motd"); _debug("extract motd");
ret = afs_extract_data(call, false); ret = afs_extract_data(call, false);
...@@ -1526,8 +1536,8 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) ...@@ -1526,8 +1536,8 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
_debug("motd '%s'", p); _debug("motd '%s'", p);
call->unmarshall++; call->unmarshall++;
/* Fall through */ /* Fall through */
case 8: case 8:
break; break;
} }
...@@ -1805,9 +1815,9 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) ...@@ -1805,9 +1815,9 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
case 0: case 0:
afs_extract_to_tmp(call); afs_extract_to_tmp(call);
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* Extract the file status count and array in two steps */ /* Extract the file status count and array in two steps */
/* Fall through */
case 1: case 1:
_debug("extract status count"); _debug("extract status count");
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
...@@ -1824,8 +1834,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) ...@@ -1824,8 +1834,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
call->unmarshall++; call->unmarshall++;
more_counts: more_counts:
afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchStatus)); afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchStatus));
/* Fall through */ /* Fall through */
case 2: case 2:
_debug("extract status array %u", call->count); _debug("extract status array %u", call->count);
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
...@@ -1845,9 +1855,9 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) ...@@ -1845,9 +1855,9 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
call->count = 0; call->count = 0;
call->unmarshall++; call->unmarshall++;
afs_extract_to_tmp(call); afs_extract_to_tmp(call);
/* Fall through */
/* Extract the callback count and array in two steps */ /* Extract the callback count and array in two steps */
/* Fall through */
case 3: case 3:
_debug("extract CB count"); _debug("extract CB count");
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
...@@ -1863,8 +1873,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) ...@@ -1863,8 +1873,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
call->unmarshall++; call->unmarshall++;
more_cbs: more_cbs:
afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSCallBack)); afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSCallBack));
/* Fall through */ /* Fall through */
case 4: case 4:
_debug("extract CB array"); _debug("extract CB array");
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
...@@ -1881,8 +1891,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) ...@@ -1881,8 +1891,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSVolSync)); afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSVolSync));
call->unmarshall++; call->unmarshall++;
/* Fall through */ /* Fall through */
case 5: case 5:
ret = afs_extract_data(call, false); ret = afs_extract_data(call, false);
if (ret < 0) if (ret < 0)
...@@ -1892,8 +1902,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) ...@@ -1892,8 +1902,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
xdr_decode_YFSVolSync(&bp, call->out_volsync); xdr_decode_YFSVolSync(&bp, call->out_volsync);
call->unmarshall++; call->unmarshall++;
/* Fall through */ /* Fall through */
case 6: case 6:
break; break;
} }
...@@ -1978,6 +1988,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) ...@@ -1978,6 +1988,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
case 0: case 0:
afs_extract_to_tmp(call); afs_extract_to_tmp(call);
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* Extract the file ACL length */ /* Extract the file ACL length */
case 1: case 1:
...@@ -1999,6 +2010,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) ...@@ -1999,6 +2010,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
iov_iter_discard(&call->iter, READ, size); iov_iter_discard(&call->iter, READ, size);
} }
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* Extract the file ACL */ /* Extract the file ACL */
case 2: case 2:
...@@ -2008,6 +2020,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) ...@@ -2008,6 +2020,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
afs_extract_to_tmp(call); afs_extract_to_tmp(call);
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* Extract the volume ACL length */ /* Extract the volume ACL length */
case 3: case 3:
...@@ -2029,6 +2042,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) ...@@ -2029,6 +2042,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
iov_iter_discard(&call->iter, READ, size); iov_iter_discard(&call->iter, READ, size);
} }
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* Extract the volume ACL */ /* Extract the volume ACL */
case 4: case 4:
...@@ -2041,6 +2055,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) ...@@ -2041,6 +2055,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
sizeof(struct yfs_xdr_YFSFetchStatus) + sizeof(struct yfs_xdr_YFSFetchStatus) +
sizeof(struct yfs_xdr_YFSVolSync)); sizeof(struct yfs_xdr_YFSVolSync));
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* extract the metadata */ /* extract the metadata */
case 5: case 5:
...@@ -2057,6 +2072,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) ...@@ -2057,6 +2072,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
xdr_decode_YFSVolSync(&bp, call->out_volsync); xdr_decode_YFSVolSync(&bp, call->out_volsync);
call->unmarshall++; call->unmarshall++;
/* Fall through */
case 6: case 6:
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment