From: Nathan Chancellor <nathan@kernel.org>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
Frank Li <Frank.Li@nxp.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Stanley Chu <yschu@nuvoton.com>,
linux-i3c@lists.infradead.org, imx@lists.linux.dev,
llvm@lists.linux.dev, patches@lists.linux.dev,
Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH] i3c: master: svc: Fix implicit fallthrough in svc_i3c_master_ibi_work()
Date: Wed, 19 Mar 2025 09:08:01 -0700 [thread overview]
Message-ID: <20250319-i3c-fix-clang-fallthrough-v1-1-d8e02be1ef5c@kernel.org> (raw)
Clang warns (or errors with CONFIG_WERROR=y):
drivers/i3c/master/svc-i3c-master.c:596:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
596 | default:
| ^
drivers/i3c/master/svc-i3c-master.c:596:2: note: insert 'break;' to avoid fall-through
596 | default:
| ^
| break;
1 error generated.
Clang is a little more pedantic than GCC, which does not warn when
falling through to a case that is just break or return. Clang's version
is more in line with the kernel's own stance in deprecated.rst, which
states that all switch/case blocks must end in either break,
fallthrough, continue, goto, or return. Add the missing break to silence
the warning.
Fixes: 0430bf9bc1ac ("i3c: master: svc: Fix missing STOP for master request")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
drivers/i3c/master/svc-i3c-master.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
index e0cd3ce28b7f..85e16de208d3 100644
--- a/drivers/i3c/master/svc-i3c-master.c
+++ b/drivers/i3c/master/svc-i3c-master.c
@@ -593,6 +593,7 @@ static void svc_i3c_master_ibi_work(struct work_struct *work)
break;
case SVC_I3C_MSTATUS_IBITYPE_MASTER_REQUEST:
svc_i3c_master_emit_stop(master);
+ break;
default:
break;
}
---
base-commit: 0430bf9bc1ac068c8b8c540eb93e5751872efc51
change-id: 20250319-i3c-fix-clang-fallthrough-9f5c7cf5e799
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
next reply other threads:[~2025-03-20 21:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 16:08 Nathan Chancellor [this message]
2025-03-20 22:03 ` [PATCH] i3c: master: svc: Fix implicit fallthrough in svc_i3c_master_ibi_work() Alexandre Belloni
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=20250319-i3c-fix-clang-fallthrough-v1-1-d8e02be1ef5c@kernel.org \
--to=nathan@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=imx@lists.linux.dev \
--cc=linux-i3c@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=miquel.raynal@bootlin.com \
--cc=patches@lists.linux.dev \
--cc=yschu@nuvoton.com \
/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;
as well as URLs for NNTP newsgroup(s).