mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Matteo Croce <mcroce@redhat.com>, linux-arm-kernel@lists.infradead.org
Cc: Mark Rutland <mark.rutland@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: hw_breakpoint: mark expected switch fall-through
Date: Sun, 28 Jul 2019 18:34:02 -0500	[thread overview]
Message-ID: <763dd408-7ac0-436c-d952-1decff5c696e@embeddedor.com> (raw)
In-Reply-To: <20190728232706.7396-1-mcroce@redhat.com>

Hi Matteo,

I sent a patch for this some minutes ago:

https://lore.kernel.org/patchwork/patch/1106585/

It seems there are more warnings in that file than the ones you are
addressing.

Thanks
--
Gustavo

On 7/28/19 6:27 PM, Matteo Croce wrote:
> Mark switch cases where we are expecting to fall through,
> fixes the following warning:
> 
>   CC      arch/arm64/kernel/hw_breakpoint.o
> arch/arm64/kernel/hw_breakpoint.c: In function ‘hw_breakpoint_arch_parse’:
> arch/arm64/kernel/hw_breakpoint.c:540:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>     if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1)
>        ^
> arch/arm64/kernel/hw_breakpoint.c:542:3: note: here
>    case 2:
>    ^~~~
> arch/arm64/kernel/hw_breakpoint.c:544:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>     if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2)
>        ^
> arch/arm64/kernel/hw_breakpoint.c:546:3: note: here
>    default:
>    ^~~~~~~
> 
> Signed-off-by: Matteo Croce <mcroce@redhat.com>
> ---
>  arch/arm64/kernel/hw_breakpoint.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c
> index dceb84520948..7d846985b133 100644
> --- a/arch/arm64/kernel/hw_breakpoint.c
> +++ b/arch/arm64/kernel/hw_breakpoint.c
> @@ -539,10 +539,12 @@ int hw_breakpoint_arch_parse(struct perf_event *bp,
>  			/* Allow single byte watchpoint. */
>  			if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1)
>  				break;
> +			/* fallthrough */
>  		case 2:
>  			/* Allow halfword watchpoints and breakpoints. */
>  			if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2)
>  				break;
> +			/* fallthrough */
>  		default:
>  			return -EINVAL;
>  		}
> 

  reply	other threads:[~2019-07-28 23:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-28 23:27 Matteo Croce
2019-07-28 23:34 ` Gustavo A. R. Silva [this message]
2019-07-28 23:36   ` Matteo Croce
2019-07-28 23:45     ` Gustavo A. R. Silva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=763dd408-7ac0-436c-d952-1decff5c696e@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mcroce@redhat.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®