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>
This commit is contained in:
Gustavo A. R. Silva 2019-05-19 18:43:53 -05:00
parent 35a3a90cc5
commit 2988160827
1 changed files with 33 additions and 18 deletions

View File

@ -339,8 +339,9 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
call->tmp_u = htonl(0); call->tmp_u = htonl(0);
afs_extract_to_tmp(call); afs_extract_to_tmp(call);
} }
/* 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);
@ -366,8 +367,9 @@ static int afs_deliver_fs_fetch_data(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);
@ -394,8 +396,8 @@ static int afs_deliver_fs_fetch_data(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);
@ -407,8 +409,9 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
no_more_data: no_more_data:
call->unmarshall = 4; call->unmarshall = 4;
afs_extract_to_buf(call, (21 + 3 + 6) * 4); afs_extract_to_buf(call, (21 + 3 + 6) * 4);
/* 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)
@ -1471,8 +1474,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call)
case 0: case 0:
call->unmarshall++; call->unmarshall++;
afs_extract_to_buf(call, 12 * 4); afs_extract_to_buf(call, 12 * 4);
/* 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);
@ -1483,8 +1487,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call)
xdr_decode_AFSFetchVolumeStatus(&bp, call->out_volstatus); xdr_decode_AFSFetchVolumeStatus(&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)
@ -1498,8 +1503,9 @@ static int afs_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);
@ -1511,8 +1517,9 @@ static int afs_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)
@ -1526,8 +1533,9 @@ static int afs_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);
@ -1540,8 +1548,9 @@ static int afs_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)
@ -1555,8 +1564,9 @@ static int afs_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);
@ -1850,8 +1860,9 @@ static int afs_deliver_fs_get_capabilities(struct afs_call *call)
case 0: case 0:
afs_extract_to_tmp(call); afs_extract_to_tmp(call);
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* Fall through - and extract the capabilities word count */ /* Extract the capabilities word count */
case 1: case 1:
ret = afs_extract_data(call, true); ret = afs_extract_data(call, true);
if (ret < 0) if (ret < 0)
@ -1863,8 +1874,9 @@ static int afs_deliver_fs_get_capabilities(struct afs_call *call)
call->count2 = count; call->count2 = count;
iov_iter_discard(&call->iter, READ, count * sizeof(__be32)); iov_iter_discard(&call->iter, READ, count * sizeof(__be32));
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* Fall through - and extract capabilities words */ /* Extract capabilities words */
case 2: case 2:
ret = afs_extract_data(call, false); ret = afs_extract_data(call, false);
if (ret < 0) if (ret < 0)
@ -2020,9 +2032,9 @@ static int afs_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);
@ -2039,8 +2051,8 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call)
call->unmarshall++; call->unmarshall++;
more_counts: more_counts:
afs_extract_to_buf(call, 21 * sizeof(__be32)); afs_extract_to_buf(call, 21 * sizeof(__be32));
/* 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);
@ -2060,9 +2072,9 @@ static int afs_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);
@ -2078,8 +2090,8 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call)
call->unmarshall++; call->unmarshall++;
more_cbs: more_cbs:
afs_extract_to_buf(call, 3 * sizeof(__be32)); afs_extract_to_buf(call, 3 * sizeof(__be32));
/* 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);
@ -2096,8 +2108,8 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call)
afs_extract_to_buf(call, 6 * sizeof(__be32)); afs_extract_to_buf(call, 6 * sizeof(__be32));
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)
@ -2193,6 +2205,7 @@ static int afs_deliver_fs_fetch_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 returned data length */ /* extract the returned data length */
case 1: case 1:
@ -2210,6 +2223,7 @@ static int afs_deliver_fs_fetch_acl(struct afs_call *call)
acl->size = call->count2; acl->size = call->count2;
afs_extract_begin(call, acl->data, size); afs_extract_begin(call, acl->data, size);
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* extract the returned data */ /* extract the returned data */
case 2: case 2:
@ -2219,6 +2233,7 @@ static int afs_deliver_fs_fetch_acl(struct afs_call *call)
afs_extract_to_buf(call, (21 + 6) * 4); afs_extract_to_buf(call, (21 + 6) * 4);
call->unmarshall++; call->unmarshall++;
/* Fall through */
/* extract the metadata */ /* extract the metadata */
case 3: case 3: