drm/amdgpu: Replace one-elements array with flex-array members
authorPaulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Sun, 13 Nov 2022 07:44:05 +0000 (20:44 +1300)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Nov 2022 18:35:16 +0000 (13:35 -0500)
commitbd3fe587f8989cd06209927abd71ee0af13cca4a
treeca13dfb1b7fc74dafed421f131ff606dec65ade7
parent9635709a83aa6deda9e0eef164f1ffff5fe1d37a
drm/amdgpu: Replace one-elements array with flex-array members

One-element arrays are deprecated, and we are replacing them with
flexible array members instead. So, replace one-element array with
flexible-array member in structs ATOM_I2C_VOLTAGE_OBJECT_V3,
ATOM_ASIC_INTERNAL_SS_INFO_V2, ATOM_ASIC_INTERNAL_SS_INFO_V3,
and refactor the rest of the code accordingly.

Important to mention is that doing a build before/after this patch
results in no functional binary output differences.

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

Link: https://github.com/KSPP/linux/issues/79
Link: https://github.com/KSPP/linux/issues/238
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
drivers/gpu/drm/amd/include/atombios.h