* [PATCH 1/2] drm: sun4i: sun6i_mipi_dsi: Mark expected switch fall-through
@ 2019-07-26 11:28 Anders Roxell
0 siblings, 0 replies; only message in thread
From: Anders Roxell @ 2019-07-26 11:28 UTC (permalink / raw)
To: airlied, daniel, wens
Cc: Anders Roxell, linux-arm-kernel, dri-devel, linux-kernel
When fall-through warnings was enabled by default the following warning
was starting to show up:
../drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c: In function
‘sun6i_dsi_transfer’:../drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:992:6: warning:
this statement may fall through [-Wimplicit-fallthrough=]
if (msg->rx_len == 1) {
^
../drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:997:2: note: here
default:
^~~~~~~
Rework so that the compiler doesn't warn about fall-through. Change
the if-statement so that we can move out 'break;' one level.
Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
index 472f73985deb..40ed21e527f9 100644
--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
+++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
@@ -992,8 +992,10 @@ static ssize_t sun6i_dsi_transfer(struct mipi_dsi_host *host,
case MIPI_DSI_DCS_READ:
if (msg->rx_len == 1) {
ret = sun6i_dsi_dcs_read(dsi, msg);
- break;
+ } else {
+ ret = -EINVAL;
}
+ break;
default:
ret = -EINVAL;
--
2.20.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-07-26 11:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-26 11:28 [PATCH 1/2] drm: sun4i: sun6i_mipi_dsi: Mark expected switch fall-through Anders Roxell
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).