OSDN Git Service

drm/amdgpu: Replace 1-element array with flexible-array member
authorPaulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Mon, 7 Nov 2022 09:32:51 +0000 (22:32 +1300)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 9 Nov 2022 22:41:42 +0000 (17:41 -0500)
commite50db38342d5d2243e9738a51c9737cbb017e456
treea85788c15c1ab0093acf2ce7d7d67c40fc0445de
parent10276a20be1115e1f76c189330da2992df980eee
drm/amdgpu: Replace 1-element array with flexible-array member

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_GPIO_PIN_ASSIGNMENT,
_ATOM_DISPLAY_OBJECT_PATH, _ATOM_DISPLAY_OBJECT_PATH_TABLE,
_ATOM_OBJECT_TABLE 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