linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: mali-dp: Mark expected switch fall-through
@ 2019-07-26 11:27 Anders Roxell
  2019-07-29  9:58 ` Liviu Dudau
  0 siblings, 1 reply; 3+ messages in thread
From: Anders Roxell @ 2019-07-26 11:27 UTC (permalink / raw)
  To: airlied, daniel; +Cc: dri-devel, linux-kernel, Anders Roxell, stable

When fall-through warnings was enabled by default, commit d93512ef0f0e
("Makefile: Globally enable fall-through warning"), the following
warnings was starting to show up:

../drivers/gpu/drm/arm/malidp_hw.c: In function ‘malidp_format_get_bpp’:
../drivers/gpu/drm/arm/malidp_hw.c:387:8: warning: this statement may fall
 through [-Wimplicit-fallthrough=]
    bpp = 30;
    ~~~~^~~~
../drivers/gpu/drm/arm/malidp_hw.c:388:3: note: here
   case DRM_FORMAT_YUV420_10BIT:
   ^~~~
../drivers/gpu/drm/arm/malidp_hw.c: In function ‘malidp_se_irq’:
../drivers/gpu/drm/arm/malidp_hw.c:1311:4: warning: this statement may fall
 through [-Wimplicit-fallthrough=]
    drm_writeback_signal_completion(&malidp->mw_connector, 0);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/arm/malidp_hw.c:1313:3: note: here
   case MW_START:
   ^~~~

Rework to add a 'break;' in a case that didn't have it so that
the compiler doesn't warn about fall-through.

Cc: stable@vger.kernel.org # v4.9+
Fixes: b8207562abdd ("drm/arm/malidp: Specified the rotation memory requirements for AFBC YUV formats")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 drivers/gpu/drm/arm/malidp_hw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/arm/malidp_hw.c b/drivers/gpu/drm/arm/malidp_hw.c
index 50af399d7f6f..dc5fff9af338 100644
--- a/drivers/gpu/drm/arm/malidp_hw.c
+++ b/drivers/gpu/drm/arm/malidp_hw.c
@@ -385,6 +385,7 @@ int malidp_format_get_bpp(u32 fmt)
 		switch (fmt) {
 		case DRM_FORMAT_VUY101010:
 			bpp = 30;
+			break;
 		case DRM_FORMAT_YUV420_10BIT:
 			bpp = 15;
 			break;
@@ -1309,7 +1310,7 @@ static irqreturn_t malidp_se_irq(int irq, void *arg)
 			break;
 		case MW_RESTART:
 			drm_writeback_signal_completion(&malidp->mw_connector, 0);
-			/* fall through to a new start */
+			/* fall through */
 		case MW_START:
 			/* writeback started, need to emulate one-shot mode */
 			hw->disable_memwrite(hwdev);
-- 
2.20.1


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

* Re: [PATCH] drm: mali-dp: Mark expected switch fall-through
  2019-07-26 11:27 [PATCH] drm: mali-dp: Mark expected switch fall-through Anders Roxell
@ 2019-07-29  9:58 ` Liviu Dudau
  2019-07-29 10:28   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Liviu Dudau @ 2019-07-29  9:58 UTC (permalink / raw)
  To: Anders Roxell; +Cc: airlied, daniel, stable, linux-kernel, dri-devel

Hi Anders,

On Fri, Jul 26, 2019 at 01:27:41PM +0200, Anders Roxell wrote:
> When fall-through warnings was enabled by default, commit d93512ef0f0e
> ("Makefile: Globally enable fall-through warning"), the following
> warnings was starting to show up:
> 
> ../drivers/gpu/drm/arm/malidp_hw.c: In function ‘malidp_format_get_bpp’:
> ../drivers/gpu/drm/arm/malidp_hw.c:387:8: warning: this statement may fall
>  through [-Wimplicit-fallthrough=]
>     bpp = 30;
>     ~~~~^~~~
> ../drivers/gpu/drm/arm/malidp_hw.c:388:3: note: here
>    case DRM_FORMAT_YUV420_10BIT:
>    ^~~~
> ../drivers/gpu/drm/arm/malidp_hw.c: In function ‘malidp_se_irq’:
> ../drivers/gpu/drm/arm/malidp_hw.c:1311:4: warning: this statement may fall
>  through [-Wimplicit-fallthrough=]
>     drm_writeback_signal_completion(&malidp->mw_connector, 0);
>     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/gpu/drm/arm/malidp_hw.c:1313:3: note: here
>    case MW_START:
>    ^~~~
> 
> Rework to add a 'break;' in a case that didn't have it so that
> the compiler doesn't warn about fall-through.
> 
> Cc: stable@vger.kernel.org # v4.9+
> Fixes: b8207562abdd ("drm/arm/malidp: Specified the rotation memory requirements for AFBC YUV formats")
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

Running the patch through scripts/get_maintainer.pl would've also given you the
emails for the mali-dp maintainers to reach directly and have a faster response
time, but I guess you were trying to see if we check the dri-devel mailing list.

Thanks for the patch!

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

> ---
>  drivers/gpu/drm/arm/malidp_hw.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/arm/malidp_hw.c b/drivers/gpu/drm/arm/malidp_hw.c
> index 50af399d7f6f..dc5fff9af338 100644
> --- a/drivers/gpu/drm/arm/malidp_hw.c
> +++ b/drivers/gpu/drm/arm/malidp_hw.c
> @@ -385,6 +385,7 @@ int malidp_format_get_bpp(u32 fmt)
>  		switch (fmt) {
>  		case DRM_FORMAT_VUY101010:
>  			bpp = 30;
> +			break;
>  		case DRM_FORMAT_YUV420_10BIT:
>  			bpp = 15;
>  			break;
> @@ -1309,7 +1310,7 @@ static irqreturn_t malidp_se_irq(int irq, void *arg)
>  			break;
>  		case MW_RESTART:
>  			drm_writeback_signal_completion(&malidp->mw_connector, 0);
> -			/* fall through to a new start */

It's a shame that the compiler throws a warning here, it would've been really
useful to keep the hint that going back to a new start is intentional without
having to type another comment.

> +			/* fall through */
>  		case MW_START:
>  			/* writeback started, need to emulate one-shot mode */
>  			hw->disable_memwrite(hwdev);
> -- 
> 2.20.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

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

* Re: [PATCH] drm: mali-dp: Mark expected switch fall-through
  2019-07-29  9:58 ` Liviu Dudau
@ 2019-07-29 10:28   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-07-29 10:28 UTC (permalink / raw)
  To: Liviu Dudau, Anders Roxell
  Cc: airlied, daniel, stable, linux-kernel, dri-devel



On 7/29/19 4:58 AM, Liviu Dudau wrote:

>>  		case MW_RESTART:
>>  			drm_writeback_signal_completion(&malidp->mw_connector, 0);
>> -			/* fall through to a new start */
> 
> It's a shame that the compiler throws a warning here, it would've been really
> useful to keep the hint that going back to a new start is intentional without
> having to type another comment.
> 

You don't have to remove the rest of the comment. For a one-line comment this works
just fine:

/* fall through - to a new start */

--
Gustavo

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

end of thread, other threads:[~2019-07-29 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26 11:27 [PATCH] drm: mali-dp: Mark expected switch fall-through Anders Roxell
2019-07-29  9:58 ` Liviu Dudau
2019-07-29 10:28   ` 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).