1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/gpu/drm/amd/include
Gustavo A. R. Silva 5be7d4e3cf drm/amdgpu/discovery: Replace fake flex-arrays with flexible-array members
Zero-length and one-element arrays are deprecated, and we are moving
towards adopting C99 flexible-array members, instead.

Use the DECLARE_FLEX_ARRAY() helper macro to transform zero-length
arrays in a union into flexible-array members. And replace a one-element
array with a C99 flexible-array member.

Address the following warnings found with GCC-13 and
-fstrict-flex-arrays=3 enabled:
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1009:89: warning: array subscript kk is outside array bounds of ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Warray-bounds=]
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1007:94: warning: array subscript kk is outside array bounds of ‘uint64_t[0]’ {aka ‘long long unsigned int[]’} [-Warray-bounds=]
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1310:94: warning: array subscript k is outside array bounds of ‘uint64_t[0]’ {aka ‘long long unsigned int[]’} [-Warray-bounds=]
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1309:57: warning: array subscript k is outside array bounds of ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Warray-bounds=]

This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
routines on memcpy() and help us make progress towards globally
enabling -fstrict-flex-arrays=3 [1].

This results in no differences in binary output.

Link: https://github.com/KSPP/linux/issues/21
Link: https://github.com/KSPP/linux/issues/193
Link: https://github.com/KSPP/linux/issues/300
Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1]
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2023-06-09 12:38:12 -04:00
..
asic_reg drm/amdgpu: setup hw debug registers on driver initialization 2023-06-09 12:34:56 -04:00
ivsrcid drm/amdgpu: Add gfx ras poison consumption irq handling on gfx v11_0_3 2023-01-17 16:11:51 -05:00
aldebaran_ip_offset.h drm/amd/include/aldebaran_ip_offset: Mark top-level IP_BASE as __maybe_unused 2021-05-21 10:32:16 -04:00
amd_acpi.h drm/amdgpu: support atcs method powershift (v4) 2021-06-01 22:36:48 -04:00
amd_pcie.h drm/amdgpu:Add pcie gen5 support in pcie capability. 2021-01-21 09:54:56 -05:00
amd_pcie_helpers.h gpu: drm: amd/radeon: Convert printk(KERN_<LEVEL> to pr_<level> 2017-03-29 23:53:24 -04:00
amd_shared.h drm/amdgpu: add the accelerator pcie class 2023-06-09 11:07:16 -04:00
arct_ip_offset.h drm/amd/include/arct_ip_offset: Mark top-level IP_BASE definition as __maybe_unused 2020-11-24 12:09:53 -05:00
atom-bits.h
atom-names.h
atom-types.h
atombios.h drm/amdgpu: Replace remaining 1-element array with flex-array 2022-11-23 10:31:31 -05:00
atomfirmware.h drm/amdgpu: add new vram type for dgpu 2023-06-09 09:44:25 -04:00
atomfirmwareid.h drm/amdgpu: add the new atomfirmware interface header 2017-03-29 23:54:15 -04:00
beige_goby_ip_offset.h drm/amd/amdgpu: initialize IP offset for beige_goby 2021-05-19 22:40:09 -04:00
cgs_common.h drm/amdgpu: retire indirect mmio reg support from cgs 2020-04-09 10:43:18 -04:00
cik_structs.h drm/amdkfd: Shift sdma_engine_id and sdma_queue_id in mqd 2019-05-24 12:21:01 -05:00
cyan_skillfish_ip_offset.h drm/amd: Mark IP_BASE definition as __maybe_unused 2021-12-13 16:32:34 -05:00
dimgrey_cavefish_ip_offset.h drm/amd/include/dimgrey_cavefish_ip_offset: Mark top-level IP_BASE as __maybe_unused 2020-11-24 12:09:53 -05:00
discovery.h drm/amdgpu/discovery: Replace fake flex-arrays with flexible-array members 2023-06-09 12:38:12 -04:00
displayobject.h drm/amdgpu: add the new atomfirmware interface header 2017-03-29 23:54:15 -04:00
dm_pp_interface.h drm/amd/pp: Remove the same struct define in powerplay 2018-07-05 16:40:02 -05:00
kgd_kfd_interface.h drm/amdgpu: add kgd hw debug mode setting interface 2023-06-09 12:34:53 -04:00
kgd_pp_interface.h drm/amd/pm: add sysfs node vclk1 and dclk1 2023-03-31 11:18:55 -04:00
mes_api_def.h drm/amd: Fix spelling typo in comments 2022-06-03 16:43:36 -04:00
mes_v11_api_def.h drm/amdgpu: expose debug api for mes 2023-06-09 12:35:43 -04:00
navi10_enum.h drm/amdgpu: Update NV SIMD-per-CU to 2 2021-07-01 00:05:18 -04:00
navi10_ip_offset.h drm/amd/include/navi10_ip_offset: Mark top-level IP_BASE as __maybe_unused 2020-11-24 12:09:53 -05:00
navi12_ip_offset.h drm/amd/include/navi12_ip_offset: Mark top-level IP_BASE as __maybe_unused 2020-11-24 12:09:53 -05:00
navi14_ip_offset.h drm/amd/include/navi14_ip_offset: Mark top-level IP_BASE as __maybe_unused 2020-11-24 12:09:53 -05:00
pptable.h drm/amdgpu: add raven related define in pptable.h. 2017-05-24 17:41:50 -04:00
renoir_ip_offset.h drm/amd/include/renoir_ip_offset: Mark top-level IP_BASE as __maybe_unused 2021-01-14 13:20:20 -05:00
sienna_cichlid_ip_offset.h drm/amd/include/sienna_cichlid_ip_offset: Mark top-level IP_BASE as __maybe_unused 2020-11-24 12:09:53 -05:00
soc15_hw_ip.h drm/amdgpu: add lsdma block 2022-05-10 17:53:11 -04:00
soc15_ih_clientid.h drm/amdgpu: add soc21 ih clientid definition 2022-05-04 09:52:59 -04:00
soc21_enum.h drm/amdgpu: add soc21 chip enum header v8 2022-05-04 10:02:18 -04:00
v9_structs.h drm/amdkfd: Update MQD management on multi XCC setup 2023-06-09 09:42:36 -04:00
v10_structs.h drm/amdgpu: add v10 structs header (v2) 2019-06-20 21:16:37 -05:00
v11_structs.h drm/amdgpu: add new parameters in v11_struct 2023-04-11 18:03:21 -04:00
vangogh_ip_offset.h drm/amd/include/vangogh_ip_offset: Mark top-level IP_BASE as __maybe_unused 2020-11-24 12:09:53 -05:00
vega10_enum.h drm/amdgpu: Support new arcturus mtype 2019-09-13 17:35:48 -05:00
vega10_ip_offset.h drm/amd/include/vega10_ip_offset: Mark _BASE structs as __maybe_unused 2020-11-13 17:29:46 -05:00
vega20_ip_offset.h drm/amd/include/vega20_ip_offset: Mark top-level IP_BASE definition as __maybe_unused 2020-11-24 12:09:53 -05:00
vi_structs.h drm/amdkfd: Check HIQ's MQD for queue preemption status 2021-03-23 22:59:25 -04:00
yellow_carp_offset.h drm/amdgpu: add missing license to some files 2022-11-23 10:31:31 -05:00