diff mbox

[PATCHv2] linux-generic: packet: add fall through comments to parser

Message ID 1477586679-30626-1-git-send-email-bill.fischofer@linaro.org
State Accepted
Commit e72f5324c7bd559373b2827f9f8f225beee992fb
Headers show

Commit Message

Bill Fischofer Oct. 27, 2016, 4:44 p.m. UTC
Address bug https://bugs.linaro.org/show_bug.cgi?id=2565 by adding
comments to the parser's switch statement to document the fact that
fall through is intentional.

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

---
Changes for v2:
- Address Maxim's comments on comment alignment

 platform/linux-generic/odp_packet.c | 7 +++++++
 1 file changed, 7 insertions(+)

-- 
2.7.4
diff mbox

Patch

diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c
index 714794a..c2b26fd 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -1182,6 +1182,8 @@  int packet_parse_common(packet_parser_t *prs, const uint8_t *ptr,
 
 	switch (prs->parsed_layers) {
 	case LAYER_NONE:
+	/* Fall through */
+
 	case LAYER_L2:
 	{
 		const _odp_ethhdr_t *eth;
@@ -1254,6 +1256,8 @@  int packet_parse_common(packet_parser_t *prs, const uint8_t *ptr,
 		if (layer == LAYER_L2)
 			return prs->error_flags.all != 0;
 	}
+	/* Fall through */
+
 	case LAYER_L3:
 	{
 		offset = prs->l3_offset;
@@ -1292,6 +1296,8 @@  int packet_parse_common(packet_parser_t *prs, const uint8_t *ptr,
 		if (layer == LAYER_L3)
 			return prs->error_flags.all != 0;
 	}
+	/* Fall through */
+
 	case LAYER_L4:
 	{
 		offset = prs->l4_offset;
@@ -1341,6 +1347,7 @@  int packet_parse_common(packet_parser_t *prs, const uint8_t *ptr,
 		prs->parsed_layers = LAYER_L4;
 		break;
 	}
+
 	case LAYER_ALL:
 		break;