linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/drm_vm: Mark expected switch fall-throughs
@ 2019-02-15 17:05 Gustavo A. R. Silva
  2019-02-18  8:57 ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-15 17:05 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Sean Paul, David Airlie, Daniel Vetter
  Cc: dri-devel, linux-kernel, Gustavo A. R. Silva, Kees Cook

In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

Warning level 3 was used: -Wimplicit-fallthrough=3

Notice that, in this particular case, the code comment is modified
in accordance with what GCC is expecting to find.

This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 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 c3301046dfaa..8987501f53b2 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -584,8 +584,8 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
 			vma->vm_ops = &drm_vm_ops;
 			break;
 		}
-		/* fall through 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);
@@ -610,7 +610,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 */
+		/* fall through - to _DRM_SHM */
 	case _DRM_SHM:
 		vma->vm_ops = &drm_vm_shm_ops;
 		vma->vm_private_data = (void *)map;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/drm_vm: Mark expected switch fall-throughs
  2019-02-15 17:05 [PATCH] drm/drm_vm: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2019-02-18  8:57 ` Daniel Vetter
  2019-02-18 18:02   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2019-02-18  8:57 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Maarten Lankhorst, Maxime Ripard, Sean Paul, David Airlie,
	Daniel Vetter, dri-devel, linux-kernel, Kees Cook

On Fri, Feb 15, 2019 at 11:05:46AM -0600, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
> 
> Warning level 3 was used: -Wimplicit-fallthrough=3
> 
> Notice that, in this particular case, the code comment is modified
> in accordance with what GCC is expecting to find.
> 
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Queued for 5.2, thanks for your patch.
-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 c3301046dfaa..8987501f53b2 100644
> --- a/drivers/gpu/drm/drm_vm.c
> +++ b/drivers/gpu/drm/drm_vm.c
> @@ -584,8 +584,8 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
>  			vma->vm_ops = &drm_vm_ops;
>  			break;
>  		}
> -		/* fall through 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);
> @@ -610,7 +610,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 */
> +		/* fall through - to _DRM_SHM */
>  	case _DRM_SHM:
>  		vma->vm_ops = &drm_vm_shm_ops;
>  		vma->vm_private_data = (void *)map;
> -- 
> 2.20.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/drm_vm: Mark expected switch fall-throughs
  2019-02-18  8:57 ` Daniel Vetter
@ 2019-02-18 18:02   ` Gustavo A. R. Silva
  2019-02-18 18:58     ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-18 18:02 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Sean Paul, David Airlie,
	dri-devel, linux-kernel, Kees Cook, Daniel Vetter

Hi Daniel,

On 2/18/19 2:57 AM, Daniel Vetter wrote:
> On Fri, Feb 15, 2019 at 11:05:46AM -0600, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch
>> cases where we are expecting to fall through.
>>
>> Warning level 3 was used: -Wimplicit-fallthrough=3
>>
>> Notice that, in this particular case, the code comment is modified
>> in accordance with what GCC is expecting to find.
>>
>> This patch is part of the ongoing efforts to enable
>> -Wimplicit-fallthrough.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> 
> Queued for 5.2, thanks for your patch.
> -Daniel
> 

I wonder if you could take this one too, or give me some feedback
about it:

https://patchwork.kernel.org/patch/10646783/

I've pinged twice, but I haven't received any responses.

Thanks
--
Gustavo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/drm_vm: Mark expected switch fall-throughs
  2019-02-18 18:02   ` Gustavo A. R. Silva
@ 2019-02-18 18:58     ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2019-02-18 18:58 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Maarten Lankhorst, Maxime Ripard, Sean Paul, David Airlie,
	dri-devel, Linux Kernel Mailing List, Kees Cook

On Mon, Feb 18, 2019 at 7:02 PM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
> Hi Daniel,
>
> On 2/18/19 2:57 AM, Daniel Vetter wrote:
> > On Fri, Feb 15, 2019 at 11:05:46AM -0600, Gustavo A. R. Silva wrote:
> >> In preparation to enabling -Wimplicit-fallthrough, mark switch
> >> cases where we are expecting to fall through.
> >>
> >> Warning level 3 was used: -Wimplicit-fallthrough=3
> >>
> >> Notice that, in this particular case, the code comment is modified
> >> in accordance with what GCC is expecting to find.
> >>
> >> This patch is part of the ongoing efforts to enable
> >> -Wimplicit-fallthrough.
> >>
> >> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> >
> > Queued for 5.2, thanks for your patch.
> > -Daniel
> >
>
> I wonder if you could take this one too, or give me some feedback
> about it:
>
> https://patchwork.kernel.org/patch/10646783/
>
> I've pinged twice, but I haven't received any responses.

Dave? nouveau is kinda your thing, at least all the fallout :-)
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-18 18:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15 17:05 [PATCH] drm/drm_vm: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-02-18  8:57 ` Daniel Vetter
2019-02-18 18:02   ` Gustavo A. R. Silva
2019-02-18 18:58     ` Daniel Vetter

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).