Skip to contentSkip to conversation

ARC: unwind: Mark expected switch fall-throughs

PATCH In review Gustavo A. R. Silva 3 participants 3 messages Aug 5, 2019 – Aug 6, 2019 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARC: unwind: Mark expected switch fall-throughs

Mark switch cases where we are expecting to fall through.

This patch fixes the following warnings (Building: haps_hs_defconfig arc):

arch/arc/kernel/unwind.c:827:20: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/arc/kernel/unwind.c:836:20: warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by Gustavo A. R. Silva <gustavo at embeddedor.com>
---
 arch/arc/kernel/unwind.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arc/kernel/unwind.c +2 -2
index c2663fce7f6c..445e4d702f43 100644
@@ -826,7 +826,7 @@ static int processCFI(const u8 *start, const u8 *end, unsigned long targetLoc,
 			case DW_CFA_def_cfa:
 				state->cfa.reg = get_uleb128(&ptr.p8, end);
 				unw_debug("cfa_def_cfa: r%lu ", state->cfa.reg);
-				/*nobreak*/
+				/* fall through */
 			case DW_CFA_def_cfa_offset:
 				state->cfa.offs = get_uleb128(&ptr.p8, end);
 				unw_debug("cfa_def_cfa_offset: 0x%lx ",
@@ -834,7 +834,7 @@ static int processCFI(const u8 *start, const u8 *end, unsigned long targetLoc,
 				break;
 			case DW_CFA_def_cfa_sf:
 				state->cfa.reg = get_uleb128(&ptr.p8, end);
-				/*nobreak */
+				/* fall through */
 			case DW_CFA_def_cfa_offset_sf:
 				state->cfa.offs = get_sleb128(&ptr.p8, end)
 				    * state->dataAlign;
Signature · 1 line
2.22.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warnings (Building: haps_hs_defconfig arc):

arch/arc/kernel/unwind.c:827:20: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/arc/kernel/unwind.c:836:20: warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by Gustavo A. R. Silva <gustavo at embeddedor.com>
Reviewed-by Kees Cook <keescook at chromium.org>

-Kees

Quoted 29 lines
---
 arch/arc/kernel/unwind.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arc/kernel/unwind.c +2 -2
index c2663fce7f6c..445e4d702f43 100644
@@ -826,7 +826,7 @@ static int processCFI(const u8 *start, const u8 *end, unsigned long targetLoc,
 			case DW_CFA_def_cfa:
 				state->cfa.reg = get_uleb128(&ptr.p8, end);
 				unw_debug("cfa_def_cfa: r%lu ", state->cfa.reg);
-				/*nobreak*/
+				/* fall through */
 			case DW_CFA_def_cfa_offset:
 				state->cfa.offs = get_uleb128(&ptr.p8, end);
 				unw_debug("cfa_def_cfa_offset: 0x%lx ",
@@ -834,7 +834,7 @@ static int processCFI(const u8 *start, const u8 *end, unsigned long targetLoc,
 				break;
 			case DW_CFA_def_cfa_sf:
 				state->cfa.reg = get_uleb128(&ptr.p8, end);
-				/*nobreak */
+				/* fall through */
 			case DW_CFA_def_cfa_offset_sf:
 				state->cfa.offs = get_sleb128(&ptr.p8, end)
 				    * state->dataAlign;
Signature · 1 line
2.22.0
Signature · 1 line
Kees Cook
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 8 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warnings (Building: haps_hs_defconfig arc):

arch/arc/kernel/unwind.c:827:20: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/arc/kernel/unwind.c:836:20: warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by Gustavo A. R. Silva <gustavo at embeddedor.com>

Thx for the patch, applied to arc for-curr.

-Vineet