linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virt: vbox: Mark expected switch fall-through
@ 2019-02-26 19:23 Gustavo A. R. Silva
  2019-02-26 21:04 ` Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-26 19:23 UTC (permalink / raw)
  To: Hans de Goede, Arnd Bergmann, Greg Kroah-Hartman
  Cc: linux-kernel, Gustavo A. R. Silva, Kees Cook

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

This patch fixes the following warning:

drivers/virt/vboxguest/vboxguest_core.c: In function ‘vbg_core_ioctl’:
drivers/virt/vboxguest/vboxguest_core.c:1486:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
   f32bit = true;
   ~~~~~~~^~~~~~
drivers/virt/vboxguest/vboxguest_core.c:1489:2: note: here
  case VBG_IOCTL_HGCM_CALL(0):
  ^~~~

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/virt/vboxguest/vboxguest_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
index 1475ed5ffcde..df7d09409efe 100644
--- a/drivers/virt/vboxguest/vboxguest_core.c
+++ b/drivers/virt/vboxguest/vboxguest_core.c
@@ -1484,8 +1484,8 @@ int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data)
 #ifdef CONFIG_COMPAT
 	case VBG_IOCTL_HGCM_CALL_32(0):
 		f32bit = true;
-		/* Fall through */
 #endif
+		/* Fall through */
 	case VBG_IOCTL_HGCM_CALL(0):
 		return vbg_ioctl_hgcm_call(gdev, session, f32bit, data);
 	case VBG_IOCTL_LOG(0):
-- 
2.21.0


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

* Re: [PATCH] virt: vbox: Mark expected switch fall-through
  2019-02-26 19:23 [PATCH] virt: vbox: Mark expected switch fall-through Gustavo A. R. Silva
@ 2019-02-26 21:04 ` Hans de Goede
  2019-02-27  2:32   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2019-02-26 21:04 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Arnd Bergmann, Greg Kroah-Hartman
  Cc: linux-kernel, Kees Cook

Hi,

On 26-02-19 20:23, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
> 
> This patch fixes the following warning:
> 
> drivers/virt/vboxguest/vboxguest_core.c: In function ‘vbg_core_ioctl’:
> drivers/virt/vboxguest/vboxguest_core.c:1486:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
>     f32bit = true;
>     ~~~~~~~^~~~~~
> drivers/virt/vboxguest/vboxguest_core.c:1489:2: note: here
>    case VBG_IOCTL_HGCM_CALL(0):
>    ^~~~
> 
> 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>

Thank you the patch, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans



> ---
>   drivers/virt/vboxguest/vboxguest_core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
> index 1475ed5ffcde..df7d09409efe 100644
> --- a/drivers/virt/vboxguest/vboxguest_core.c
> +++ b/drivers/virt/vboxguest/vboxguest_core.c
> @@ -1484,8 +1484,8 @@ int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data)
>   #ifdef CONFIG_COMPAT
>   	case VBG_IOCTL_HGCM_CALL_32(0):
>   		f32bit = true;
> -		/* Fall through */
>   #endif
> +		/* Fall through */
>   	case VBG_IOCTL_HGCM_CALL(0):
>   		return vbg_ioctl_hgcm_call(gdev, session, f32bit, data);
>   	case VBG_IOCTL_LOG(0):
> 

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

* Re: [PATCH] virt: vbox: Mark expected switch fall-through
  2019-02-26 21:04 ` Hans de Goede
@ 2019-02-27  2:32   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-27  2:32 UTC (permalink / raw)
  To: Hans de Goede, Arnd Bergmann, Greg Kroah-Hartman; +Cc: linux-kernel, Kees Cook



On 2/26/19 3:04 PM, Hans de Goede wrote:
> Hi,
> 
> On 26-02-19 20:23, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch
>> cases where we are expecting to fall through.
>>
>> This patch fixes the following warning:
>>
>> drivers/virt/vboxguest/vboxguest_core.c: In function ‘vbg_core_ioctl’:
>> drivers/virt/vboxguest/vboxguest_core.c:1486:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>     f32bit = true;
>>     ~~~~~~~^~~~~~
>> drivers/virt/vboxguest/vboxguest_core.c:1489:2: note: here
>>    case VBG_IOCTL_HGCM_CALL(0):
>>    ^~~~
>>
>> 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>
> 
> Thank you the patch, patch looks good to me:
> 
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> 

Thank you, Hans.

--
Gustavo


> Regards,
> 
> Hans
> 
> 
> 
>> ---
>>   drivers/virt/vboxguest/vboxguest_core.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
>> index 1475ed5ffcde..df7d09409efe 100644
>> --- a/drivers/virt/vboxguest/vboxguest_core.c
>> +++ b/drivers/virt/vboxguest/vboxguest_core.c
>> @@ -1484,8 +1484,8 @@ int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data)
>>   #ifdef CONFIG_COMPAT
>>       case VBG_IOCTL_HGCM_CALL_32(0):
>>           f32bit = true;
>> -        /* Fall through */
>>   #endif
>> +        /* Fall through */
>>       case VBG_IOCTL_HGCM_CALL(0):
>>           return vbg_ioctl_hgcm_call(gdev, session, f32bit, data);
>>       case VBG_IOCTL_LOG(0):
>>

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

end of thread, other threads:[~2019-02-27  2:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26 19:23 [PATCH] virt: vbox: Mark expected switch fall-through Gustavo A. R. Silva
2019-02-26 21:04 ` Hans de Goede
2019-02-27  2:32   ` Gustavo A. R. Silva

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