summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/include
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavoars@kernel.org>2023-05-28 14:26:37 -0600
committerAlex Deucher <alexander.deucher@amd.com>2023-06-09 12:38:12 -0400
commit5be7d4e3cf9ef9853934daa03cf573723bae1650 (patch)
treeb4758f2f74cf5f32e46cc0fc7d962f10bfcc8814 /drivers/gpu/drm/amd/display/include
parent9f0bcf49e9895cb005d78b33a5eebfa11711b425 (diff)
downloadlinux-5be7d4e3cf9ef9853934daa03cf573723bae1650.tar.gz
linux-5be7d4e3cf9ef9853934daa03cf573723bae1650.tar.bz2
linux-5be7d4e3cf9ef9853934daa03cf573723bae1650.zip
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>
Diffstat (limited to 'drivers/gpu/drm/amd/display/include')
0 files changed, 0 insertions, 0 deletions