From b2079f10af7402568e683756f9ec741e877bced3 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Sat, 7 Oct 2017 21:06:51 +0000 Subject: [PATCH] stm32:can: help gcc recognise deliberate fall through Very new gcc versions add a warning on switch cases that fall through. While there's an option that accepts any comment as explaining it, it's easier in our case to just use one of the "blessed" comments. We can't use the [[]] attributes for standards code, and the gcc specific attributes are worse than the comments. This has no functional change whatsoever. --- lib/stm32/can.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/stm32/can.c b/lib/stm32/can.c index 44a6cd65..4585a577 100644 --- a/lib/stm32/can.c +++ b/lib/stm32/can.c @@ -406,28 +406,28 @@ int can_transmit(uint32_t canport, uint32_t id, bool ext, bool rtr, switch (length) { case 8: tdhxr.data8[3] = data[7]; - /* no break */ + /* fall through */ case 7: tdhxr.data8[2] = data[6]; - /* no break */ + /* fall through */ case 6: tdhxr.data8[1] = data[5]; - /* no break */ + /* fall through */ case 5: tdhxr.data8[0] = data[4]; - /* no break */ + /* fall through */ case 4: tdlxr.data8[3] = data[3]; - /* no break */ + /* fall through */ case 3: tdlxr.data8[2] = data[2]; - /* no break */ + /* fall through */ case 2: tdlxr.data8[1] = data[1]; - /* no break */ + /* fall through */ case 1: tdlxr.data8[0] = data[0]; - /* no break */ + /* fall through */ default: break; }