2021-11-16 09:22:24

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH] omapfb: add one more "fallthrough" statement

From: Arnd Bergmann <[email protected]>

clang warns about one missing fallthrough that gcc ignores:

drivers/video/fbdev/omap/omapfb_main.c:1558:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]

Add it here as well.

Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/video/fbdev/omap/omapfb_main.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c
index 3d090d2d9ed9..a6a8404d1462 100644
--- a/drivers/video/fbdev/omap/omapfb_main.c
+++ b/drivers/video/fbdev/omap/omapfb_main.c
@@ -1555,6 +1555,7 @@ static void omapfb_free_resources(struct omapfb_device *fbdev, int state)
case 1:
dev_set_drvdata(fbdev->dev, NULL);
kfree(fbdev);
+ fallthrough;
case 0:
/* nothing to free */
break;
--
2.29.2



2021-11-16 15:18:07

by Nathan Chancellor

[permalink] [raw]
Subject: Re: [PATCH] omapfb: add one more "fallthrough" statement

On Tue, Nov 16, 2021 at 10:21:54AM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <[email protected]>
>
> clang warns about one missing fallthrough that gcc ignores:
>
> drivers/video/fbdev/omap/omapfb_main.c:1558:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
>
> Add it here as well.
>
> Signed-off-by: Arnd Bergmann <[email protected]>

Reviewed-by: Nathan Chancellor <[email protected]>

> ---
> drivers/video/fbdev/omap/omapfb_main.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c
> index 3d090d2d9ed9..a6a8404d1462 100644
> --- a/drivers/video/fbdev/omap/omapfb_main.c
> +++ b/drivers/video/fbdev/omap/omapfb_main.c
> @@ -1555,6 +1555,7 @@ static void omapfb_free_resources(struct omapfb_device *fbdev, int state)
> case 1:
> dev_set_drvdata(fbdev->dev, NULL);
> kfree(fbdev);
> + fallthrough;
> case 0:
> /* nothing to free */
> break;
> --
> 2.29.2
>