Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: module: Mark expected switch fall-through

When fall-through warnings was enabled by default the following warnings
was starting to show up:

../arch/arm64/kernel/module.c: In function ‘apply_relocate_add’:
../arch/arm64/kernel/module.c:316:19: warning: this statement may fall
through [-Wimplicit-fallthrough=]
overflow_check = false;
~~~~~~~~~~~~~~~^~~~~~~
../arch/arm64/kernel/module.c:317:3: note: here
case R_AARCH64_MOVW_UABS_G0:
^~~~
../arch/arm64/kernel/module.c:322:19: warning: this statement may fall
through [-Wimplicit-fallthrough=]
overflow_check = false;
~~~~~~~~~~~~~~~^~~~~~~
../arch/arm64/kernel/module.c:323:3: note: here
case R_AARCH64_MOVW_UABS_G1:
^~~~

Rework so that the compiler doesn't warn about fall-through.

Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Anders Roxell and committed by
Will Deacon
eca92a53 66554739

+4
+4
arch/arm64/kernel/module.c
··· 314 314 /* MOVW instruction relocations. */ 315 315 case R_AARCH64_MOVW_UABS_G0_NC: 316 316 overflow_check = false; 317 + /* Fall through */ 317 318 case R_AARCH64_MOVW_UABS_G0: 318 319 ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 0, 319 320 AARCH64_INSN_IMM_MOVKZ); 320 321 break; 321 322 case R_AARCH64_MOVW_UABS_G1_NC: 322 323 overflow_check = false; 324 + /* Fall through */ 323 325 case R_AARCH64_MOVW_UABS_G1: 324 326 ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 16, 325 327 AARCH64_INSN_IMM_MOVKZ); 326 328 break; 327 329 case R_AARCH64_MOVW_UABS_G2_NC: 328 330 overflow_check = false; 331 + /* Fall through */ 329 332 case R_AARCH64_MOVW_UABS_G2: 330 333 ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 32, 331 334 AARCH64_INSN_IMM_MOVKZ); ··· 396 393 break; 397 394 case R_AARCH64_ADR_PREL_PG_HI21_NC: 398 395 overflow_check = false; 396 + /* Fall through */ 399 397 case R_AARCH64_ADR_PREL_PG_HI21: 400 398 ovf = reloc_insn_adrp(me, sechdrs, loc, val); 401 399 if (ovf && ovf != -ERANGE)