From: Osama Abdelkader <osama.abdelkader@gmail.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>, mark.rutlang@arm.com
Cc: smostafa@google.com, catalin.marinas@arm.com,
linux-kernel@vger.kernel.org, will@kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: Remove unreachable break after die
Date: Fri, 28 Nov 2025 18:10:52 +0200 [thread overview]
Message-ID: <aSnJjNk272pCDubc@osama> (raw)
In-Reply-To: <9900ca30-4d57-4a38-b319-b76d57038e52@arm.com>
On Fri, Nov 28, 2025 at 08:01:22AM +0530, Anshuman Khandual wrote:
>
>
> On 27/11/25 2:50 PM, Mark Rutland wrote:
> > On Thu, Nov 27, 2025 at 12:26:20AM +0200, Osama Abdelkader wrote:
> >> die() never returns, the break is unreachable in arch/arm64/kernel/traps.c
> >
> > Is the break causing some problem, e.g. a compiler warning?
> >
> > If not, then I don't see a reason to remove the break.
> >
> > There are many other instances of "die(...); break" throughout the
> > kernel, and this doesn't seem to be speecial.
>
> Agree with Mark. From switch case semantics perspective a break is expected
> here regardless what happens to control flow.
>
> >
> > Mark.
> >
> >> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
> >> ---
> >> arch/arm64/kernel/traps.c | 1 -
> >> 1 file changed, 1 deletion(-)
> >>
> >> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
> >> index 681939ef5d16..81dd2d7759eb 100644
> >> --- a/arch/arm64/kernel/traps.c
> >> +++ b/arch/arm64/kernel/traps.c
> >> @@ -1003,7 +1003,6 @@ int bug_brk_handler(struct pt_regs *regs, unsigned long esr)
> >> switch (report_bug(regs->pc, regs)) {
> >> case BUG_TRAP_TYPE_BUG:
> >> die("Oops - BUG", regs, esr);
> >> - break;
> >>
> >> case BUG_TRAP_TYPE_WARN:
> >> break;
> >> --
> >> 2.43.0
> >>
> >
>
I see, I agree too.
Thanks.
Osama
next prev parent reply other threads:[~2025-11-28 16:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-26 22:26 [PATCH] arm64: Remove unreachable break after die Osama Abdelkader
2025-11-27 9:20 ` Mark Rutland
2025-11-27 9:20 ` Mark Rutland
2025-11-28 2:31 ` Anshuman Khandual
2025-11-28 16:10 ` Osama Abdelkader [this message]
2025-11-28 2:41 ` kernel test robot
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=aSnJjNk272pCDubc@osama \
--to=osama.abdelkader@gmail.com \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutlang@arm.com \
--cc=smostafa@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.