All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu/display: add fallthrough comment
@ 2019-12-05 21:39 Alex Deucher
  2019-12-05 22:10 ` Liu, Zhan
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2019-12-05 21:39 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

To avoid a compiler warning.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 1 +
 1 file changed, 1 insertion(+)

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 191b68b8163a..f1a5d2c6aa37 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
@@ -645,6 +645,7 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
 			case AUX_TRANSACTION_REPLY_AUX_DEFER:
 			case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
 				retry_on_defer = true;
+				/* fall through */
 			case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK:
 				if (++aux_defer_retries >= AUX_MAX_DEFER_RETRIES) {
 					goto fail;
-- 
2.23.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] drm/amdgpu/display: add fallthrough comment
  2019-12-05 21:39 [PATCH] drm/amdgpu/display: add fallthrough comment Alex Deucher
@ 2019-12-05 22:10 ` Liu, Zhan
  2019-12-05 22:12   ` Alex Deucher
  0 siblings, 1 reply; 5+ messages in thread
From: Liu, Zhan @ 2019-12-05 22:10 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx; +Cc: Deucher, Alexander



> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex
> Deucher
> Sent: 2019/December/05, Thursday 4:39 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
> Subject: [PATCH] drm/amdgpu/display: add fallthrough comment
> 
> To avoid a compiler warning.
> 
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> 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 191b68b8163a..f1a5d2c6aa37 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> @@ -645,6 +645,7 @@ bool dce_aux_transfer_with_retries(struct
> ddc_service *ddc,
>  			case AUX_TRANSACTION_REPLY_AUX_DEFER:
>  			case
> AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
>  				retry_on_defer = true;
> +				/* fall through */

I am a bit confusing here. Why a comment can avoid a compiler warning?

>  			case
> AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK:
>  				if (++aux_defer_retries >=
> AUX_MAX_DEFER_RETRIES) {
>  					goto fail;
> --
> 2.23.0
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
> freedesktop.org%2Fmailman%2Flistinfo%2Famd-
> gfx&amp;data=02%7C01%7Czhan.liu%40amd.com%7C77d85a0275aa4c0a78
> 2f08d779cb9716%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6
> 37111788208702340&amp;sdata=3m%2FuNuNIgq82z%2BAeXJ9y7wn81kV%
> 2FiDt3AyC3CDiTRrc%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amdgpu/display: add fallthrough comment
  2019-12-05 22:10 ` Liu, Zhan
@ 2019-12-05 22:12   ` Alex Deucher
  2019-12-05 22:16     ` Liu, Zhan
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2019-12-05 22:12 UTC (permalink / raw)
  To: Liu, Zhan; +Cc: Deucher, Alexander, amd-gfx

