diff mbox series

[1/3] drm: drm_vm: Use fallthrough;

Message ID 398db73cdc8a584fd7f34f5013c04df13ba90f64.1584040050.git.joe@perches.com (mailing list archive)
State New, archived
Headers show
Series treewide: Convert unscriptable /* fallthrough */ comments to fallthrough; | expand

Commit Message

Joe Perches March 12, 2020, 7:17 p.m. UTC
Convert /* fallthrough */ style comments to fallthrough;

Convert the various uses of fallthrough comments to fallthrough;

Done via script
Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe@perches.com/

And by hand:

This file has a fallthrough comment outside of an #ifdef block
that causes gcc to emit a warning if converted in-place.

So move the new fallthrough; inside the containing #ifdef/#endif too.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/gpu/drm/drm_vm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Daniel Vetter March 17, 2020, 4:48 p.m. UTC | #1
On Thu, Mar 12, 2020 at 12:17:12PM -0700, Joe Perches wrote:
> Convert /* fallthrough */ style comments to fallthrough;
> 
> Convert the various uses of fallthrough comments to fallthrough;
> 
> Done via script
> Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe@perches.com/
> 
> And by hand:
> 
> This file has a fallthrough comment outside of an #ifdef block
> that causes gcc to emit a warning if converted in-place.
> 
> So move the new fallthrough; inside the containing #ifdef/#endif too.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

I'm assuming this all lands through a special pull? Or should I apply
this?
-Daniel

> ---
>  drivers/gpu/drm/drm_vm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
> index 64619f..fd65c59 100644
> --- a/drivers/gpu/drm/drm_vm.c
> +++ b/drivers/gpu/drm/drm_vm.c
> @@ -595,8 +595,8 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
>  			vma->vm_ops = &drm_vm_ops;
>  			break;
>  		}
> +		fallthrough;	/* to _DRM_FRAME_BUFFER... */
>  #endif
> -		/* fall through - to _DRM_FRAME_BUFFER... */
>  	case _DRM_FRAME_BUFFER:
>  	case _DRM_REGISTERS:
>  		offset = drm_core_get_reg_ofs(dev);
> @@ -621,7 +621,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
>  		    vma->vm_end - vma->vm_start, vma->vm_page_prot))
>  			return -EAGAIN;
>  		vma->vm_page_prot = drm_dma_prot(map->type, vma);
> -		/* fall through - to _DRM_SHM */
> +		fallthrough;	/* to _DRM_SHM */
>  	case _DRM_SHM:
>  		vma->vm_ops = &drm_vm_shm_ops;
>  		vma->vm_private_data = (void *)map;
> -- 
> 2.24.0
>
Joe Perches March 17, 2020, 10:13 p.m. UTC | #2
On Tue, 2020-03-17 at 17:48 +0100, Daniel Vetter wrote:
> On Thu, Mar 12, 2020 at 12:17:12PM -0700, Joe Perches wrote:
> > Convert /* fallthrough */ style comments to fallthrough;
> > 
> > Convert the various uses of fallthrough comments to fallthrough;
> > 
> > Done via script
> > Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe@perches.com/
> > 
> > And by hand:
> > 
> > This file has a fallthrough comment outside of an #ifdef block
> > that causes gcc to emit a warning if converted in-place.
> > 
> > So move the new fallthrough; inside the containing #ifdef/#endif too.
> > 
> > Signed-off-by: Joe Perches <joe@perches.com>
> 
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> I'm assuming this all lands through a special pull? Or should I apply
> this?

Hi Daniel.

I think you should apply this.

The idea here is to allow a scripted conversion at some
point and this patch is necessary to avoid new compiler
warnings after running the script.
Daniel Vetter March 18, 2020, 1:49 p.m. UTC | #3
On Tue, Mar 17, 2020 at 03:13:29PM -0700, Joe Perches wrote:
> On Tue, 2020-03-17 at 17:48 +0100, Daniel Vetter wrote:
> > On Thu, Mar 12, 2020 at 12:17:12PM -0700, Joe Perches wrote:
> > > Convert /* fallthrough */ style comments to fallthrough;
> > > 
> > > Convert the various uses of fallthrough comments to fallthrough;
> > > 
> > > Done via script
> > > Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe@perches.com/
> > > 
> > > And by hand:
> > > 
> > > This file has a fallthrough comment outside of an #ifdef block
> > > that causes gcc to emit a warning if converted in-place.
> > > 
> > > So move the new fallthrough; inside the containing #ifdef/#endif too.
> > > 
> > > Signed-off-by: Joe Perches <joe@perches.com>
> > 
> > Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > 
> > I'm assuming this all lands through a special pull? Or should I apply
> > this?
> 
> Hi Daniel.
> 
> I think you should apply this.
> 
> The idea here is to allow a scripted conversion at some
> point and this patch is necessary to avoid new compiler
> warnings after running the script.

Ok, put into the queue but missed the 5.7 feature freeze for drm so 5.8
probably.

Thanks, Daniel
Joe Perches March 18, 2020, 4:43 p.m. UTC | #4
On Wed, 2020-03-18 at 14:49 +0100, Daniel Vetter wrote:
> On Tue, Mar 17, 2020 at 03:13:29PM -0700, Joe Perches wrote:
> > On Tue, 2020-03-17 at 17:48 +0100, Daniel Vetter wrote:
> > > On Thu, Mar 12, 2020 at 12:17:12PM -0700, Joe Perches wrote:
> > > > Convert /* fallthrough */ style comments to fallthrough;
> > > > 
> > > > Convert the various uses of fallthrough comments to fallthrough;
> > > > 
> > > > Done via script
> > > > Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe@perches.com/
> > > > 
> > > > And by hand:
> > > > 
> > > > This file has a fallthrough comment outside of an #ifdef block
> > > > that causes gcc to emit a warning if converted in-place.
> > > > 
> > > > So move the new fallthrough; inside the containing #ifdef/#endif too.
[]
> > > I'm assuming this all lands through a special pull? Or should I apply
> > > this?
[]
> > I think you should apply this.
> > 
> > The idea here is to allow a scripted conversion at some
> > point and this patch is necessary to avoid new compiler
> > warnings after running the script.
> 
> Ok, put into the queue but missed the 5.7 feature freeze for drm so 5.8
> probably.

Thanks, no worries.
Any scripted conversion like this isn't a high priority.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index 64619f..fd65c59 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -595,8 +595,8 @@  static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
 			vma->vm_ops = &drm_vm_ops;
 			break;
 		}
+		fallthrough;	/* to _DRM_FRAME_BUFFER... */
 #endif
-		/* fall through - to _DRM_FRAME_BUFFER... */
 	case _DRM_FRAME_BUFFER:
 	case _DRM_REGISTERS:
 		offset = drm_core_get_reg_ofs(dev);
@@ -621,7 +621,7 @@  static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
 		    vma->vm_end - vma->vm_start, vma->vm_page_prot))
 			return -EAGAIN;
 		vma->vm_page_prot = drm_dma_prot(map->type, vma);
-		/* fall through - to _DRM_SHM */
+		fallthrough;	/* to _DRM_SHM */
 	case _DRM_SHM:
 		vma->vm_ops = &drm_vm_shm_ops;
 		vma->vm_private_data = (void *)map;