Skip to content

Commit 3852489

Browse files
Bernard ZhaoChun-Kuang Hu
authored andcommitted
drm/mediatek: Eliminate the magic number in array size
Eiminate the magic number in array size, there macro defines in hdmi.h. Signed-off-by: Bernard Zhao <[email protected]> Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent 3cda3d3 commit 3852489

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/mediatek/mtk_hdmi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ static int mtk_hdmi_setup_avi_infoframe(struct mtk_hdmi *hdmi,
978978
struct drm_display_mode *mode)
979979
{
980980
struct hdmi_avi_infoframe frame;
981-
u8 buffer[17];
981+
u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE];
982982
ssize_t err;
983983

984984
err = drm_hdmi_avi_infoframe_from_display_mode(&frame,
@@ -1004,7 +1004,7 @@ static int mtk_hdmi_setup_spd_infoframe(struct mtk_hdmi *hdmi,
10041004
const char *product)
10051005
{
10061006
struct hdmi_spd_infoframe frame;
1007-
u8 buffer[29];
1007+
u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_SPD_INFOFRAME_SIZE];
10081008
ssize_t err;
10091009

10101010
err = hdmi_spd_infoframe_init(&frame, vendor, product);
@@ -1027,7 +1027,7 @@ static int mtk_hdmi_setup_spd_infoframe(struct mtk_hdmi *hdmi,
10271027
static int mtk_hdmi_setup_audio_infoframe(struct mtk_hdmi *hdmi)
10281028
{
10291029
struct hdmi_audio_infoframe frame;
1030-
u8 buffer[14];
1030+
u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AUDIO_INFOFRAME_SIZE];
10311031
ssize_t err;
10321032

10331033
err = hdmi_audio_infoframe_init(&frame);

0 commit comments

Comments
 (0)