Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp773720ybk; Sat, 9 May 2020 18:32:54 -0700 (PDT) X-Google-Smtp-Source: APiQypL533I0MG73979PhCxYxTST3Obw5jF5qb5kE5E0H40reDRm3SZky08y9m8FJVYv5QKZby// X-Received: by 2002:aa7:d653:: with SMTP id v19mr7787313edr.383.1589074374514; Sat, 09 May 2020 18:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589074374; cv=none; d=google.com; s=arc-20160816; b=dm7xXQ+fOUbLPiEzuWgKvkmkvY9O1s558t2sltnmhyfa2s37ds5MclZTx2xaXBYuVx bySkIsO6/WvWbxem2/Ee7hMGQFakf2uVMj94nh/SjuZ253VcE3yefTZl7WeoUSY7dWCY KdA+MUT2/6LjNgGDzfi2JyP7Vz4xVgmWpWRcCxHBOBZDjsIttBeB+xTrjIHRJGEXXKS2 H2rS1pZ70GQlU+Xk0oxOBEhqKNdIIVAi2hNQuXiuxfwNkvP3YC8oBa4EBRnVR0xQoZhC WF0Az0ibWl8zp8xMpHnUJYhAJKW9C4bC6iQ7O6ZZzjiNnIBWd5ki58eCWpz+KG+ajCr9 sc1g== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=eO0OOiNRo3ZNaNem36xDTI5wITdiX6e/CBcDbldHaA0=; b=t7kK1UY15+hGIXvZXgE5eF0k33trXvmA2blueLO92txwm6qWhAYnAHvCdDB3/23NlC q68xK6yxi5ZJClee4NPWb+lKFLc4fdwydsKd3eCQbzSfm9ZMH6YVAofnSQ+8GprTp1YS JjAVD92aHVwATHs/i+ZQ0Hy/n4U/0HBsFZHcYcdqyr8cTOcc3JTyLbKdatbOtBllj0oE 1/GaG/lC2otrrz10oTjwedKia5Q42Fcl3C9lIDSmrchPRU2/86DUD0gL07by4Q6UNxa+ aIUa5DID9eUJR7M++LMUiPEZ5L0iDoZg1liiAv1ESoLITIbhesENVviTunj339aKoc1I 76Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WixNi7vG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r25si3380765edb.189.2020.05.09.18.32.31; Sat, 09 May 2020 18:32:54 -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; dkim=pass header.i=@kernel.org header.s=default header.b=WixNi7vG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728886AbgEJBbC (ORCPT + 99 others); Sat, 9 May 2020 21:31:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:38624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726630AbgEJBbC (ORCPT ); Sat, 9 May 2020 21:31:02 -0400 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2FB0621775 for ; Sun, 10 May 2020 01:31:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589074261; bh=ZFWESm7BCWR/1W4jYyjzg2GMZbin6TOpjGg+VzUNEZw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WixNi7vGq6fwF+jXK+YId/1rB8G+PTd4s4v9spXxhIej/fIqTIBM7l1xQ622g4SRs FJK4xHHtNzpB3AfmcDFaDThmjEcrTB2GPoJXeccEy7GlFLAUL4Jefturov6uDNdr0O F2R3x80oOncFEJNRshjB7qwvtjunQXppRuJOHWW0= Received: by mail-ej1-f43.google.com with SMTP id x20so1229876ejb.11 for ; Sat, 09 May 2020 18:31:01 -0700 (PDT) X-Gm-Message-State: AGi0PuYGmtP0CLqiYbGulgWkfh1y5+n01WvEkYaeBSDkuqsYDdibqumY sL5h3VItcpMbxQh6MVwe+Xbm3YCmOjNhXlPLMg== X-Received: by 2002:a17:906:2503:: with SMTP id i3mr7553000ejb.293.1589074259573; Sat, 09 May 2020 18:30:59 -0700 (PDT) MIME-Version: 1.0 References: <20200506124255.9477-1-bernard@vivo.com> In-Reply-To: <20200506124255.9477-1-bernard@vivo.com> From: Chun-Kuang Hu Date: Sun, 10 May 2020 09:30:49 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/mediatek: eliminate the magic number in array size To: Bernard Zhao Cc: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , DRI Development , Linux ARM , "moderated list:ARM/Mediatek SoC support" , linux-kernel , opensource.kernel@vivo.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Bernard: Bernard Zhao =E6=96=BC 2020=E5=B9=B45=E6=9C=886=E6=97=A5= =E9=80=B1=E4=B8=89 =E4=B8=8B=E5=8D=888:43=E5=AF=AB=E9=81=93=EF=BC=9A > > Eiminate the magic number in array size, there macro defines in > hdmi.h. Applied to mediatek-drm-next [1], thanks. [1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/= log/?h=3Dmediatek-drm-next Regards, Chun-Kuang > > 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/mediat= ek/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_hd= mi *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 =3D 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 =3D 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 =3D hdmi_audio_infoframe_init(&frame); > -- > 2.26.2 >