Skip to content

Commit 15b2455

Browse files
GustavoARSilvaherbertx
authored andcommitted
crypto: ux500/crypt - Mark expected switch fall-throughs
Mark switch cases where we are expecting to fall through. This patch fixes the following warning (Building: arm): drivers/crypto/ux500/cryp/cryp.c: In function ‘cryp_save_device_context’: drivers/crypto/ux500/cryp/cryp.c:316:16: warning: this statement may fall through [-Wimplicit-fallthrough=] ctx->key_4_r = readl_relaxed(&src_reg->key_4_r); drivers/crypto/ux500/cryp/cryp.c:318:2: note: here case CRYP_KEY_SIZE_192: ^~~~ drivers/crypto/ux500/cryp/cryp.c:320:16: warning: this statement may fall through [-Wimplicit-fallthrough=] ctx->key_3_r = readl_relaxed(&src_reg->key_3_r); drivers/crypto/ux500/cryp/cryp.c:322:2: note: here case CRYP_KEY_SIZE_128: ^~~~ drivers/crypto/ux500/cryp/cryp.c:324:16: warning: this statement may fall through [-Wimplicit-fallthrough=] ctx->key_2_r = readl_relaxed(&src_reg->key_2_r); drivers/crypto/ux500/cryp/cryp.c:326:2: note: here default: ^~~~~~~ In file included from ./include/linux/io.h:13:0, from drivers/crypto/ux500/cryp/cryp_p.h:14, from drivers/crypto/ux500/cryp/cryp.c:15: drivers/crypto/ux500/cryp/cryp.c: In function ‘cryp_restore_device_context’: ./arch/arm/include/asm/io.h:92:22: warning: this statement may fall through [-Wimplicit-fallthrough=] #define __raw_writel __raw_writel ^ ./arch/arm/include/asm/io.h:299:29: note: in expansion of macro ‘__raw_writel’ #define writel_relaxed(v,c) __raw_writel((__force u32) cpu_to_le32(v),c) ^~~~~~~~~~~~ drivers/crypto/ux500/cryp/cryp.c:363:3: note: in expansion of macro ‘writel_relaxed’ writel_relaxed(ctx->key_4_r, &reg->key_4_r); ^~~~~~~~~~~~~~ drivers/crypto/ux500/cryp/cryp.c:365:2: note: here case CRYP_KEY_SIZE_192: ^~~~ In file included from ./include/linux/io.h:13:0, from drivers/crypto/ux500/cryp/cryp_p.h:14, from drivers/crypto/ux500/cryp/cryp.c:15: ./arch/arm/include/asm/io.h:92:22: warning: this statement may fall through [-Wimplicit-fallthrough=] #define __raw_writel __raw_writel ^ ./arch/arm/include/asm/io.h:299:29: note: in expansion of macro ‘__raw_writel’ #define writel_relaxed(v,c) __raw_writel((__force u32) cpu_to_le32(v),c) ^~~~~~~~~~~~ drivers/crypto/ux500/cryp/cryp.c:367:3: note: in expansion of macro ‘writel_relaxed’ writel_relaxed(ctx->key_3_r, &reg->key_3_r); ^~~~~~~~~~~~~~ drivers/crypto/ux500/cryp/cryp.c:369:2: note: here case CRYP_KEY_SIZE_128: ^~~~ In file included from ./include/linux/io.h:13:0, from drivers/crypto/ux500/cryp/cryp_p.h:14, from drivers/crypto/ux500/cryp/cryp.c:15: ./arch/arm/include/asm/io.h:92:22: warning: this statement may fall through [-Wimplicit-fallthrough=] #define __raw_writel __raw_writel ^ ./arch/arm/include/asm/io.h:299:29: note: in expansion of macro ‘__raw_writel’ #define writel_relaxed(v,c) __raw_writel((__force u32) cpu_to_le32(v),c) ^~~~~~~~~~~~ drivers/crypto/ux500/cryp/cryp.c:371:3: note: in expansion of macro ‘writel_relaxed’ writel_relaxed(ctx->key_2_r, &reg->key_2_r); ^~~~~~~~~~~~~~ drivers/crypto/ux500/cryp/cryp.c:373:2: note: here default: ^~~~~~~ Signed-off-by: Gustavo A. R. Silva <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent f6ebfd7 commit 15b2455

File tree

1 file changed

+6
-0
lines changed
  • drivers/crypto/ux500/cryp

1 file changed

+6
-0
lines changed

drivers/crypto/ux500/cryp/cryp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,17 @@ void cryp_save_device_context(struct cryp_device_data *device_data,
314314
case CRYP_KEY_SIZE_256:
315315
ctx->key_4_l = readl_relaxed(&src_reg->key_4_l);
316316
ctx->key_4_r = readl_relaxed(&src_reg->key_4_r);
317+
/* Fall through */
317318

318319
case CRYP_KEY_SIZE_192:
319320
ctx->key_3_l = readl_relaxed(&src_reg->key_3_l);
320321
ctx->key_3_r = readl_relaxed(&src_reg->key_3_r);
322+
/* Fall through */
321323

322324
case CRYP_KEY_SIZE_128:
323325
ctx->key_2_l = readl_relaxed(&src_reg->key_2_l);
324326
ctx->key_2_r = readl_relaxed(&src_reg->key_2_r);
327+
/* Fall through */
325328

326329
default:
327330
ctx->key_1_l = readl_relaxed(&src_reg->key_1_l);
@@ -361,14 +364,17 @@ void cryp_restore_device_context(struct cryp_device_data *device_data,
361364
case CRYP_KEY_SIZE_256:
362365
writel_relaxed(ctx->key_4_l, &reg->key_4_l);
363366
writel_relaxed(ctx->key_4_r, &reg->key_4_r);
367+
/* Fall through */
364368

365369
case CRYP_KEY_SIZE_192:
366370
writel_relaxed(ctx->key_3_l, &reg->key_3_l);
367371
writel_relaxed(ctx->key_3_r, &reg->key_3_r);
372+
/* Fall through */
368373

369374
case CRYP_KEY_SIZE_128:
370375
writel_relaxed(ctx->key_2_l, &reg->key_2_l);
371376
writel_relaxed(ctx->key_2_r, &reg->key_2_r);
377+
/* Fall through */
372378

373379
default:
374380
writel_relaxed(ctx->key_1_l, &reg->key_1_l);

0 commit comments

Comments
 (0)