Re: [PATCH 12/40] drm/amd/display/dc/dce120/Makefile: Ignore -Woverride-init warning

2021-01-12 Thread Alex Deucher
On Mon, Jan 11, 2021 at 2:20 PM Lee Jones  wrote:
>
> This file uses a complex abstracted set of hierarchical macros to
> setup its applicable register lists within constant structures.
> However in the case of TMDS_CNTL we wish to mark it as not applicable
> for this use-case.
>
> One method would be to de-const all of the definitions and users, then
> manually zero out TMDS_CNTL from the list.  Another would be to create
> a new set of hierarchical macros to omit TMDS_CNTL entirely.  Both
> would entail a great deal of unnecessary changes and maintenance
> burden.
>
> Instead, let's just silence the warning.
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:281:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> note: (near initialization for ‘stream_enc_regs[0].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:281:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:282:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> note: (near initialization for ‘stream_enc_regs[1].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:282:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:283:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> note: (near initialization for ‘stream_enc_regs[2].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:283:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:284:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> note: (near initialization for ‘stream_enc_regs[3].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:284:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:285:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> note: (near initialization for ‘stream_enc_regs[4].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:285:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> warning: initialized field overwritten [-Woverride-init]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:286:2: 
> note: in expansion of macro ‘stream_enc_regs’
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
> note: (near initialization for ‘stream_enc_regs[5].TMDS_CNTL’)
>  drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:286:2: 
> note: in expansion of macro ‘stream_enc_regs’
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/amd/display/dc/dce120/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce120/Makefile 
> b/drivers/gpu/drm/amd/display/dc/dce120/Makefile
> index 37db1f8d45ea5..a9cc4b73270bb 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce120/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dce120/Makefile
> @@ -24,6 +24,8 @@
>  # It provides the control and status of HW CRTC block.
>
>
> +CFLAGS_$(AMDDALPATH)/dc/dce120/dce120_resource.o = $(call 
> cc-disable-warning, override-init)
> +
>  DCE120 = dce120_resource.o dce120_timing_generator.o \
>  dce120_hw_sequencer.o
>
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
amd-gfx mailing list

[PATCH 12/40] drm/amd/display/dc/dce120/Makefile: Ignore -Woverride-init warning

2021-01-11 Thread Lee Jones
This file uses a complex abstracted set of hierarchical macros to
setup its applicable register lists within constant structures.
However in the case of TMDS_CNTL we wish to mark it as not applicable
for this use-case.

One method would be to de-const all of the definitions and users, then
manually zero out TMDS_CNTL from the list.  Another would be to create
a new set of hierarchical macros to omit TMDS_CNTL entirely.  Both
would entail a great deal of unnecessary changes and maintenance
burden.

Instead, let's just silence the warning.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
warning: initialized field overwritten [-Woverride-init]
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:281:2: note: 
in expansion of macro ‘stream_enc_regs’
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
note: (near initialization for ‘stream_enc_regs[0].TMDS_CNTL’)
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:281:2: note: 
in expansion of macro ‘stream_enc_regs’
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
warning: initialized field overwritten [-Woverride-init]
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:282:2: note: 
in expansion of macro ‘stream_enc_regs’
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
note: (near initialization for ‘stream_enc_regs[1].TMDS_CNTL’)
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:282:2: note: 
in expansion of macro ‘stream_enc_regs’
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
warning: initialized field overwritten [-Woverride-init]
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:283:2: note: 
in expansion of macro ‘stream_enc_regs’
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
note: (near initialization for ‘stream_enc_regs[2].TMDS_CNTL’)
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:283:2: note: 
in expansion of macro ‘stream_enc_regs’
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
warning: initialized field overwritten [-Woverride-init]
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:284:2: note: 
in expansion of macro ‘stream_enc_regs’
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
note: (near initialization for ‘stream_enc_regs[3].TMDS_CNTL’)
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:284:2: note: 
in expansion of macro ‘stream_enc_regs’
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
warning: initialized field overwritten [-Woverride-init]
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:285:2: note: 
in expansion of macro ‘stream_enc_regs’
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
note: (near initialization for ‘stream_enc_regs[4].TMDS_CNTL’)
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:285:2: note: 
in expansion of macro ‘stream_enc_regs’
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
warning: initialized field overwritten [-Woverride-init]
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:286:2: note: 
in expansion of macro ‘stream_enc_regs’
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: 
note: (near initialization for ‘stream_enc_regs[5].TMDS_CNTL’)
 drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:286:2: note: 
in expansion of macro ‘stream_enc_regs’

Cc: Harry Wentland 
Cc: Leo Li 
Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-de...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/amd/display/dc/dce120/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dce120/Makefile 
b/drivers/gpu/drm/amd/display/dc/dce120/Makefile
index 37db1f8d45ea5..a9cc4b73270bb 100644
--- a/drivers/gpu/drm/amd/display/dc/dce120/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dce120/Makefile
@@ -24,6 +24,8 @@
 # It provides the control and status of HW CRTC block.
 
 
+CFLAGS_$(AMDDALPATH)/dc/dce120/dce120_resource.o = $(call cc-disable-warning, 
override-init)
+
 DCE120 = dce120_resource.o dce120_timing_generator.o \
 dce120_hw_sequencer.o
 
-- 
2.25.1

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