Commit 5e60366d authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fallthrough-fixes-clang-5.11-rc1' of...

Merge tag 'fallthrough-fixes-clang-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux

Pull fallthrough fixes from Gustavo A. R. Silva:
 "Fix many fall-through warnings when building with Clang 12.0.0
  using -Wimplicit-fallthrough.

   - powerpc: boot: include compiler_attributes.h (Nick Desaulniers)

   - Revert "lib: Revert use of fallthrough pseudo-keyword in lib/"
     (Nick Desaulniers)

   - powerpc: fix -Wimplicit-fallthrough (Nick Desaulniers)

   - lib: Fix fall-through warnings for Clang (Gustavo A. R. Silva)"

* tag 'fallthrough-fixes-clang-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
  lib: Fix fall-through warnings for Clang
  powerpc: fix -Wimplicit-fallthrough
  Revert "lib: Revert use of fallthrough pseudo-keyword in lib/"
  powerpc: boot: include compiler_attributes.h
parents 706451d4 36f9ff9e
...@@ -31,6 +31,7 @@ endif ...@@ -31,6 +31,7 @@ endif
BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \
-pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
-include $(srctree)/include/linux/compiler_attributes.h \
$(LINUXINCLUDE) $(LINUXINCLUDE)
ifdef CONFIG_PPC64_BOOT_WRAPPER ifdef CONFIG_PPC64_BOOT_WRAPPER
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#define STATIC static #define STATIC static
#define INIT #define INIT
#define __always_inline inline
/* /*
* The build process will copy the required zlib source files and headers * The build process will copy the required zlib source files and headers
......
...@@ -355,6 +355,7 @@ static int __init prom_strtobool(const char *s, bool *res) ...@@ -355,6 +355,7 @@ static int __init prom_strtobool(const char *s, bool *res)
default: default:
break; break;
} }
break;
default: default:
break; break;
} }
......
...@@ -141,6 +141,7 @@ int arch_uprobe_exception_notify(struct notifier_block *self, ...@@ -141,6 +141,7 @@ int arch_uprobe_exception_notify(struct notifier_block *self,
case DIE_SSTEP: case DIE_SSTEP:
if (uprobe_post_sstep_notifier(regs)) if (uprobe_post_sstep_notifier(regs))
return NOTIFY_STOP; return NOTIFY_STOP;
break;
default: default:
break; break;
} }
......
...@@ -1500,6 +1500,7 @@ static int update_pmu_ops(struct imc_pmu *pmu) ...@@ -1500,6 +1500,7 @@ static int update_pmu_ops(struct imc_pmu *pmu)
pmu->pmu.stop = trace_imc_event_stop; pmu->pmu.stop = trace_imc_event_stop;
pmu->pmu.read = trace_imc_event_read; pmu->pmu.read = trace_imc_event_read;
pmu->attr_groups[IMC_FORMAT_ATTR] = &trace_imc_format_group; pmu->attr_groups[IMC_FORMAT_ATTR] = &trace_imc_format_group;
break;
default: default:
break; break;
} }
......
...@@ -381,7 +381,7 @@ int asn1_ber_decoder(const struct asn1_decoder *decoder, ...@@ -381,7 +381,7 @@ int asn1_ber_decoder(const struct asn1_decoder *decoder,
case ASN1_OP_END_SET_ACT: case ASN1_OP_END_SET_ACT:
if (unlikely(!(flags & FLAG_MATCHED))) if (unlikely(!(flags & FLAG_MATCHED)))
goto tag_mismatch; goto tag_mismatch;
/* fall through */ fallthrough;
case ASN1_OP_END_SEQ: case ASN1_OP_END_SEQ:
case ASN1_OP_END_SET_OF: case ASN1_OP_END_SET_OF:
...@@ -448,7 +448,7 @@ int asn1_ber_decoder(const struct asn1_decoder *decoder, ...@@ -448,7 +448,7 @@ int asn1_ber_decoder(const struct asn1_decoder *decoder,
pc += asn1_op_lengths[op]; pc += asn1_op_lengths[op];
goto next_op; goto next_op;
} }
/* fall through */ fallthrough;
case ASN1_OP_ACT: case ASN1_OP_ACT:
ret = actions[machine[pc + 1]](context, hdr, tag, data + tdp, len); ret = actions[machine[pc + 1]](context, hdr, tag, data + tdp, len);
......
...@@ -1113,7 +1113,7 @@ struct assoc_array_edit *assoc_array_delete(struct assoc_array *array, ...@@ -1113,7 +1113,7 @@ struct assoc_array_edit *assoc_array_delete(struct assoc_array *array,
index_key)) index_key))
goto found_leaf; goto found_leaf;
} }
/* fall through */ fallthrough;
case assoc_array_walk_tree_empty: case assoc_array_walk_tree_empty:
case assoc_array_walk_found_wrong_shortcut: case assoc_array_walk_found_wrong_shortcut:
default: default:
......
...@@ -827,7 +827,7 @@ int __init xbc_init(char *buf, const char **emsg, int *epos) ...@@ -827,7 +827,7 @@ int __init xbc_init(char *buf, const char **emsg, int *epos)
q - 2); q - 2);
break; break;
} }
/* fall through */ fallthrough;
case '=': case '=':
ret = xbc_parse_kv(&p, q, c); ret = xbc_parse_kv(&p, q, c);
break; break;
...@@ -836,7 +836,7 @@ int __init xbc_init(char *buf, const char **emsg, int *epos) ...@@ -836,7 +836,7 @@ int __init xbc_init(char *buf, const char **emsg, int *epos)
break; break;
case '#': case '#':
q = skip_comment(q); q = skip_comment(q);
/* fall through */ fallthrough;
case ';': case ';':
case '\n': case '\n':
ret = xbc_parse_key(&p, q); ret = xbc_parse_key(&p, q);
......
...@@ -144,27 +144,28 @@ unsigned long long memparse(const char *ptr, char **retptr) ...@@ -144,27 +144,28 @@ unsigned long long memparse(const char *ptr, char **retptr)
case 'E': case 'E':
case 'e': case 'e':
ret <<= 10; ret <<= 10;
/* fall through */ fallthrough;
case 'P': case 'P':
case 'p': case 'p':
ret <<= 10; ret <<= 10;
/* fall through */ fallthrough;
case 'T': case 'T':
case 't': case 't':
ret <<= 10; ret <<= 10;
/* fall through */ fallthrough;
case 'G': case 'G':
case 'g': case 'g':
ret <<= 10; ret <<= 10;
/* fall through */ fallthrough;
case 'M': case 'M':
case 'm': case 'm':
ret <<= 10; ret <<= 10;
/* fall through */ fallthrough;
case 'K': case 'K':
case 'k': case 'k':
ret <<= 10; ret <<= 10;
endptr++; endptr++;
fallthrough;
default: default:
break; break;
} }
......
...@@ -233,7 +233,7 @@ void net_dim(struct dim *dim, struct dim_sample end_sample) ...@@ -233,7 +233,7 @@ void net_dim(struct dim *dim, struct dim_sample end_sample)
schedule_work(&dim->work); schedule_work(&dim->work);
break; break;
} }
/* fall through */ fallthrough;
case DIM_START_MEASURE: case DIM_START_MEASURE:
dim_update_sample(end_sample.event_ctr, end_sample.pkt_ctr, dim_update_sample(end_sample.event_ctr, end_sample.pkt_ctr,
end_sample.byte_ctr, &dim->start_sample); end_sample.byte_ctr, &dim->start_sample);
......
...@@ -59,7 +59,7 @@ static bool rdma_dim_decision(struct dim_stats *curr_stats, struct dim *dim) ...@@ -59,7 +59,7 @@ static bool rdma_dim_decision(struct dim_stats *curr_stats, struct dim *dim)
break; break;
case DIM_STATS_WORSE: case DIM_STATS_WORSE:
dim_turn(dim); dim_turn(dim);
/* fall through */ fallthrough;
case DIM_STATS_BETTER: case DIM_STATS_BETTER:
step_res = rdma_dim_step(dim); step_res = rdma_dim_step(dim);
if (step_res == DIM_ON_EDGE) if (step_res == DIM_ON_EDGE)
...@@ -94,7 +94,7 @@ void rdma_dim(struct dim *dim, u64 completions) ...@@ -94,7 +94,7 @@ void rdma_dim(struct dim *dim, u64 completions)
schedule_work(&dim->work); schedule_work(&dim->work);
break; break;
} }
/* fall through */ fallthrough;
case DIM_START_MEASURE: case DIM_START_MEASURE:
dim->state = DIM_MEASURE_IN_PROGRESS; dim->state = DIM_MEASURE_IN_PROGRESS;
dim_update_sample_with_comps(curr_sample->event_ctr, 0, 0, dim_update_sample_with_comps(curr_sample->event_ctr, 0, 0,
......
...@@ -102,7 +102,7 @@ bool __pure glob_match(char const *pat, char const *str) ...@@ -102,7 +102,7 @@ bool __pure glob_match(char const *pat, char const *str)
break; break;
case '\\': case '\\':
d = *pat++; d = *pat++;
/* fall through */ fallthrough;
default: /* Literal character */ default: /* Literal character */
literal: literal:
if (c == d) { if (c == d) {
......
...@@ -355,6 +355,7 @@ int kstrtobool(const char *s, bool *res) ...@@ -355,6 +355,7 @@ int kstrtobool(const char *s, bool *res)
default: default:
break; break;
} }
break;
default: default:
break; break;
} }
......
...@@ -432,7 +432,7 @@ static int validate_nla(const struct nlattr *nla, int maxtype, ...@@ -432,7 +432,7 @@ static int validate_nla(const struct nlattr *nla, int maxtype,
err = -EINVAL; err = -EINVAL;
goto out_err; goto out_err;
} }
/* fall through */ fallthrough;
case NLA_STRING: case NLA_STRING:
if (attrlen < 1) if (attrlen < 1)
......
...@@ -68,11 +68,11 @@ u64 __siphash_aligned(const void *data, size_t len, const siphash_key_t *key) ...@@ -68,11 +68,11 @@ u64 __siphash_aligned(const void *data, size_t len, const siphash_key_t *key)
bytemask_from_count(left))); bytemask_from_count(left)));
#else #else
switch (left) { switch (left) {
case 7: b |= ((u64)end[6]) << 48; /* fall through */ case 7: b |= ((u64)end[6]) << 48; fallthrough;
case 6: b |= ((u64)end[5]) << 40; /* fall through */ case 6: b |= ((u64)end[5]) << 40; fallthrough;
case 5: b |= ((u64)end[4]) << 32; /* fall through */ case 5: b |= ((u64)end[4]) << 32; fallthrough;
case 4: b |= le32_to_cpup(data); break; case 4: b |= le32_to_cpup(data); break;
case 3: b |= ((u64)end[2]) << 16; /* fall through */ case 3: b |= ((u64)end[2]) << 16; fallthrough;
case 2: b |= le16_to_cpup(data); break; case 2: b |= le16_to_cpup(data); break;
case 1: b |= end[0]; case 1: b |= end[0];
} }
...@@ -101,11 +101,11 @@ u64 __siphash_unaligned(const void *data, size_t len, const siphash_key_t *key) ...@@ -101,11 +101,11 @@ u64 __siphash_unaligned(const void *data, size_t len, const siphash_key_t *key)
bytemask_from_count(left))); bytemask_from_count(left)));
#else #else
switch (left) { switch (left) {
case 7: b |= ((u64)end[6]) << 48; /* fall through */ case 7: b |= ((u64)end[6]) << 48; fallthrough;
case 6: b |= ((u64)end[5]) << 40; /* fall through */ case 6: b |= ((u64)end[5]) << 40; fallthrough;
case 5: b |= ((u64)end[4]) << 32; /* fall through */ case 5: b |= ((u64)end[4]) << 32; fallthrough;
case 4: b |= get_unaligned_le32(end); break; case 4: b |= get_unaligned_le32(end); break;
case 3: b |= ((u64)end[2]) << 16; /* fall through */ case 3: b |= ((u64)end[2]) << 16; fallthrough;
case 2: b |= get_unaligned_le16(end); break; case 2: b |= get_unaligned_le16(end); break;
case 1: b |= end[0]; case 1: b |= end[0];
} }
...@@ -268,11 +268,11 @@ u32 __hsiphash_aligned(const void *data, size_t len, const hsiphash_key_t *key) ...@@ -268,11 +268,11 @@ u32 __hsiphash_aligned(const void *data, size_t len, const hsiphash_key_t *key)
bytemask_from_count(left))); bytemask_from_count(left)));
#else #else
switch (left) { switch (left) {
case 7: b |= ((u64)end[6]) << 48; /* fall through */ case 7: b |= ((u64)end[6]) << 48; fallthrough;
case 6: b |= ((u64)end[5]) << 40; /* fall through */ case 6: b |= ((u64)end[5]) << 40; fallthrough;
case 5: b |= ((u64)end[4]) << 32; /* fall through */ case 5: b |= ((u64)end[4]) << 32; fallthrough;
case 4: b |= le32_to_cpup(data); break; case 4: b |= le32_to_cpup(data); break;
case 3: b |= ((u64)end[2]) << 16; /* fall through */ case 3: b |= ((u64)end[2]) << 16; fallthrough;
case 2: b |= le16_to_cpup(data); break; case 2: b |= le16_to_cpup(data); break;
case 1: b |= end[0]; case 1: b |= end[0];
} }
...@@ -301,11 +301,11 @@ u32 __hsiphash_unaligned(const void *data, size_t len, ...@@ -301,11 +301,11 @@ u32 __hsiphash_unaligned(const void *data, size_t len,
bytemask_from_count(left))); bytemask_from_count(left)));
#else #else
switch (left) { switch (left) {
case 7: b |= ((u64)end[6]) << 48; /* fall through */ case 7: b |= ((u64)end[6]) << 48; fallthrough;
case 6: b |= ((u64)end[5]) << 40; /* fall through */ case 6: b |= ((u64)end[5]) << 40; fallthrough;
case 5: b |= ((u64)end[4]) << 32; /* fall through */ case 5: b |= ((u64)end[4]) << 32; fallthrough;
case 4: b |= get_unaligned_le32(end); break; case 4: b |= get_unaligned_le32(end); break;
case 3: b |= ((u64)end[2]) << 16; /* fall through */ case 3: b |= ((u64)end[2]) << 16; fallthrough;
case 2: b |= get_unaligned_le16(end); break; case 2: b |= get_unaligned_le16(end); break;
case 1: b |= end[0]; case 1: b |= end[0];
} }
...@@ -431,7 +431,7 @@ u32 __hsiphash_aligned(const void *data, size_t len, const hsiphash_key_t *key) ...@@ -431,7 +431,7 @@ u32 __hsiphash_aligned(const void *data, size_t len, const hsiphash_key_t *key)
v0 ^= m; v0 ^= m;
} }
switch (left) { switch (left) {
case 3: b |= ((u32)end[2]) << 16; /* fall through */ case 3: b |= ((u32)end[2]) << 16; fallthrough;
case 2: b |= le16_to_cpup(data); break; case 2: b |= le16_to_cpup(data); break;
case 1: b |= end[0]; case 1: b |= end[0];
} }
...@@ -454,7 +454,7 @@ u32 __hsiphash_unaligned(const void *data, size_t len, ...@@ -454,7 +454,7 @@ u32 __hsiphash_unaligned(const void *data, size_t len,
v0 ^= m; v0 ^= m;
} }
switch (left) { switch (left) {
case 3: b |= ((u32)end[2]) << 16; /* fall through */ case 3: b |= ((u32)end[2]) << 16; fallthrough;
case 2: b |= get_unaligned_le16(end); break; case 2: b |= get_unaligned_le16(end); break;
case 1: b |= end[0]; case 1: b |= end[0];
} }
......
...@@ -193,7 +193,7 @@ static unsigned int fsm_find(struct ts_config *conf, struct ts_state *state) ...@@ -193,7 +193,7 @@ static unsigned int fsm_find(struct ts_config *conf, struct ts_state *state)
TOKEN_MISMATCH(); TOKEN_MISMATCH();
block_idx++; block_idx++;
/* fall through */ fallthrough;
case TS_FSM_ANY: case TS_FSM_ANY:
if (next == NULL) if (next == NULL)
......
...@@ -1265,7 +1265,7 @@ char *mac_address_string(char *buf, char *end, u8 *addr, ...@@ -1265,7 +1265,7 @@ char *mac_address_string(char *buf, char *end, u8 *addr,
case 'R': case 'R':
reversed = true; reversed = true;
/* fall through */ fallthrough;
default: default:
separator = ':'; separator = ':';
...@@ -1682,7 +1682,7 @@ char *uuid_string(char *buf, char *end, const u8 *addr, ...@@ -1682,7 +1682,7 @@ char *uuid_string(char *buf, char *end, const u8 *addr,
switch (*(++fmt)) { switch (*(++fmt)) {
case 'L': case 'L':
uc = true; uc = true;
/* fall through */ fallthrough;
case 'l': case 'l':
index = guid_index; index = guid_index;
break; break;
...@@ -2219,7 +2219,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, ...@@ -2219,7 +2219,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
case 'S': case 'S':
case 's': case 's':
ptr = dereference_symbol_descriptor(ptr); ptr = dereference_symbol_descriptor(ptr);
/* fall through */ fallthrough;
case 'B': case 'B':
return symbol_string(buf, end, ptr, spec, fmt); return symbol_string(buf, end, ptr, spec, fmt);
case 'R': case 'R':
...@@ -2450,7 +2450,7 @@ int format_decode(const char *fmt, struct printf_spec *spec) ...@@ -2450,7 +2450,7 @@ int format_decode(const char *fmt, struct printf_spec *spec)
case 'x': case 'x':
spec->flags |= SMALL; spec->flags |= SMALL;
/* fall through */ fallthrough;
case 'X': case 'X':
spec->base = 16; spec->base = 16;
...@@ -2459,6 +2459,7 @@ int format_decode(const char *fmt, struct printf_spec *spec) ...@@ -2459,6 +2459,7 @@ int format_decode(const char *fmt, struct printf_spec *spec)
case 'd': case 'd':
case 'i': case 'i':
spec->flags |= SIGN; spec->flags |= SIGN;
break;
case 'u': case 'u':
break; break;
...@@ -2468,7 +2469,7 @@ int format_decode(const char *fmt, struct printf_spec *spec) ...@@ -2468,7 +2469,7 @@ int format_decode(const char *fmt, struct printf_spec *spec)
* utility, treat it as any other invalid or * utility, treat it as any other invalid or
* unsupported format specifier. * unsupported format specifier.
*/ */
/* fall through */ fallthrough;
default: default:
WARN_ONCE(1, "Please remove unsupported %%%c in format string\n", *fmt); WARN_ONCE(1, "Please remove unsupported %%%c in format string\n", *fmt);
...@@ -3411,10 +3412,10 @@ int vsscanf(const char *buf, const char *fmt, va_list args) ...@@ -3411,10 +3412,10 @@ int vsscanf(const char *buf, const char *fmt, va_list args)
break; break;
case 'i': case 'i':
base = 0; base = 0;
/* fall through */ fallthrough;
case 'd': case 'd':
is_sign = true; is_sign = true;
/* fall through */ fallthrough;
case 'u': case 'u':
break; break;
case '%': case '%':
......
...@@ -1043,7 +1043,7 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s, ...@@ -1043,7 +1043,7 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s,
s->lzma2.sequence = SEQ_LZMA_PREPARE; s->lzma2.sequence = SEQ_LZMA_PREPARE;
/* fall through */ fallthrough;
case SEQ_LZMA_PREPARE: case SEQ_LZMA_PREPARE:
if (s->lzma2.compressed < RC_INIT_BYTES) if (s->lzma2.compressed < RC_INIT_BYTES)
...@@ -1055,7 +1055,7 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s, ...@@ -1055,7 +1055,7 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s,
s->lzma2.compressed -= RC_INIT_BYTES; s->lzma2.compressed -= RC_INIT_BYTES;
s->lzma2.sequence = SEQ_LZMA_RUN; s->lzma2.sequence = SEQ_LZMA_RUN;
/* fall through */ fallthrough;
case SEQ_LZMA_RUN: case SEQ_LZMA_RUN:
/* /*
......
...@@ -583,7 +583,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -583,7 +583,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
if (ret != XZ_OK) if (ret != XZ_OK)
return ret; return ret;
/* fall through */ fallthrough;
case SEQ_BLOCK_START: case SEQ_BLOCK_START:
/* We need one byte of input to continue. */ /* We need one byte of input to continue. */
...@@ -608,7 +608,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -608,7 +608,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->temp.pos = 0; s->temp.pos = 0;
s->sequence = SEQ_BLOCK_HEADER; s->sequence = SEQ_BLOCK_HEADER;
/* fall through */ fallthrough;
case SEQ_BLOCK_HEADER: case SEQ_BLOCK_HEADER:
if (!fill_temp(s, b)) if (!fill_temp(s, b))
...@@ -620,7 +620,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -620,7 +620,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_UNCOMPRESS; s->sequence = SEQ_BLOCK_UNCOMPRESS;
/* fall through */ fallthrough;
case SEQ_BLOCK_UNCOMPRESS: case SEQ_BLOCK_UNCOMPRESS:
ret = dec_block(s, b); ret = dec_block(s, b);
...@@ -629,7 +629,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -629,7 +629,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_PADDING; s->sequence = SEQ_BLOCK_PADDING;
/* fall through */ fallthrough;
case SEQ_BLOCK_PADDING: case SEQ_BLOCK_PADDING:
/* /*
...@@ -651,7 +651,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -651,7 +651,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_CHECK; s->sequence = SEQ_BLOCK_CHECK;
/* fall through */ fallthrough;
case SEQ_BLOCK_CHECK: case SEQ_BLOCK_CHECK:
if (s->check_type == XZ_CHECK_CRC32) { if (s->check_type == XZ_CHECK_CRC32) {
...@@ -675,7 +675,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -675,7 +675,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_INDEX_PADDING; s->sequence = SEQ_INDEX_PADDING;
/* fall through */ fallthrough;
case SEQ_INDEX_PADDING: case SEQ_INDEX_PADDING:
while ((s->index.size + (b->in_pos - s->in_start)) while ((s->index.size + (b->in_pos - s->in_start))
...@@ -699,7 +699,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -699,7 +699,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_INDEX_CRC32; s->sequence = SEQ_INDEX_CRC32;
/* fall through */ fallthrough;
case SEQ_INDEX_CRC32: case SEQ_INDEX_CRC32:
ret = crc32_validate(s, b); ret = crc32_validate(s, b);
...@@ -709,7 +709,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -709,7 +709,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->temp.size = STREAM_HEADER_SIZE; s->temp.size = STREAM_HEADER_SIZE;
s->sequence = SEQ_STREAM_FOOTER; s->sequence = SEQ_STREAM_FOOTER;
/* fall through */ fallthrough;
case SEQ_STREAM_FOOTER: case SEQ_STREAM_FOOTER:
if (!fill_temp(s, b)) if (!fill_temp(s, b))
......
...@@ -396,7 +396,7 @@ int zlib_inflate(z_streamp strm, int flush) ...@@ -396,7 +396,7 @@ int zlib_inflate(z_streamp strm, int flush)
strm->adler = state->check = REVERSE(hold); strm->adler = state->check = REVERSE(hold);
INITBITS(); INITBITS();
state->mode = DICT; state->mode = DICT;
/* fall through */ fallthrough;
case DICT: case DICT:
if (state->havedict == 0) { if (state->havedict == 0) {
RESTORE(); RESTORE();
...@@ -404,10 +404,10 @@ int zlib_inflate(z_streamp strm, int flush) ...@@ -404,10 +404,10 @@ int zlib_inflate(z_streamp strm, int flush)
} }
strm->adler = state->check = zlib_adler32(0L, NULL, 0); strm->adler = state->check = zlib_adler32(0L, NULL, 0);
state->mode = TYPE; state->mode = TYPE;
/* fall through */ fallthrough;
case TYPE: case TYPE:
if (flush == Z_BLOCK) goto inf_leave; if (flush == Z_BLOCK) goto inf_leave;
/* fall through */ fallthrough;
case TYPEDO: case TYPEDO:
INFLATE_TYPEDO_HOOK(strm, flush); INFLATE_TYPEDO_HOOK(strm, flush);
if (state->last) { if (state->last) {
...@@ -446,7 +446,7 @@ int zlib_inflate(z_streamp strm, int flush) ...@@ -446,7 +446,7 @@ int zlib_inflate(z_streamp strm, int flush)
state->length = (unsigned)hold & 0xffff; state->length = (unsigned)hold & 0xffff;
INITBITS(); INITBITS();
state->mode = COPY; state->mode = COPY;
/* fall through */ fallthrough;
case COPY: case COPY:
copy = state->length; copy = state->length;
if (copy) { if (copy) {
...@@ -480,7 +480,7 @@ int zlib_inflate(z_streamp strm, int flush) ...@@ -480,7 +480,7 @@ int zlib_inflate(z_streamp strm, int flush)
#endif #endif
state->have = 0; state->have = 0;
state->mode = LENLENS; state->mode = LENLENS;
/* fall through */ fallthrough;
case LENLENS: case LENLENS:
while (state->have < state->ncode) { while (state->have < state->ncode) {
NEEDBITS(3); NEEDBITS(3);
...@@ -501,7 +501,7 @@ int zlib_inflate(z_streamp strm, int flush) ...@@ -501,7 +501,7 @@ int zlib_inflate(z_streamp strm, int flush)
} }
state->have = 0; state->have = 0;
state->mode = CODELENS; state->mode = CODELENS;
/* fall through */ fallthrough;
case CODELENS: case CODELENS:
while (state->have < state->nlen + state->ndist) { while (state->have < state->nlen + state->ndist) {
for (;;) { for (;;) {
...@@ -575,7 +575,7 @@ int zlib_inflate(z_streamp strm, int flush) ...@@ -575,7 +575,7 @@ int zlib_inflate(z_streamp strm, int flush)
break; break;
} }
state->mode = LEN; state->mode = LEN;
/* fall through */ fallthrough;
case LEN: case LEN:
if (have >= 6 && left >= 258) { if (have >= 6 && left >= 258) {
RESTORE(); RESTORE();
...@@ -615,7 +615,7 @@ int zlib_inflate(z_streamp strm, int flush) ...@@ -615,7 +615,7 @@ int zlib_inflate(z_streamp strm, int flush)
} }
state->extra = (unsigned)(this.op) & 15; state->extra = (unsigned)(this.op) & 15;
state->mode = LENEXT; state->mode = LENEXT;
/* fall through */ fallthrough;
case LENEXT: case LENEXT:
if (state->extra) { if (state->extra) {
NEEDBITS(state->extra); NEEDBITS(state->extra);
...@@ -623,7 +623,7 @@ int zlib_inflate(z_streamp strm, int flush) ...@@ -623,7 +623,7 @@ int zlib_inflate(z_streamp strm, int flush)
DROPBITS(state->extra); DROPBITS(state->extra);
} }
state->mode = DIST; state->mode = DIST;
/* fall through */ fallthrough;
case DIST: case DIST:
for (;;) { for (;;) {
this = state->distcode[BITS(state->distbits)]; this = state->distcode[BITS(state->distbits)];
...@@ -649,7 +649,7 @@ int zlib_inflate(z_streamp strm, int flush) ...@@ -649,7 +649,7 @@ int zlib_inflate(z_streamp strm, int flush)
state->offset = (unsigned)this.val; state->offset = (unsigned)this.val;
state->extra = (unsigned)(this.op) & 15; state->extra = (unsigned)(this.op) & 15;
state->mode = DISTEXT; state->mode = DISTEXT;
/* fall through */ fallthrough;
case DISTEXT: case DISTEXT:
if (state->extra) { if (state->extra) {
NEEDBITS(state->extra); NEEDBITS(state->extra);
...@@ -669,7 +669,7 @@ int zlib_inflate(z_streamp strm, int flush) ...@@ -669,7 +669,7 @@ int zlib_inflate(z_streamp strm, int flush)
break; break;
} }
state->mode = MATCH; state->mode = MATCH;
/* fall through */ fallthrough;
case MATCH: case MATCH:
if (left == 0) goto inf_leave; if (left == 0) goto inf_leave;
copy = out - left; copy = out - left;
...@@ -720,7 +720,7 @@ int zlib_inflate(z_streamp strm, int flush) ...@@ -720,7 +720,7 @@ int zlib_inflate(z_streamp strm, int flush)
INITBITS(); INITBITS();
} }
state->mode = DONE; state->mode = DONE;
/* fall through */ fallthrough;
case DONE: case DONE:
ret = Z_STREAM_END; ret = Z_STREAM_END;
goto inf_leave; goto inf_leave;
......
...@@ -259,16 +259,17 @@ ZSTD_STATIC size_t BIT_initDStream(BIT_DStream_t *bitD, const void *srcBuffer, s ...@@ -259,16 +259,17 @@ ZSTD_STATIC size_t BIT_initDStream(BIT_DStream_t *bitD, const void *srcBuffer, s
bitD->bitContainer = *(const BYTE *)(bitD->start); bitD->bitContainer = *(const BYTE *)(bitD->start);
switch (srcSize) { switch (srcSize) {
case 7: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[6]) << (sizeof(bitD->bitContainer) * 8 - 16); case 7: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[6]) << (sizeof(bitD->bitContainer) * 8 - 16);
/* fall through */ fallthrough;
case 6: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[5]) << (sizeof(bitD->bitContainer) * 8 - 24); case 6: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[5]) << (sizeof(bitD->bitContainer) * 8 - 24);
/* fall through */ fallthrough;
case 5: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[4]) << (sizeof(bitD->bitContainer) * 8 - 32); case 5: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[4]) << (sizeof(bitD->bitContainer) * 8 - 32);
/* fall through */ fallthrough;
case 4: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[3]) << 24; case 4: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[3]) << 24;
/* fall through */ fallthrough;
case 3: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[2]) << 16; case 3: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[2]) << 16;
/* fall through */ fallthrough;
case 2: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[1]) << 8; case 2: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[1]) << 8;
fallthrough;
default:; default:;
} }
{ {
......
...@@ -3182,7 +3182,7 @@ static size_t ZSTD_compressStream_generic(ZSTD_CStream *zcs, void *dst, size_t * ...@@ -3182,7 +3182,7 @@ static size_t ZSTD_compressStream_generic(ZSTD_CStream *zcs, void *dst, size_t *
zcs->outBuffFlushedSize = 0; zcs->outBuffFlushedSize = 0;
zcs->stage = zcss_flush; /* pass-through to flush stage */ zcs->stage = zcss_flush; /* pass-through to flush stage */
} }
/* fall through */ fallthrough;
case zcss_flush: { case zcss_flush: {
size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize; size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize;
......
...@@ -442,7 +442,7 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx *dctx, const void *src, size_t srcSize ...@@ -442,7 +442,7 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx *dctx, const void *src, size_t srcSize
case set_repeat: case set_repeat:
if (dctx->litEntropy == 0) if (dctx->litEntropy == 0)
return ERROR(dictionary_corrupted); return ERROR(dictionary_corrupted);
/* fall through */ fallthrough;
case set_compressed: case set_compressed:
if (srcSize < 5) if (srcSize < 5)
return ERROR(corruption_detected); /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for case 3 */ return ERROR(corruption_detected); /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for case 3 */
...@@ -1768,7 +1768,7 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, c ...@@ -1768,7 +1768,7 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, c
return 0; return 0;
} }
dctx->expected = 0; /* not necessary to copy more */ dctx->expected = 0; /* not necessary to copy more */
/* fall through */ fallthrough;
case ZSTDds_decodeFrameHeader: case ZSTDds_decodeFrameHeader:
memcpy(dctx->headerBuffer + ZSTD_frameHeaderSize_prefix, src, dctx->expected); memcpy(dctx->headerBuffer + ZSTD_frameHeaderSize_prefix, src, dctx->expected);
...@@ -2309,7 +2309,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB ...@@ -2309,7 +2309,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB
switch (zds->stage) { switch (zds->stage) {
case zdss_init: case zdss_init:
ZSTD_resetDStream(zds); /* transparent reset on starting decoding a new frame */ ZSTD_resetDStream(zds); /* transparent reset on starting decoding a new frame */
/* fall through */ fallthrough;
case zdss_loadHeader: { case zdss_loadHeader: {
size_t const hSize = ZSTD_getFrameParams(&zds->fParams, zds->headerBuffer, zds->lhSize); size_t const hSize = ZSTD_getFrameParams(&zds->fParams, zds->headerBuffer, zds->lhSize);
...@@ -2376,7 +2376,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB ...@@ -2376,7 +2376,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB
} }
zds->stage = zdss_read; zds->stage = zdss_read;
} }
/* fall through */ fallthrough;
case zdss_read: { case zdss_read: {
size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds->dctx); size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds->dctx);
...@@ -2405,7 +2405,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB ...@@ -2405,7 +2405,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB
zds->stage = zdss_load; zds->stage = zdss_load;
/* pass-through */ /* pass-through */
} }
/* fall through */ fallthrough;
case zdss_load: { case zdss_load: {
size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds->dctx); size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds->dctx);
...@@ -2438,7 +2438,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB ...@@ -2438,7 +2438,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB
/* pass-through */ /* pass-through */
} }
} }
/* fall through */ fallthrough;
case zdss_flush: { case zdss_flush: {
size_t const toFlushSize = zds->outEnd - zds->outStart; size_t const toFlushSize = zds->outEnd - zds->outStart;
......
...@@ -556,10 +556,11 @@ size_t HUF_compress1X_usingCTable(void *dst, size_t dstSize, const void *src, si ...@@ -556,10 +556,11 @@ size_t HUF_compress1X_usingCTable(void *dst, size_t dstSize, const void *src, si
n = srcSize & ~3; /* join to mod 4 */ n = srcSize & ~3; /* join to mod 4 */
switch (srcSize & 3) { switch (srcSize & 3) {
case 3: HUF_encodeSymbol(&bitC, ip[n + 2], CTable); HUF_FLUSHBITS_2(&bitC); case 3: HUF_encodeSymbol(&bitC, ip[n + 2], CTable); HUF_FLUSHBITS_2(&bitC);
/* fall through */ fallthrough;
case 2: HUF_encodeSymbol(&bitC, ip[n + 1], CTable); HUF_FLUSHBITS_1(&bitC); case 2: HUF_encodeSymbol(&bitC, ip[n + 1], CTable); HUF_FLUSHBITS_1(&bitC);
/* fall through */ fallthrough;
case 1: HUF_encodeSymbol(&bitC, ip[n + 0], CTable); HUF_FLUSHBITS(&bitC); case 1: HUF_encodeSymbol(&bitC, ip[n + 0], CTable); HUF_FLUSHBITS(&bitC);
fallthrough;
case 0: case 0:
default:; default:;
} }
......
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