Skip to contentSkip to conversation

ASN.1: annotate implicit fall throughs

PATCH New Mathieu Malaterre 1 participant 1 message Jan 14, 2019 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASN.1: annotate implicit fall throughs

There is a plan to build the kernel with -Wimplicit-fallthrough and these places in the code produced warnings (W=1). Fix them up.

This commit remove the following warnings:

lib/asn1_decoder.c:386:6: warning: this statement may fall through [-Wimplicit-fallthrough=] lib/asn1_decoder.c:449:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

---
 lib/asn1_decoder.c | 2 ++
 1 file changed, 2 insertions(+)
lib/asn1_decoder.c +2 -0
index dc14beae2c9a..fbd46bec313c 100644
@@ -385,6 +385,7 @@ int asn1_ber_decoder(const struct asn1_decoder *decoder,
 	case ASN1_OP_END_SET_ACT:
 		if (unlikely(!(flags & FLAG_MATCHED)))
 			goto tag_mismatch;
+		/* fall through */
 	case ASN1_OP_END_SEQ:
 	case ASN1_OP_END_SET_OF:
 	case ASN1_OP_END_SEQ_OF:
@@ -450,6 +451,7 @@ int asn1_ber_decoder(const struct asn1_decoder *decoder,
 			pc += asn1_op_lengths[op];
 			goto next_op;
 		}
+		/* fall through */
 	case ASN1_OP_ACT:
 		ret = actions[machine[pc + 1]](context, hdr, tag, data + tdp, len);
 		if (ret < 0)
Signature · 1 line
2.19.2