Re: [PATCH] virt: vbox: Mark expected switch fall-through

From: Gustavo A. R. Silva
Date: Tue Feb 26 2019 - 21:32:40 EST




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@xxxxxxxxxxxxxx>
>
> Thank you the patch, patch looks good to me:
>
> Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>
>

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