mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anders Roxell <anders.roxell@linaro.org>
To: airlied@linux.ie, daniel@ffwll.ch, wens@csie.org
Cc: dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Anders Roxell <anders.roxell@linaro.org>
Subject: [PATCH 1/2] drm: sun4i: sun6i_mipi_dsi: Mark expected switch fall-through
Date: Fri, 26 Jul 2019 13:28:02 +0200	[thread overview]
Message-ID: <20190726112802.19563-1-anders.roxell@linaro.org> (raw)

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


                 reply	other threads:[~2019-07-26 11:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190726112802.19563-1-anders.roxell@linaro.org \
    --to=anders.roxell@linaro.org \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wens@csie.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®