Skip to content

Commit

Permalink
drm/amdgpu: Replace remaining 1-element array with flex-array
Browse files Browse the repository at this point in the history
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 struct GOP_VBIOS_CONTENT 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 [1]

Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Paulo Miguel Almeida authored and Alex Deucher committed Nov 23, 2022
1 parent 501fd24 commit 25b2483
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/include/atombios.h
Original file line number Diff line number Diff line change
Expand Up @@ -9292,7 +9292,7 @@ typedef struct {

typedef struct {
VFCT_IMAGE_HEADER VbiosHeader;
UCHAR VbiosContent[1];
UCHAR VbiosContent[];
}GOP_VBIOS_CONTENT;

typedef struct {
Expand Down

0 comments on commit 25b2483

Please sign in to comment.