On Thu, Dec 5, 2019 at 5:10 PM Liu, Zhan <Zhan.Liu@amd.com> wrote:
>
>
>
> > -----Original Message-----
> > From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex
> > Deucher
> > Sent: 2019/December/05, Thursday 4:39 PM
> > To: amd-gfx@lists.freedesktop.org
> > Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
> > Subject: [PATCH] drm/amdgpu/display: add fallthrough comment
> >
> > To avoid a compiler warning.
> >
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > ---
> >  drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > 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 191b68b8163a..f1a5d2c6aa37 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> > +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> > @@ -645,6 +645,7 @@ bool dce_aux_transfer_with_retries(struct
> > ddc_service *ddc,
> >                       case AUX_TRANSACTION_REPLY_AUX_DEFER:
> >                       case
> > AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
> >                               retry_on_defer = true;
> > +                             /* fall through */
>
> I am a bit confusing here. Why a comment can avoid a compiler warning?

The kernel enables fall through warnings, so unless there is a comment
mentioning that are are expecting to fall through here, we get a
warning.  The idea is to find missing breaks in switch code.

Alex

>
> >                       case
> > AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK:
> >                               if (++aux_defer_retries >=
> > AUX_MAX_DEFER_RETRIES) {
> >                                       goto fail;
> > --
> > 2.23.0
> >
> > _______________________________________________
> > amd-gfx mailing list
> > amd-gfx@lists.freedesktop.org
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
> > freedesktop.org%2Fmailman%2Flistinfo%2Famd-
> > gfx&amp;data=02%7C01%7Czhan.liu%40amd.com%7C77d85a0275aa4c0a78
> > 2f08d779cb9716%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6
> > 37111788208702340&amp;sdata=3m%2FuNuNIgq82z%2BAeXJ9y7wn81kV%
> > 2FiDt3AyC3CDiTRrc%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] drm/amdgpu/display: add fallthrough comment
  2019-12-05 22:12   ` Alex Deucher
@ 2019-12-05 22:16     ` Liu, Zhan
  2019-12-06  0:16       ` Harry Wentland
  0 siblings, 1 reply; 5+ messages in thread
From: Liu, Zhan @ 2019-12-05 22:16 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Deucher, Alexander, amd-gfx



> -----Original Message-----
> From: Alex Deucher <alexdeucher@gmail.com>
> Sent: 2019/December/05, Thursday 5:13 PM
> To: Liu, Zhan <Zhan.Liu@amd.com>
> Cc: amd-gfx@lists.freedesktop.org; Deucher, Alexander
> <Alexander.Deucher@amd.com>
> Subject: Re: [PATCH] drm/amdgpu/display: add fallthrough comment
> 
> On Thu, Dec 5, 2019 at 5:10 PM Liu, Zhan <Zhan.Liu@amd.com> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> > > Alex Deucher
> > > Sent: 2019/December/05, Thursday 4:39 PM
> > > To: amd-gfx@lists.freedesktop.org
> > > Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
> > > Subject: [PATCH] drm/amdgpu/display: add fallthrough comment
> > >
> > > To avoid a compiler warning.
> > >
> > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > > ---
> > >  drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > 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 191b68b8163a..f1a5d2c6aa37 100644
> > > --- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> > > +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> > > @@ -645,6 +645,7 @@ bool dce_aux_transfer_with_retries(struct
> > > ddc_service *ddc,
> > >                       case AUX_TRANSACTION_REPLY_AUX_DEFER:
> > >                       case
> > > AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
> > >                               retry_on_defer = true;
> > > +                             /* fall through */
> >
> > I am a bit confusing here. Why a comment can avoid a compiler warning?
> 
> The kernel enables fall through warnings, so unless there is a comment
> mentioning that are are expecting to fall through here, we get a warning.
> The idea is to find missing breaks in switch code.
> 
> Alex

Got you. Thank you for your explanation.

Reviewed-by: Zhan Liu <zhan.liu@amd.com>

> 
> >
> > >                       case
> > > AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK:
> > >                               if (++aux_defer_retries >=
> > > AUX_MAX_DEFER_RETRIES) {
> > >                                       goto fail;
> > > --
> > > 2.23.0
> > >
> > > _______________________________________________
> > > amd-gfx mailing list
> > > amd-gfx@lists.freedesktop.org
> > >
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
> > > freedesktop.org%2Fmailman%2Flistinfo%2Famd-
> > >
> gfx&amp;data=02%7C01%7Czhan.liu%40amd.com%7C77d85a0275aa4c0a78
> > >
> 2f08d779cb9716%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6
> > >
> 37111788208702340&amp;sdata=3m%2FuNuNIgq82z%2BAeXJ9y7wn81kV%
> > > 2FiDt3AyC3CDiTRrc%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amdgpu/display: add fallthrough comment
  2019-12-05 22:16     ` Liu, Zhan
@ 2019-12-06  0:16       ` Harry Wentland
  0 siblings, 0 replies; 5+ messages in thread
From: Harry Wentland @ 2019-12-06  0:16 UTC (permalink / raw)
  To: Liu, Zhan, Alex Deucher; +Cc: Deucher, Alexander, amd-gfx

On 2019-12-05 5:16 p.m., Liu, Zhan wrote:
> 
> 
>> -----Original Message-----
>> From: Alex Deucher <alexdeucher@gmail.com>
>> Sent: 2019/December/05, Thursday 5:13 PM
>> To: Liu, Zhan <Zhan.Liu@amd.com>
>> Cc: amd-gfx@lists.freedesktop.org; Deucher, Alexander
>> <Alexander.Deucher@amd.com>
>> Subject: Re: [PATCH] drm/amdgpu/display: add fallthrough comment
>>
>> On Thu, Dec 5, 2019 at 5:10 PM Liu, Zhan <Zhan.Liu@amd.com> wrote:
>>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
>>>> Alex Deucher
>>>> Sent: 2019/December/05, Thursday 4:39 PM
>>>> To: amd-gfx@lists.freedesktop.org
>>>> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
>>>> Subject: [PATCH] drm/amdgpu/display: add fallthrough comment
>>>>
>>>> To avoid a compiler warning.
>>>>
>>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>>> ---
>>>>  drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 1 +
>>>>  1 file changed, 1 insertion(+)
>>>>
>>>> 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 191b68b8163a..f1a5d2c6aa37 100644
>>>> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
>>>> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
>>>> @@ -645,6 +645,7 @@ bool dce_aux_transfer_with_retries(struct
>>>> ddc_service *ddc,
>>>>                       case AUX_TRANSACTION_REPLY_AUX_DEFER:
>>>>                       case
>>>> AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
>>>>                               retry_on_defer = true;
>>>> +                             /* fall through */
>>>
>>> I am a bit confusing here. Why a comment can avoid a compiler warning?
>>
>> The kernel enables fall through warnings, so unless there is a comment
>> mentioning that are are expecting to fall through here, we get a warning.
>> The idea is to find missing breaks in switch code.
>>
>> Alex
> 
> Got you. Thank you for your explanation.
> 
> Reviewed-by: Zhan Liu <zhan.liu@amd.com>
> 

Interesting. It's described at [1] (search for
-Wimplicit-fallthrough=3). Never knew that.

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

[1]
https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

Harry

>>
>>>
>>>>                       case
>>>> AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK:
>>>>                               if (++aux_defer_retries >=
>>>> AUX_MAX_DEFER_RETRIES) {
>>>>                                       goto fail;
>>>> --
>>>> 2.23.0
>>>>
>>>> _______________________________________________
>>>> amd-gfx mailing list
>>>> amd-gfx@lists.freedesktop.org
>>>>
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
>>>> freedesktop.org%2Fmailman%2Flistinfo%2Famd-
>>>>
>> gfx&amp;data=02%7C01%7Czhan.liu%40amd.com%7C77d85a0275aa4c0a78
>>>>
>> 2f08d779cb9716%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6
>>>>
>> 37111788208702340&amp;sdata=3m%2FuNuNIgq82z%2BAeXJ9y7wn81kV%
>>>> 2FiDt3AyC3CDiTRrc%3D&amp;reserved=0
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2019-12-06  0:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05 21:39 [PATCH] drm/amdgpu/display: add fallthrough comment Alex Deucher
2019-12-05 22:10 ` Liu, Zhan
2019-12-05 22:12   ` Alex Deucher
2019-12-05 22:16     ` Liu, Zhan
2019-12-06  0:16       ` Harry Wentland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.