afs: Use fallthrough pseudo-keyword
PATCH 1/1 afs: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case.
Signed-off-by Gustavo A. R. Silva <[email protected]>
--- fs/afs/cmservice.c | 16 ++++++++-------- fs/afs/file.c | 2 +- fs/afs/flock.c | 1 - fs/afs/fsclient.c | 10 +++++----- fs/afs/misc.c | 18 +++++++++--------- fs/afs/rotate.c | 2 +- fs/afs/rxrpc.c | 7 +++---- fs/afs/vlclient.c | 27 +++++++++++++++------------ fs/afs/write.c | 2 +- fs/afs/yfsclient.c | 16 ++++++++-------- 10 files changed, 51 insertions(+), 50 deletions(-)
fs/afs/cmservice.c +8 -8
@@ -252,7 +252,7 @@ static int afs_deliver_cb_callback(struct afs_call *call) call->unmarshall++;/* extract the FID array and its count in two steps */ -/* fall through */ + fallthrough;case 1 :_debug ("extract FID count" ); ret =afs_extract_data (call, true);
@@ -271,7 +271,7 @@ static int afs_deliver_cb_callback(struct afs_call *call)afs_extract_to_buf (call, call->count *3 *4 ); call->unmarshall++; -/* Fall through */ + fallthrough;case 2 :_debug ("extract FID array" ); ret =afs_extract_data (call, true);
@@ -297,7 +297,7 @@ static int afs_deliver_cb_callback(struct afs_call *call) call->unmarshall++;/* extract the callback array and its count in two steps */ -/* fall through */ + fallthrough;case 3 :_debug ("extract CB count" ); ret =afs_extract_data (call, true);
@@ -312,7 +312,7 @@ static int afs_deliver_cb_callback(struct afs_call *call)iov_iter_discard (&call->def_iter,READ , call->count2 *3 *4 ); call->unmarshall++; -/* Fall through */ + fallthrough;case 4 :_debug ("extract discard %zu/%u" ,iov_iter_count (call->iter), call->count2 *3 *4 );
@@ -391,7 +391,7 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call)afs_extract_to_buf (call,11 *sizeof (__be32)); call->unmarshall++; -/* Fall through */ + fallthrough;case 1 :_debug ("extract UUID" ); ret =afs_extract_data (call, false);
@@ -503,7 +503,7 @@ static int afs_deliver_cb_probe_uuid(struct afs_call *call)afs_extract_to_buf (call,11 *sizeof (__be32)); call->unmarshall++; -/* Fall through */ + fallthrough;case 1 :_debug ("extract UUID" ); ret =afs_extract_data (call, false);
@@ -618,7 +618,7 @@ static int afs_deliver_yfs_cb_callback(struct afs_call *call) call->unmarshall++;/* extract the FID array and its count in two steps */ -/* Fall through */ + fallthrough;case 1 :_debug ("extract FID count" ); ret =afs_extract_data (call, true);
@@ -637,7 +637,7 @@ static int afs_deliver_yfs_cb_callback(struct afs_call *call)afs_extract_to_buf (call, size); call->unmarshall++; -/* Fall through */ + fallthrough;case 2 :_debug ("extract FID array" ); ret =afs_extract_data (call, false);
fs/afs/file.c +1 -1
@@ -310,8 +310,8 @@ int afs_page_filler(void *data, struct page *page)/* page will not be cached */ case -ENOBUFS :_debug ("cache said ENOBUFS" ); + fallthrough; -/* fall through */ default : go_on: req =kzalloc (struct_size (req, array,1 ),GFP_KERNEL );
fs/afs/flock.c +0 -1
@@ -376,7 +376,6 @@ void afs_lock_work(struct work_struct *work)spin_unlock (&vnode->lock);return ; -/* Fall through */ default :/* Looks like a lock request was withdrawn. */ spin_unlock (&vnode->lock);
fs/afs/fsclient.c +5 -5
@@ -348,7 +348,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call) call->bvec[0 ].bv_page = req->pages[req->index];iov_iter_bvec (&call->def_iter,READ , call->bvec,1 , size); ASSERTCMP(size, <=, PAGE_SIZE); -/* Fall through */ + fallthrough;/* extract the returned data */ case 2 :
@@ -375,7 +375,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)/* Discard any excess data the server gave us */ afs_extract_discard (call, req->actual_len - req->len); call->unmarshall =3 ; -/* Fall through */ + fallthrough;case 3 : _debug("extract discard %zu/%llu",
@@ -1794,7 +1794,7 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call) call->unmarshall++; more_counts:afs_extract_to_buf (call,21 *sizeof (__be32)); -/* Fall through */ + fallthrough;case 2 :_debug ("extract status array %u" , call->count);
@@ -1841,7 +1841,7 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call) call->unmarshall++; more_cbs:afs_extract_to_buf (call,3 *sizeof (__be32)); -/* Fall through */ + fallthrough;case 4 :_debug ("extract CB array" );
@@ -1870,7 +1870,7 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call)afs_extract_to_buf (call,6 *sizeof (__be32)); call->unmarshall++; -/* Fall through */ + fallthrough;case 5 : ret =afs_extract_data (call, false);
fs/afs/misc.c +9 -9
@@ -120,42 +120,42 @@ void afs_prioritise_error(struct afs_error *e, int error, u32 abort_code)if (e->error == -ETIMEDOUT || e->error == -ETIME )return ; -/* Fall through */ + fallthrough;case -ETIMEDOUT :case -ETIME :if (e->error == -ENOMEM || e->error == -ENONET )return ; -/* Fall through */ + fallthrough;case -ENOMEM :case -ENONET :if (e->error == -ERFKILL )return ; -/* Fall through */ + fallthrough;case -ERFKILL :if (e->error == -EADDRNOTAVAIL )return ; -/* Fall through */ + fallthrough;case -EADDRNOTAVAIL :if (e->error == -ENETUNREACH )return ; -/* Fall through */ + fallthrough;case -ENETUNREACH :if (e->error == -EHOSTUNREACH )return ; -/* Fall through */ + fallthrough;case -EHOSTUNREACH :if (e->error == -EHOSTDOWN )return ; -/* Fall through */ + fallthrough;case -EHOSTDOWN :if (e->error == -ECONNREFUSED )return ; -/* Fall through */ + fallthrough;case -ECONNREFUSED :if (e->error == -ECONNRESET )return ; -/* Fall through */ + fallthrough;case -ECONNRESET :/* Responded, but call expired. */ if (e->responded)return ;
fs/afs/rotate.c +1 -1
@@ -281,7 +281,7 @@ bool afs_select_fileserver(struct afs_operation *op)case -ETIME :if (op->error != -EDESTADDRREQ ) goto iterate_address; -/* Fall through */ + fallthrough;case -ERFKILL :case -EADDRNOTAVAIL :case -ENETUNREACH :
fs/afs/rxrpc.c +3 -4
@@ -568,7 +568,7 @@ static void afs_deliver_to_call(struct afs_call *call)case -EIO :pr_err ("kAFS: Call %u in bad state %u\n" , call->debug_id, state); -/* Fall through */ + fallthrough;case -ENODATA :case -EBADMSG :case -EMSGSIZE :
@@ -668,8 +668,7 @@ long afs_wait_for_call_to_complete(struct afs_call *call,case 0 : ret = call->ret0; call->ret0 =0 ; - -/* Fall through */ + fallthrough;case -ECONNABORTED : ac->responded = true;break ;
@@ -872,7 +871,7 @@ void afs_send_empty_reply(struct afs_call *call)_debug ("oom" );rxrpc_kernel_abort_call (net->socket, call->rxcall,RX_USER_ABORT , -ENOMEM ,"KOO" ); -/* Fall through */ + fallthrough;default :_leave (" [error]" );return ;
fs/afs/vlclient.c +15 -12
@@ -196,7 +196,8 @@ static int afs_deliver_vl_get_addrs_u(struct afs_call *call)/* Extract the returned uuid, uniquifier, nentries and * blkaddrs size */ -/* Fall through */ + fallthrough; +case 1 : ret =afs_extract_data (call, true);if (ret <0 )
@@ -220,8 +221,8 @@ static int afs_deliver_vl_get_addrs_u(struct afs_call *call) more_entries: count =min (call->count,4U );afs_extract_to_buf (call, count *sizeof (__be32)); + fallthrough;/* and extract entries */ -/* Fall through - and extract entries */ case 2 : ret =afs_extract_data (call, call->count >4 );if (ret <0 )
@@ -323,8 +324,8 @@ static int afs_deliver_vl_get_capabilities(struct afs_call *call)case 0 :afs_extract_to_tmp (call); call->unmarshall++; + fallthrough;/* and extract the capabilities word count */ -/* Fall through - and extract the capabilities word count */ case 1 : ret =afs_extract_data (call, true);if (ret <0 )
@@ -336,8 +337,8 @@ static int afs_deliver_vl_get_capabilities(struct afs_call *call) call->unmarshall++;afs_extract_discard (call, count *sizeof (__be32)); + fallthrough;/* and extract capabilities words */ -/* Fall through - and extract capabilities words */ case 2 : ret =afs_extract_data (call, false);if (ret <0 )
@@ -436,7 +437,8 @@ static int afs_deliver_yfsvl_get_endpoints(struct afs_call *call)/* Extract the returned uuid, uniquifier, fsEndpoints count and * either the first fsEndpoint type or the volEndpoints * count if there are no fsEndpoints. */ -/* Fall through */ + fallthrough; +case 1 : ret =afs_extract_data (call, true);if (ret <0 )
@@ -474,8 +476,8 @@ static int afs_deliver_yfsvl_get_endpoints(struct afs_call *call) size +=sizeof (__be32);afs_extract_to_buf (call, size); call->unmarshall =2 ; + fallthrough;/* and extract fsEndpoints[] entries */ -/* Fall through - and extract fsEndpoints[] entries */ case 2 : ret =afs_extract_data (call, true);if (ret <0 )
@@ -526,7 +528,8 @@ static int afs_deliver_yfsvl_get_endpoints(struct afs_call *call)* extract the type of the next endpoint when we extract the * data of the current one, but this is the first... */ -/* Fall through */ + fallthrough; +case 3 : ret =afs_extract_data (call, true);if (ret <0 )
@@ -551,8 +554,8 @@ static int afs_deliver_yfsvl_get_endpoints(struct afs_call *call) size +=sizeof (__be32);/* Get next type too */ afs_extract_to_buf (call, size); call->unmarshall =4 ; + fallthrough;/* and extract volEndpoints[] entries */ -/* Fall through - and extract volEndpoints[] entries */ case 4 : ret =afs_extract_data (call, true);if (ret <0 )
@@ -586,8 +589,8 @@ static int afs_deliver_yfsvl_get_endpoints(struct afs_call *call) end:afs_extract_discard (call,0 ); call->unmarshall =5 ; + fallthrough;/* Done */ -/* Fall through - Done */ case 5 : ret =afs_extract_data (call, false);if (ret <0 )
@@ -662,8 +665,8 @@ static int afs_deliver_yfsvl_get_cell_name(struct afs_call *call)case 0 :afs_extract_to_tmp (call); call->unmarshall++; + fallthrough;/* and extract the cell name length */ -/* Fall through - and extract the cell name length */ case 1 : ret =afs_extract_data (call, true);if (ret <0 )
@@ -684,8 +687,8 @@ static int afs_deliver_yfsvl_get_cell_name(struct afs_call *call)afs_extract_begin (call, cell_name, namesz); call->unmarshall++; + fallthrough;/* and extract cell name */ -/* Fall through - and extract cell name */ case 2 : ret =afs_extract_data (call, true);if (ret <0 )
@@ -693,8 +696,8 @@ static int afs_deliver_yfsvl_get_cell_name(struct afs_call *call)afs_extract_discard (call, call->count2); call->unmarshall++; + fallthrough;/* and extract padding */ -/* Fall through - and extract padding */ case 3 : ret =afs_extract_data (call, false);if (ret <0 )
fs/afs/write.c +1 -1
@@ -608,7 +608,7 @@ static int afs_write_back_from_locked_page(struct address_space *mapping,default :pr_notice ("kAFS: Unexpected error from FS.StoreData %d\n" , ret); -/* Fall through */ + fallthrough;case -EACCES :case -EPERM :case -ENOKEY :
fs/afs/yfsclient.c +8 -8
@@ -428,7 +428,7 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)/* Discard any excess data the server gave us */ afs_extract_discard (call, req->actual_len - req->len); call->unmarshall =3 ; -/* Fall through */ + fallthrough;case 3 : _debug("extract discard %zu/%llu",
@@ -461,7 +461,7 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call) req->file_size = vp->scb.status.size; call->unmarshall++; -/* Fall through */ + fallthrough;case 5 :break ;
@@ -1363,7 +1363,7 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)_debug ("motd '%s'" , p); call->unmarshall++; -/* Fall through */ + fallthrough;case 8 :break ;
@@ -1640,7 +1640,7 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) call->unmarshall++; more_counts:afs_extract_to_buf (call,sizeof (struct yfs_xdr_YFSFetchStatus )); -/* Fall through */ + fallthrough;case 2 :_debug ("extract status array %u" , call->count);
@@ -1687,7 +1687,7 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) call->unmarshall++; more_cbs:afs_extract_to_buf (call,sizeof (struct yfs_xdr_YFSCallBack )); -/* Fall through */ + fallthrough;case 4 :_debug ("extract CB array" );
@@ -1716,7 +1716,7 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)afs_extract_to_buf (call,sizeof (struct yfs_xdr_YFSVolSync )); call->unmarshall++; -/* Fall through */ + fallthrough;case 5 : ret =afs_extract_data (call, false);
@@ -1727,7 +1727,7 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)xdr_decode_YFSVolSync (&bp, &op->volsync); call->unmarshall++; -/* Fall through */ + fallthrough;case 6 :break ;
@@ -1886,7 +1886,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)xdr_decode_YFSVolSync (&bp, &op->volsync); call->unmarshall++; -/* Fall through */ + fallthrough;case 6 :break ;