linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARC: unwind: Mark expected switch fall-throughs
@ 2019-08-05 19:32 Gustavo A. R. Silva
  2019-08-05 20:18 ` Kees Cook
  2019-08-06  5:49 ` Vineet Gupta
  0 siblings, 2 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-08-05 19:32 UTC (permalink / raw)
  To: Vineet Gupta; +Cc: linux-snps-arc, linux-kernel, Gustavo A. R. Silva, Kees Cook

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@embeddedor.com>
---
 arch/arc/kernel/unwind.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c
index c2663fce7f6c..445e4d702f43 100644
--- a/arch/arc/kernel/unwind.c
+++ b/arch/arc/kernel/unwind.c
@@ -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;
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARC: unwind: Mark expected switch fall-throughs
  2019-08-05 19:32 [PATCH] ARC: unwind: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2019-08-05 20:18 ` Kees Cook
  2019-08-06  5:49 ` Vineet Gupta
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2019-08-05 20:18 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: Vineet Gupta, linux-snps-arc, linux-kernel

On Mon, Aug 05, 2019 at 02:32:32PM -0500, Gustavo A. R. Silva wrote:
> 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@embeddedor.com>

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  arch/arc/kernel/unwind.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c
> index c2663fce7f6c..445e4d702f43 100644
> --- a/arch/arc/kernel/unwind.c
> +++ b/arch/arc/kernel/unwind.c
> @@ -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;
> -- 
> 2.22.0
> 

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARC: unwind: Mark expected switch fall-throughs
  2019-08-05 19:32 [PATCH] ARC: unwind: Mark expected switch fall-throughs Gustavo A. R. Silva
  2019-08-05 20:18 ` Kees Cook
@ 2019-08-06  5:49 ` Vineet Gupta
  1 sibling, 0 replies; 3+ messages in thread
From: Vineet Gupta @ 2019-08-06  5:49 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: linux-snps-arc, linux-kernel, Kees Cook

On 8/6/19 1:02 AM, Gustavo A. R. Silva wrote:
> 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@embeddedor.com>

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

-Vineet

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-06  5:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-05 19:32 [PATCH] ARC: unwind: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-08-05 20:18 ` Kees Cook
2019-08-06  5:49 ` Vineet Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).