linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] drm/amd/display: Fix fall-through warning for Clang
@ 2021-06-16 20:52 Gustavo A. R. Silva
  2021-06-17 19:20 ` Harry Wentland
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2021-06-16 20:52 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Alex Deucher, Christian König, Pan,
	Xinhui, David Airlie, Daniel Vetter
  Cc: amd-gfx, dri-devel, linux-kernel, Gustavo A. R. Silva, linux-hardening

In preparation to enable -Wimplicit-fallthrough for Clang, fix
the following warning by replacing a /* fall through */ comment
with the new pseudo-keyword macro fallthrough:

rivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:672:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
                        case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
                        ^

Notice that Clang doesn't recognize /* fall through */ comments as
implicit fall-through markings, so in order to globally enable
-Wimplicit-fallthrough for Clang, these comments need to be
replaced with fallthrough; in the whole codebase.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
JFYI: We had thousands of these sorts of warnings and now we are down
      to just 15 in linux-next. This is one of those last remaining
      warnings.

 drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
index 28631714f697..2fb88e54a4bf 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
@@ -668,7 +668,7 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
 				/* polling_timeout_period is in us */
 				defer_time_in_ms += aux110->polling_timeout_period / 1000;
 				++aux_defer_retries;
-				/* fall through */
+				fallthrough;
 			case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
 				retry_on_defer = true;
 				fallthrough;
-- 
2.27.0


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

* Re: [PATCH][next] drm/amd/display: Fix fall-through warning for Clang
  2021-06-16 20:52 [PATCH][next] drm/amd/display: Fix fall-through warning for Clang Gustavo A. R. Silva
@ 2021-06-17 19:20 ` Harry Wentland
  2021-06-18 20:36   ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Harry Wentland @ 2021-06-17 19:20 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Leo Li, Alex Deucher, Christian König,
	Pan, Xinhui, David Airlie, Daniel Vetter
  Cc: amd-gfx, dri-devel, linux-kernel, linux-hardening



On 2021-06-16 4:52 p.m., Gustavo A. R. Silva wrote:
> In preparation to enable -Wimplicit-fallthrough for Clang, fix
> the following warning by replacing a /* fall through */ comment
> with the new pseudo-keyword macro fallthrough:
> 
> rivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:672:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>                         case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
>                         ^
> 
> Notice that Clang doesn't recognize /* fall through */ comments as
> implicit fall-through markings, so in order to globally enable
> -Wimplicit-fallthrough for Clang, these comments need to be
> replaced with fallthrough; in the whole codebase.
> 
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> ---
> JFYI: We had thousands of these sorts of warnings and now we are down
>       to just 15 in linux-next. This is one of those last remaining
>       warnings.
> 
>  drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> index 28631714f697..2fb88e54a4bf 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> @@ -668,7 +668,7 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
>  				/* polling_timeout_period is in us */
>  				defer_time_in_ms += aux110->polling_timeout_period / 1000;
>  				++aux_defer_retries;
> -				/* fall through */
> +				fallthrough;
>  			case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
>  				retry_on_defer = true;
>  				fallthrough;
> 


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

* Re: [PATCH][next] drm/amd/display: Fix fall-through warning for Clang
  2021-06-17 19:20 ` Harry Wentland
@ 2021-06-18 20:36   ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2021-06-18 20:36 UTC (permalink / raw)
  To: Harry Wentland
  Cc: Gustavo A. R. Silva, Leo Li, Alex Deucher, Christian König,
	Pan, Xinhui, David Airlie, Daniel Vetter, linux-hardening,
	Maling list - DRI developers, amd-gfx list, LKML

Applied.  Thanks!

Alex

On Thu, Jun 17, 2021 at 3:20 PM Harry Wentland <harry.wentland@amd.com> wrote:
>
>
>
> On 2021-06-16 4:52 p.m., Gustavo A. R. Silva wrote:
> > In preparation to enable -Wimplicit-fallthrough for Clang, fix
> > the following warning by replacing a /* fall through */ comment
> > with the new pseudo-keyword macro fallthrough:
> >
> > rivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:672:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
> >                         case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
> >                         ^
> >
> > Notice that Clang doesn't recognize /* fall through */ comments as
> > implicit fall-through markings, so in order to globally enable
> > -Wimplicit-fallthrough for Clang, these comments need to be
> > replaced with fallthrough; in the whole codebase.
> >
> > Link: https://github.com/KSPP/linux/issues/115
> > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
> > ---
> > JFYI: We had thousands of these sorts of warnings and now we are down
> >       to just 15 in linux-next. This is one of those last remaining
> >       warnings.
> >
> >  drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> > index 28631714f697..2fb88e54a4bf 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> > +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> > @@ -668,7 +668,7 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
> >                               /* polling_timeout_period is in us */
> >                               defer_time_in_ms += aux110->polling_timeout_period / 1000;
> >                               ++aux_defer_retries;
> > -                             /* fall through */
> > +                             fallthrough;
> >                       case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
> >                               retry_on_defer = true;
> >                               fallthrough;
> >
>

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

end of thread, other threads:[~2021-06-18 20:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16 20:52 [PATCH][next] drm/amd/display: Fix fall-through warning for Clang Gustavo A. R. Silva
2021-06-17 19:20 ` Harry Wentland
2021-06-18 20:36   ` Alex Deucher

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