Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1804009ybj; Wed, 6 May 2020 05:45:32 -0700 (PDT) X-Google-Smtp-Source: APiQypLZuIqKixVr3GLU5CXxkfbrPXfBLhv7kkvQW90LofsM6GOxFrsEVEI7dLkPx0FXFiJW1l3h X-Received: by 2002:a17:906:68d7:: with SMTP id y23mr7404016ejr.85.1588769132079; Wed, 06 May 2020 05:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588769132; cv=none; d=google.com; s=arc-20160816; b=A0Qoc+enuqQx11Jj+R6iJHQ20ZvJbC9ilDiiN78mu/RJ/+FAL0odiugG9FyHDhGcrU CND0rtDNe0iTlrPUumbbkjFZg0nxUdmRgxC7LOFyRVaFRyy3v4zTJxVFL1gPLEiWOl8T D9zkuV9Tx1LWPVQGOm3PE8onf9QISYcB57QBui1ETuMS0t3Oq5yqkO9Xyk11XPw9MLrt NirMQVH9F8WgxtxE/NcIZi3MhUXnNVY6bBQp8p+rs48NgK8eSd8XIDgKfXY9F8bIGxL8 4ssclkFwhSo4QynPvz2gzbicZTSMNPgOj7vqauPTcXBGBWoPxhxpKO+WNCfPzCx6way0 OQIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=uovemir8aDLfnQLEwyonUFdiYB2QH3i9RwkKiM4GaVA=; b=Lqucs7bIfp3kP6jYGdpcofyp5XK2AhLo/4LY6fnDL2yH4RXvQku8CMZnjptmLrvptq JkFjAh04Qs7x3F3S6+0wtuAgB9ctBPO4HmZnOfg3ronFBr8X7CMIDHC+fW2moqtfGYlE nvAdrOGJHQwc2LQLf5QyaG3Ks5gJSH1blIvcDrHPN9BlMGwTjDmgB+tpMMfNdZszGHov /DRUvIeghCNlBKHrWrqhHHziV+xWIWnGqeDlafzntFLL1qldi/kKpvH4tv6LEpOPiwls J49aI9ZqzvaOZF4cEGAG6yIYXwDnm45xOI4tnatKanCDg0RlRG0zJlTJv2BJXnEDHYfW wbNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m26si934059edp.0.2020.05.06.05.45.08; Wed, 06 May 2020 05:45:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728267AbgEFMnI (ORCPT + 99 others); Wed, 6 May 2020 08:43:08 -0400 Received: from mail-m17613.qiye.163.com ([59.111.176.13]:22691 "EHLO mail-m17613.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbgEFMnH (ORCPT ); Wed, 6 May 2020 08:43:07 -0400 Received: from ubuntu.localdomain (unknown [157.0.31.122]) by mail-m17613.qiye.163.com (Hmail) with ESMTPA id 6308D48281A; Wed, 6 May 2020 20:43:01 +0800 (CST) From: Bernard Zhao To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Bernard Zhao Subject: [PATCH] drm/mediatek: eliminate the magic number in array size Date: Wed, 6 May 2020 05:42:55 -0700 Message-Id: <20200506124255.9477-1-bernard@vivo.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZT1VPQ01CQkJCQ0NOTk5CSllXWShZQU hPN1dZLVlBSVdZCQ4XHghZQVk1NCk2OjckKS43PlkG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Mhw6KRw6FDg2Tjg5DBVNOhhR Ag8wCjlVSlVKTkNDTE1DQkNKTU5OVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlKTkxV S1VISlVKSUlZV1kIAVlBSUxISjcG X-HM-Tid: 0a71ea02c25d93bakuws6308d48281a Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Eiminate the magic number in array size, there macro defines in hdmi.h. Signed-off-by: Bernard Zhao --- drivers/gpu/drm/mediatek/mtk_hdmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index ff43a3d80410..4c962c7f06e5 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -982,7 +982,7 @@ static int mtk_hdmi_setup_avi_infoframe(struct mtk_hdmi *hdmi, struct drm_display_mode *mode) { struct hdmi_avi_infoframe frame; - u8 buffer[17]; + u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE]; ssize_t err; err = drm_hdmi_avi_infoframe_from_display_mode(&frame, @@ -1008,7 +1008,7 @@ static int mtk_hdmi_setup_spd_infoframe(struct mtk_hdmi *hdmi, const char *product) { struct hdmi_spd_infoframe frame; - u8 buffer[29]; + u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_SPD_INFOFRAME_SIZE]; ssize_t err; err = hdmi_spd_infoframe_init(&frame, vendor, product); @@ -1031,7 +1031,7 @@ static int mtk_hdmi_setup_spd_infoframe(struct mtk_hdmi *hdmi, static int mtk_hdmi_setup_audio_infoframe(struct mtk_hdmi *hdmi) { struct hdmi_audio_infoframe frame; - u8 buffer[14]; + u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AUDIO_INFOFRAME_SIZE]; ssize_t err; err = hdmi_audio_infoframe_init(&frame); -- 2.26.2