mirror of https://gitee.com/openkylin/linux.git
Wimplicit-fallthrough patches for 5.3-rc2
Hi Linus, Please, pull the following patches that mark switch cases where we are expecting to fall through. These patches are part of the ongoing efforts to enable -Wimplicit-fallthrough. Most of them have been baking in linux-next for a whole development cycle. Also, pull the Makefile patch that globally enables the -Wimplicit-fallthrough option. Finally, some missing-break fixes that have been tagged for -stable: - drm/amdkfd: Fix missing break in switch statement - drm/amdgpu/gfx10: Fix missing break in switch statement Notice that with these changes, we completely get rid of all the fall-through warnings in the kernel. Thanks Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkmRahXBSurMIg1YvRwW0y0cG2zEFAl06XP0ACgkQRwW0y0cG 2zHPXhAAsatJGNIg7vuSicVipJBIlwgRLwtbE2rV+MCneUAZj37O9NtBgbxHNoJ+ 5TBB8sLpNCw3rEvPKwm6vicRgntMclEY1vaplPOHt3RiY4lqVSIkpvFSCw1hGur3 +34+O++n/6HbtY96T+DN5WGMXrU3JSe46xnBLIt0BOoUwyKMaNdntiyd79GrrnyB BwPkHrmB+9FEVq+dHmPnRIhc9WUfIdily3+j1CIncaM4eXKWLjoUlOIw1VcSEc4X SSdFh2co+3nm/6O54ZxUEC1PyuQZWedsgFmeiTrOanG3AEWQ/jX7GwXvPlgraa2E F5MzGUOQwXYL/IzXl1vGjQc4+FV4nhIjEBTDdZseOp7FP5xkHyyOwzGDEmaMXpXT XThb+k7Q6EbiSPLFcz8zkCwNB8ngNJMNOsGP3JPFD06MfquqdzP7T1BsHcNtiMVo FNwQg9KtvbK9F7a9lXDqfcxfuEScbqSvnKWWwNLImCqIBATYirJzeTeLvTbVWpA2 iyXF3ylIclsSMOvCtaz41iuoqNh12eqw2UIFPBmkU2wpVkTt+ZIn0Apgom90xe1K tSUqMBbBMoHVtsBsILdkdz/m6FJpK+YmmwpRrJSDvPxA5c9caD7cj+62amW/gP4z Hi6mC4hw1H5bKMsC2PP/QgJcmS/pgo1zwA9J2a2NNJbYPATHfKI= =J2sO -----END PGP SIGNATURE----- Merge tag 'Wimplicit-fallthrough-5.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux Pull Wimplicit-fallthrough enablement from Gustavo A. R. Silva: "This marks switch cases where we are expecting to fall through, and globally enables the -Wimplicit-fallthrough option in the main Makefile. Finally, some missing-break fixes that have been tagged for -stable: - drm/amdkfd: Fix missing break in switch statement - drm/amdgpu/gfx10: Fix missing break in switch statement With these changes, we completely get rid of all the fall-through warnings in the kernel" * tag 'Wimplicit-fallthrough-5.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: Makefile: Globally enable fall-through warning drm/i915: Mark expected switch fall-throughs drm/amd/display: Mark expected switch fall-throughs drm/amdkfd/kfd_mqd_manager_v10: Avoid fall-through warning drm/amdgpu/gfx10: Fix missing break in switch statement drm/amdkfd: Fix missing break in switch statement perf/x86/intel: Mark expected switch fall-throughs mtd: onenand_base: Mark expected switch fall-through afs: fsclient: Mark expected switch fall-throughs afs: yfsclient: Mark expected switch fall-throughs can: mark expected switch fall-throughs firewire: mark expected switch fall-throughs
This commit is contained in:
commit
88c5083442
|
@ -119,3 +119,17 @@ array may exceed the remaining memory in the stack segment. This could
|
|||
lead to a crash, possible overwriting sensitive contents at the end of the
|
||||
stack (when built without `CONFIG_THREAD_INFO_IN_TASK=y`), or overwriting
|
||||
memory adjacent to the stack (when built without `CONFIG_VMAP_STACK=y`)
|
||||
|
||||
Implicit switch case fall-through
|
||||
---------------------------------
|
||||
The C language allows switch cases to "fall through" when
|
||||
a "break" statement is missing at the end of a case. This,
|
||||
however, introduces ambiguity in the code, as it's not always
|
||||
clear if the missing break is intentional or a bug. As there
|
||||
have been a long list of flaws `due to missing "break" statements
|
||||
<https://cwe.mitre.org/data/definitions/484.html>`_, we no longer allow
|
||||
"implicit fall-through". In order to identify an intentional fall-through
|
||||
case, we have adopted the marking used by static analyzers: a comment
|
||||
saying `/* Fall through */`. Once the C++17 `__attribute__((fallthrough))`
|
||||
is more widely handled by C compilers, static analyzers, and IDEs, we can
|
||||
switch to using that instead.
|
||||
|
|
3
Makefile
3
Makefile
|
@ -843,6 +843,9 @@ NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
|
|||
# warn about C99 declaration after statement
|
||||
KBUILD_CFLAGS += -Wdeclaration-after-statement
|
||||
|
||||
# Warn about unmarked fall-throughs in switch statement.
|
||||
KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough=3,)
|
||||
|
||||
# Variable Length Arrays (VLAs) should not be used anywhere in the kernel
|
||||
KBUILD_CFLAGS += -Wvla
|
||||
|
||||
|
|
|
@ -4955,6 +4955,7 @@ __init int intel_pmu_init(void)
|
|||
|
||||
case INTEL_FAM6_SKYLAKE_X:
|
||||
pmem = true;
|
||||
/* fall through */
|
||||
case INTEL_FAM6_SKYLAKE_MOBILE:
|
||||
case INTEL_FAM6_SKYLAKE_DESKTOP:
|
||||
case INTEL_FAM6_KABYLAKE_MOBILE:
|
||||
|
@ -5004,6 +5005,7 @@ __init int intel_pmu_init(void)
|
|||
case INTEL_FAM6_ICELAKE_X:
|
||||
case INTEL_FAM6_ICELAKE_XEON_D:
|
||||
pmem = true;
|
||||
/* fall through */
|
||||
case INTEL_FAM6_ICELAKE_MOBILE:
|
||||
case INTEL_FAM6_ICELAKE_DESKTOP:
|
||||
x86_pmu.late_ack = true;
|
||||
|
|
|
@ -957,7 +957,7 @@ static void set_broadcast_channel(struct fw_device *device, int generation)
|
|||
device->bc_implemented = BC_IMPLEMENTED;
|
||||
break;
|
||||
}
|
||||
/* else fall through to case address error */
|
||||
/* else, fall through - to case address error */
|
||||
case RCODE_ADDRESS_ERROR:
|
||||
device->bc_implemented = BC_UNIMPLEMENTED;
|
||||
}
|
||||
|
|
|
@ -284,7 +284,7 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation,
|
|||
if ((data[0] & bit) == (data[1] & bit))
|
||||
continue;
|
||||
|
||||
/* 1394-1995 IRM, fall through to retry. */
|
||||
/* fall through - It's a 1394-1995 IRM, retry. */
|
||||
default:
|
||||
if (retry) {
|
||||
retry--;
|
||||
|
|
|
@ -54,6 +54,7 @@ static u32 *count_ports(u32 *sid, int *total_port_count, int *child_port_count)
|
|||
switch (port_type) {
|
||||
case SELFID_PORT_CHILD:
|
||||
(*child_port_count)++;
|
||||
/* fall through */
|
||||
case SELFID_PORT_PARENT:
|
||||
case SELFID_PORT_NCONN:
|
||||
(*total_port_count)++;
|
||||
|
|
|
@ -4620,6 +4620,7 @@ gfx_v10_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,
|
|||
cp_int_cntl = REG_SET_FIELD(cp_int_cntl, CP_INT_CNTL_RING0,
|
||||
TIME_STAMP_INT_ENABLE, 0);
|
||||
WREG32(cp_int_cntl_reg, cp_int_cntl);
|
||||
break;
|
||||
case AMDGPU_IRQ_STATE_ENABLE:
|
||||
cp_int_cntl = RREG32(cp_int_cntl_reg);
|
||||
cp_int_cntl = REG_SET_FIELD(cp_int_cntl, CP_INT_CNTL_RING0,
|
||||
|
|
|
@ -668,6 +668,7 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
|
|||
case CHIP_RAVEN:
|
||||
pcache_info = raven_cache_info;
|
||||
num_of_cache_types = ARRAY_SIZE(raven_cache_info);
|
||||
break;
|
||||
case CHIP_NAVI10:
|
||||
pcache_info = navi10_cache_info;
|
||||
num_of_cache_types = ARRAY_SIZE(navi10_cache_info);
|
||||
|
|
|
@ -429,7 +429,6 @@ struct mqd_manager *mqd_manager_init_v10(enum KFD_MQD_TYPE type,
|
|||
|
||||
switch (type) {
|
||||
case KFD_MQD_TYPE_CP:
|
||||
pr_debug("%s@%i\n", __func__, __LINE__);
|
||||
case KFD_MQD_TYPE_COMPUTE:
|
||||
pr_debug("%s@%i\n", __func__, __LINE__);
|
||||
mqd->allocate_mqd = allocate_mqd;
|
||||
|
|
|
@ -102,14 +102,19 @@ void dccg2_init(struct dccg *dccg)
|
|||
switch (dccg_dcn->base.ctx->dc->res_pool->pipe_count) {
|
||||
case 6:
|
||||
REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[5], 1);
|
||||
/* Fall through */
|
||||
case 5:
|
||||
REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[4], 1);
|
||||
/* Fall through */
|
||||
case 4:
|
||||
REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[3], 1);
|
||||
/* Fall through */
|
||||
case 3:
|
||||
REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[2], 1);
|
||||
/* Fall through */
|
||||
case 2:
|
||||
REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[1], 1);
|
||||
/* Fall through */
|
||||
case 1:
|
||||
REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[0], 1);
|
||||
break;
|
||||
|
|
|
@ -16,7 +16,6 @@ subdir-ccflags-y := -Wall -Wextra
|
|||
subdir-ccflags-y += $(call cc-disable-warning, unused-parameter)
|
||||
subdir-ccflags-y += $(call cc-disable-warning, type-limits)
|
||||
subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers)
|
||||
subdir-ccflags-y += $(call cc-disable-warning, implicit-fallthrough)
|
||||
subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable)
|
||||
# clang warnings
|
||||
subdir-ccflags-y += $(call cc-disable-warning, sign-compare)
|
||||
|
|
|
@ -12042,7 +12042,7 @@ static bool check_digital_port_conflicts(struct intel_atomic_state *state)
|
|||
case INTEL_OUTPUT_DDI:
|
||||
if (WARN_ON(!HAS_DDI(to_i915(dev))))
|
||||
break;
|
||||
/* else: fall through */
|
||||
/* else, fall through */
|
||||
case INTEL_OUTPUT_DP:
|
||||
case INTEL_OUTPUT_HDMI:
|
||||
case INTEL_OUTPUT_EDP:
|
||||
|
|
|
@ -231,6 +231,7 @@ static int intel_dp_get_fia_supported_lane_count(struct intel_dp *intel_dp)
|
|||
switch (lane_info) {
|
||||
default:
|
||||
MISSING_CASE(lane_info);
|
||||
/* fall through */
|
||||
case 1:
|
||||
case 2:
|
||||
case 4:
|
||||
|
|
|
@ -341,7 +341,7 @@ vm_fault_t i915_gem_fault(struct vm_fault *vmf)
|
|||
*/
|
||||
if (!i915_terminally_wedged(i915))
|
||||
return VM_FAULT_SIGBUS;
|
||||
/* else: fall through */
|
||||
/* else, fall through */
|
||||
case -EAGAIN:
|
||||
/*
|
||||
* EAGAIN means the gpu is hung and we'll wait for the error
|
||||
|
|
|
@ -268,7 +268,7 @@ static void *i915_gem_object_map(const struct drm_i915_gem_object *obj,
|
|||
switch (type) {
|
||||
default:
|
||||
MISSING_CASE(type);
|
||||
/* fallthrough to use PAGE_KERNEL anyway */
|
||||
/* fallthrough - to use PAGE_KERNEL anyway */
|
||||
case I915_MAP_WB:
|
||||
pgprot = PAGE_KERNEL;
|
||||
break;
|
||||
|
|
|
@ -1194,6 +1194,7 @@ static void error_record_engine_registers(struct i915_gpu_state *error,
|
|||
switch (engine->id) {
|
||||
default:
|
||||
MISSING_CASE(engine->id);
|
||||
/* fall through */
|
||||
case RCS0:
|
||||
mmio = RENDER_HWS_PGA_GEN7;
|
||||
break;
|
||||
|
|
|
@ -3259,6 +3259,7 @@ static void onenand_check_features(struct mtd_info *mtd)
|
|||
switch (density) {
|
||||
case ONENAND_DEVICE_DENSITY_8Gb:
|
||||
this->options |= ONENAND_HAS_NOP_1;
|
||||
/* fall through */
|
||||
case ONENAND_DEVICE_DENSITY_4Gb:
|
||||
if (ONENAND_IS_DDP(this))
|
||||
this->options |= ONENAND_HAS_2PLANE;
|
||||
|
|
|
@ -898,7 +898,8 @@ static void at91_irq_err_state(struct net_device *dev,
|
|||
CAN_ERR_CRTL_TX_WARNING :
|
||||
CAN_ERR_CRTL_RX_WARNING;
|
||||
}
|
||||
case CAN_STATE_ERROR_WARNING: /* fallthrough */
|
||||
/* fall through */
|
||||
case CAN_STATE_ERROR_WARNING:
|
||||
/*
|
||||
* from: ERROR_ACTIVE, ERROR_WARNING
|
||||
* to : ERROR_PASSIVE, BUS_OFF
|
||||
|
@ -947,7 +948,8 @@ static void at91_irq_err_state(struct net_device *dev,
|
|||
netdev_dbg(dev, "Error Active\n");
|
||||
cf->can_id |= CAN_ERR_PROT;
|
||||
cf->data[2] = CAN_ERR_PROT_ACTIVE;
|
||||
case CAN_STATE_ERROR_WARNING: /* fallthrough */
|
||||
/* fall through */
|
||||
case CAN_STATE_ERROR_WARNING:
|
||||
reg_idr = AT91_IRQ_ERRA | AT91_IRQ_WARN | AT91_IRQ_BOFF;
|
||||
reg_ier = AT91_IRQ_ERRP;
|
||||
break;
|
||||
|
|
|
@ -660,7 +660,7 @@ static int pciefd_can_probe(struct pciefd_board *pciefd)
|
|||
pciefd_can_writereg(priv, CANFD_CLK_SEL_80MHZ,
|
||||
PCIEFD_REG_CAN_CLK_SEL);
|
||||
|
||||
/* fallthough */
|
||||
/* fall through */
|
||||
case CANFD_CLK_SEL_80MHZ:
|
||||
priv->ucan.can.clock.freq = 80 * 1000 * 1000;
|
||||
break;
|
||||
|
|
|
@ -860,7 +860,8 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)
|
|||
if (new_state >= CAN_STATE_ERROR_WARNING &&
|
||||
new_state <= CAN_STATE_BUS_OFF)
|
||||
priv->can.can_stats.error_warning++;
|
||||
case CAN_STATE_ERROR_WARNING: /* fallthrough */
|
||||
/* fall through */
|
||||
case CAN_STATE_ERROR_WARNING:
|
||||
if (new_state >= CAN_STATE_ERROR_PASSIVE &&
|
||||
new_state <= CAN_STATE_BUS_OFF)
|
||||
priv->can.can_stats.error_passive++;
|
||||
|
|
|
@ -415,7 +415,7 @@ static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n,
|
|||
new_state = CAN_STATE_ERROR_WARNING;
|
||||
break;
|
||||
}
|
||||
/* else: fall through */
|
||||
/* fall through */
|
||||
|
||||
case CAN_STATE_ERROR_WARNING:
|
||||
if (n & PCAN_USB_ERROR_BUS_HEAVY) {
|
||||
|
|
|
@ -339,8 +339,9 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
|
|||
call->tmp_u = htonl(0);
|
||||
afs_extract_to_tmp(call);
|
||||
}
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the returned data length */
|
||||
/* extract the returned data length */
|
||||
case 1:
|
||||
_debug("extract data length");
|
||||
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];
|
||||
iov_iter_bvec(&call->iter, READ, call->bvec, 1, size);
|
||||
ASSERTCMP(size, <=, PAGE_SIZE);
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the returned data */
|
||||
/* extract the returned data */
|
||||
case 2:
|
||||
_debug("extract data %zu/%llu",
|
||||
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 */
|
||||
iov_iter_discard(&call->iter, READ, req->actual_len - req->len);
|
||||
call->unmarshall = 3;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case 3:
|
||||
_debug("extract discard %zu/%llu",
|
||||
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:
|
||||
call->unmarshall = 4;
|
||||
afs_extract_to_buf(call, (21 + 3 + 6) * 4);
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the metadata */
|
||||
/* extract the metadata */
|
||||
case 4:
|
||||
ret = afs_extract_data(call, false);
|
||||
if (ret < 0)
|
||||
|
@ -1471,8 +1474,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call)
|
|||
case 0:
|
||||
call->unmarshall++;
|
||||
afs_extract_to_buf(call, 12 * 4);
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the returned status record */
|
||||
/* extract the returned status record */
|
||||
case 1:
|
||||
_debug("extract status");
|
||||
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);
|
||||
call->unmarshall++;
|
||||
afs_extract_to_tmp(call);
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the volume name length */
|
||||
/* extract the volume name length */
|
||||
case 2:
|
||||
ret = afs_extract_data(call, true);
|
||||
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 */
|
||||
afs_extract_to_buf(call, size);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the volume name */
|
||||
/* extract the volume name */
|
||||
case 3:
|
||||
_debug("extract volname");
|
||||
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);
|
||||
afs_extract_to_tmp(call);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the offline message length */
|
||||
/* extract the offline message length */
|
||||
case 4:
|
||||
ret = afs_extract_data(call, true);
|
||||
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 */
|
||||
afs_extract_to_buf(call, size);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the offline message */
|
||||
/* extract the offline message */
|
||||
case 5:
|
||||
_debug("extract offline");
|
||||
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);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the message of the day length */
|
||||
/* extract the message of the day length */
|
||||
case 6:
|
||||
ret = afs_extract_data(call, true);
|
||||
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 */
|
||||
afs_extract_to_buf(call, size);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the message of the day */
|
||||
/* extract the message of the day */
|
||||
case 7:
|
||||
_debug("extract motd");
|
||||
ret = afs_extract_data(call, false);
|
||||
|
@ -1850,8 +1860,9 @@ static int afs_deliver_fs_get_capabilities(struct afs_call *call)
|
|||
case 0:
|
||||
afs_extract_to_tmp(call);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the capabilities word count */
|
||||
/* Extract the capabilities word count */
|
||||
case 1:
|
||||
ret = afs_extract_data(call, true);
|
||||
if (ret < 0)
|
||||
|
@ -1863,8 +1874,9 @@ static int afs_deliver_fs_get_capabilities(struct afs_call *call)
|
|||
call->count2 = count;
|
||||
iov_iter_discard(&call->iter, READ, count * sizeof(__be32));
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract capabilities words */
|
||||
/* Extract capabilities words */
|
||||
case 2:
|
||||
ret = afs_extract_data(call, false);
|
||||
if (ret < 0)
|
||||
|
@ -2020,9 +2032,9 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call)
|
|||
case 0:
|
||||
afs_extract_to_tmp(call);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Extract the file status count and array in two steps */
|
||||
/* Fall through */
|
||||
case 1:
|
||||
_debug("extract status count");
|
||||
ret = afs_extract_data(call, true);
|
||||
|
@ -2039,8 +2051,8 @@ 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 */
|
||||
|
||||
case 2:
|
||||
_debug("extract status array %u", call->count);
|
||||
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->unmarshall++;
|
||||
afs_extract_to_tmp(call);
|
||||
/* Fall through */
|
||||
|
||||
/* Extract the callback count and array in two steps */
|
||||
/* Fall through */
|
||||
case 3:
|
||||
_debug("extract CB count");
|
||||
ret = afs_extract_data(call, true);
|
||||
|
@ -2078,8 +2090,8 @@ 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 */
|
||||
|
||||
case 4:
|
||||
_debug("extract CB array");
|
||||
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));
|
||||
call->unmarshall++;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case 5:
|
||||
ret = afs_extract_data(call, false);
|
||||
if (ret < 0)
|
||||
|
@ -2193,6 +2205,7 @@ static int afs_deliver_fs_fetch_acl(struct afs_call *call)
|
|||
case 0:
|
||||
afs_extract_to_tmp(call);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* extract the returned data length */
|
||||
case 1:
|
||||
|
@ -2210,6 +2223,7 @@ static int afs_deliver_fs_fetch_acl(struct afs_call *call)
|
|||
acl->size = call->count2;
|
||||
afs_extract_begin(call, acl->data, size);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* extract the returned data */
|
||||
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);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* extract the metadata */
|
||||
case 3:
|
||||
|
|
|
@ -450,8 +450,9 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
|
|||
req->offset = req->pos & (PAGE_SIZE - 1);
|
||||
afs_extract_to_tmp64(call);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the returned data length */
|
||||
/* extract the returned data length */
|
||||
case 1:
|
||||
_debug("extract data length");
|
||||
ret = afs_extract_data(call, true);
|
||||
|
@ -477,8 +478,9 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
|
|||
call->bvec[0].bv_page = req->pages[req->index];
|
||||
iov_iter_bvec(&call->iter, READ, call->bvec, 1, size);
|
||||
ASSERTCMP(size, <=, PAGE_SIZE);
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the returned data */
|
||||
/* extract the returned data */
|
||||
case 2:
|
||||
_debug("extract data %zu/%llu",
|
||||
iov_iter_count(&call->iter), req->remain);
|
||||
|
@ -505,8 +507,8 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
|
|||
/* Discard any excess data the server gave us */
|
||||
iov_iter_discard(&call->iter, READ, req->actual_len - req->len);
|
||||
call->unmarshall = 3;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case 3:
|
||||
_debug("extract discard %zu/%llu",
|
||||
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)
|
|||
sizeof(struct yfs_xdr_YFSFetchStatus) +
|
||||
sizeof(struct yfs_xdr_YFSCallBack) +
|
||||
sizeof(struct yfs_xdr_YFSVolSync));
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the metadata */
|
||||
/* extract the metadata */
|
||||
case 4:
|
||||
ret = afs_extract_data(call, false);
|
||||
if (ret < 0)
|
||||
|
@ -539,8 +542,8 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call)
|
|||
req->file_size = call->out_scb->status.size;
|
||||
|
||||
call->unmarshall++;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case 5:
|
||||
break;
|
||||
}
|
||||
|
@ -1429,8 +1432,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
|
|||
case 0:
|
||||
call->unmarshall++;
|
||||
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:
|
||||
_debug("extract status");
|
||||
ret = afs_extract_data(call, true);
|
||||
|
@ -1441,8 +1445,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
|
|||
xdr_decode_YFSFetchVolumeStatus(&bp, call->out_volstatus);
|
||||
call->unmarshall++;
|
||||
afs_extract_to_tmp(call);
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the volume name length */
|
||||
/* extract the volume name length */
|
||||
case 2:
|
||||
ret = afs_extract_data(call, true);
|
||||
if (ret < 0)
|
||||
|
@ -1456,8 +1461,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
|
|||
size = (call->count + 3) & ~3; /* It's padded */
|
||||
afs_extract_to_buf(call, size);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the volume name */
|
||||
/* extract the volume name */
|
||||
case 3:
|
||||
_debug("extract volname");
|
||||
ret = afs_extract_data(call, true);
|
||||
|
@ -1469,8 +1475,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
|
|||
_debug("volname '%s'", p);
|
||||
afs_extract_to_tmp(call);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the offline message length */
|
||||
/* extract the offline message length */
|
||||
case 4:
|
||||
ret = afs_extract_data(call, true);
|
||||
if (ret < 0)
|
||||
|
@ -1484,8 +1491,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
|
|||
size = (call->count + 3) & ~3; /* It's padded */
|
||||
afs_extract_to_buf(call, size);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the offline message */
|
||||
/* extract the offline message */
|
||||
case 5:
|
||||
_debug("extract offline");
|
||||
ret = afs_extract_data(call, true);
|
||||
|
@ -1498,8 +1506,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
|
|||
|
||||
afs_extract_to_tmp(call);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the message of the day length */
|
||||
/* extract the message of the day length */
|
||||
case 6:
|
||||
ret = afs_extract_data(call, true);
|
||||
if (ret < 0)
|
||||
|
@ -1513,8 +1522,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
|
|||
size = (call->count + 3) & ~3; /* It's padded */
|
||||
afs_extract_to_buf(call, size);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Fall through - and extract the message of the day */
|
||||
/* extract the message of the day */
|
||||
case 7:
|
||||
_debug("extract motd");
|
||||
ret = afs_extract_data(call, false);
|
||||
|
@ -1526,8 +1536,8 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call)
|
|||
_debug("motd '%s'", p);
|
||||
|
||||
call->unmarshall++;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case 8:
|
||||
break;
|
||||
}
|
||||
|
@ -1805,9 +1815,9 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
|
|||
case 0:
|
||||
afs_extract_to_tmp(call);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Extract the file status count and array in two steps */
|
||||
/* Fall through */
|
||||
case 1:
|
||||
_debug("extract status count");
|
||||
ret = afs_extract_data(call, true);
|
||||
|
@ -1824,8 +1834,8 @@ 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 */
|
||||
|
||||
case 2:
|
||||
_debug("extract status array %u", call->count);
|
||||
ret = afs_extract_data(call, true);
|
||||
|
@ -1845,9 +1855,9 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
|
|||
call->count = 0;
|
||||
call->unmarshall++;
|
||||
afs_extract_to_tmp(call);
|
||||
/* Fall through */
|
||||
|
||||
/* Extract the callback count and array in two steps */
|
||||
/* Fall through */
|
||||
case 3:
|
||||
_debug("extract CB count");
|
||||
ret = afs_extract_data(call, true);
|
||||
|
@ -1863,8 +1873,8 @@ 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 */
|
||||
|
||||
case 4:
|
||||
_debug("extract CB array");
|
||||
ret = afs_extract_data(call, true);
|
||||
|
@ -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));
|
||||
call->unmarshall++;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case 5:
|
||||
ret = afs_extract_data(call, false);
|
||||
if (ret < 0)
|
||||
|
@ -1892,8 +1902,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call)
|
|||
xdr_decode_YFSVolSync(&bp, call->out_volsync);
|
||||
|
||||
call->unmarshall++;
|
||||
|
||||
/* Fall through */
|
||||
|
||||
case 6:
|
||||
break;
|
||||
}
|
||||
|
@ -1978,6 +1988,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
|
|||
case 0:
|
||||
afs_extract_to_tmp(call);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Extract the file ACL length */
|
||||
case 1:
|
||||
|
@ -1999,6 +2010,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
|
|||
iov_iter_discard(&call->iter, READ, size);
|
||||
}
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Extract the file ACL */
|
||||
case 2:
|
||||
|
@ -2008,6 +2020,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
|
|||
|
||||
afs_extract_to_tmp(call);
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Extract the volume ACL length */
|
||||
case 3:
|
||||
|
@ -2029,6 +2042,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
|
|||
iov_iter_discard(&call->iter, READ, size);
|
||||
}
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* Extract the volume ACL */
|
||||
case 4:
|
||||
|
@ -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_YFSVolSync));
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
/* extract the metadata */
|
||||
case 5:
|
||||
|
@ -2057,6 +2072,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call)
|
|||
xdr_decode_YFSVolSync(&bp, call->out_volsync);
|
||||
|
||||
call->unmarshall++;
|
||||
/* Fall through */
|
||||
|
||||
case 6:
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue