dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Sam Ravnborg <sam@ravnborg.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Timur Tabi <timur@kernel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Ludovic Desroches <ludovic.desroches@microchip.com>,
	linux-fbdev@vger.kernel.org, Jingoo Han <jingoohan1@gmail.com>,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH][next] fbdev: Use fallthrough pseudo-keyword
Date: Mon, 03 Aug 2020 12:52:40 -0700	[thread overview]
Message-ID: <101585b1d3c2a9db8fe394c51f64115e8bfc1754.camel@perches.com> (raw)
In-Reply-To: <20200803194024.GA525506@ravnborg.org>

On Mon, 2020-08-03 at 21:41 +0200, Sam Ravnborg wrote:
> On Tue, Jul 07, 2020 at 04:05:39PM -0500, Gustavo A. R. Silva wrote:
> > Replace the existing /* fall through */ comments and its variants with
> > the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
> > fall-through markings when it is the case.
> > 
> > [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
> > 
> > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> 
> Thanks.
> 
> Fixed indent in arcfb.c while applying.
> Applied to drm-misc-next and it will appear in 5.10

Perhaps better would be to fix all the switch / case
brace uses so that it looks more typical kernel style.

> > diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c
> > index 6f7838979f0a..ae3d8e8b8d33 100644
> > --- a/drivers/video/fbdev/arcfb.c
> > +++ b/drivers/video/fbdev/arcfb.c
> > @@ -419,7 +419,7 @@ static int arcfb_ioctl(struct fb_info *info,
> >  			schedule();
> >  			finish_wait(&arcfb_waitq, &wait);
> >  		}
> > -		/* fall through */
> > +			fallthrough;
> >  
> >  		case FBIO_GETCONTROL2:
> >  		{

---
 drivers/video/fbdev/arcfb.c | 52 ++++++++++++++++++++++-----------------------
 1 file changed, 25 insertions(+), 27 deletions(-)

diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c
index 6f7838979f0a..4419655e3e58 100644
--- a/drivers/video/fbdev/arcfb.c
+++ b/drivers/video/fbdev/arcfb.c
@@ -403,35 +403,33 @@ static int arcfb_ioctl(struct fb_info *info,
 	unsigned long flags;
 
 	switch (cmd) {
-		case FBIO_WAITEVENT:
-		{
-			DEFINE_WAIT(wait);
-			/* illegal to wait on arc if no irq will occur */
-			if (!par->irq)
-				return -EINVAL;
-
-			/* wait until the Arc has generated an interrupt
-			 * which will wake us up */
-			spin_lock_irqsave(&par->lock, flags);
-			prepare_to_wait(&arcfb_waitq, &wait,
-					TASK_INTERRUPTIBLE);
-			spin_unlock_irqrestore(&par->lock, flags);
-			schedule();
-			finish_wait(&arcfb_waitq, &wait);
-		}
-		/* fall through */
+	case FBIO_WAITEVENT: {
+		DEFINE_WAIT(wait);
+		/* illegal to wait on arc if no irq will occur */
+		if (!par->irq)
+			return -EINVAL;
 
-		case FBIO_GETCONTROL2:
-		{
-			unsigned char ctl2;
+		/* wait until the Arc has generated an interrupt
+		 * which will wake us up */
+		spin_lock_irqsave(&par->lock, flags);
+		prepare_to_wait(&arcfb_waitq, &wait, TASK_INTERRUPTIBLE);
+		spin_unlock_irqrestore(&par->lock, flags);
+		schedule();
+		finish_wait(&arcfb_waitq, &wait);
+		fallthrough;
+	}
 
-			ctl2 = ks108_readb_ctl2(info->par);
-			if (copy_to_user(argp, &ctl2, sizeof(ctl2)))
-				return -EFAULT;
-			return 0;
-		}
-		default:
-			return -EINVAL;
+	case FBIO_GETCONTROL2: {
+		unsigned char ctl2;
+
+		ctl2 = ks108_readb_ctl2(info->par);
+		if (copy_to_user(argp, &ctl2, sizeof(ctl2)))
+			return -EFAULT;
+		return 0;
+	}
+
+	default:
+		return -EINVAL;
 	}
 }
 


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-08-03 19:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 21:05 [PATCH][next] fbdev: Use fallthrough pseudo-keyword Gustavo A. R. Silva
2020-08-03 19:41 ` Sam Ravnborg
2020-08-03 19:52   ` Joe Perches [this message]
2020-08-03 20:12     ` Sam Ravnborg
2020-08-03 19:56   ` 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=101585b1d3c2a9db8fe394c51f64115e8bfc1754.camel@perches.com \
    --to=joe@perches.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavoars@kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=ludovic.desroches@microchip.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=sam@ravnborg.org \
    --cc=timur@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;
as well as URLs for NNTP newsgroup(s).