Skip to content

Commit

Permalink
ALSA: hda/hdmi: Replace zero-length array with DECLARE_FLEX_ARRAY() h…
Browse files Browse the repository at this point in the history
…elper

Zero-length arrays are deprecated and we are moving towards adopting
C99 flexible-array members, instead. So, replace zero-length array
declaration in union audio_infoframe with the new DECLARE_FLEX_ARRAY()
helper macro.

This helper allows for a flexible-array member in a union.

Link: KSPP#193
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Link: https://lore.kernel.org/r/Yw01A+TvF1FWQ588@work
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
GustavoARSilva authored and tiwai committed Aug 30, 2022
1 parent 384c687 commit 999b95a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/pci/hda/patch_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ struct dp_audio_infoframe {
union audio_infoframe {
struct hdmi_audio_infoframe hdmi;
struct dp_audio_infoframe dp;
u8 bytes[0];
DECLARE_FLEX_ARRAY(u8, bytes);
};

/*
Expand Down

0 comments on commit 999b95a

Please sign in to comment.