Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1829044ybj; Wed, 6 May 2020 06:12:13 -0700 (PDT) X-Google-Smtp-Source: APiQypKcWzNOVHoh+rEg2rDvduQWZZYCjBoryc1ZVf5Iv93le0eko6HYAzAV4zlFIMCrCvEJhBtJ X-Received: by 2002:a17:907:7246:: with SMTP id ds6mr6804071ejc.203.1588770733552; Wed, 06 May 2020 06:12:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588770733; cv=none; d=google.com; s=arc-20160816; b=ncmld4b0P/NfuKiYyGRvwsBDCVw+AknpB7dcwVIRQlia3YQnoJis3NOJgFQWQVNb3l Lo2g15/kfiBOZtFH47sBQo8bcNTQimQ/WL+MfFkyFVOem6nQmW/dsbJBXosJRdfQmwNx 53vA2PUDFZ3DKOBw7sw76qC47FWKoS3hGTAsZgeLQktN2UQUuZRFOrEFjko4KI2WyrNt pTr38b6o6/QLiZ1JxZh+I77X230mfLHGgl/o9RBltIb+xCdaMUoslpJsy0ixrhmUn1Vp QhK4GJ3vnIEpboQlWR/ZCm3nElUAN5hhpRpiWqtrJgkODRvL+XoV0SvOYhgQtVf8z/Aa qQVw== 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=Ki0M9yANJdNrqMXzTQSJ8xb4meocQKFyML+0bCbuSCo=; b=d4FwGaV1mmnxitIkQG0LVfIwq3DrITWCPUjWXh4uZBvLxd+JNQNwW0tNfkopVQvo/Q QxLL+p5MD4Vy0by12ZHioHhAyhwzxrZsmW/InyeztrTuOuAcmtjwwToxsg52sEPwMUpE qlI8bC3Nw/XuuleMwf2it/YITHaURQQdjPjL6ebc8unBa+3K0gdUgN0tN3nvLePtwCGm jR/XoXtG2MF+rwjxiOOsSNrP/asyjtKNxmAh/b7mjPWTnqt1rMdjfE2HoV55gHn9gQmI DElZbjr8eLWRpGZR6ws7uGTHiHnKqVJpbNYYkoTPabO2+zSmFWB+dvY8WV9Pt1aAAydJ +3gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nDhpwgGw; 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 a16si1120146ejt.100.2020.05.06.06.11.43; Wed, 06 May 2020 06:12:13 -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=nDhpwgGw; 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 S1728617AbgEFNGa (ORCPT + 99 others); Wed, 6 May 2020 09:06:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:48586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728248AbgEFNGa (ORCPT ); Wed, 6 May 2020 09:06:30 -0400 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 0962120757 for ; Wed, 6 May 2020 13:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588770389; bh=ATHyH8IAOOsseNmBMuvH1bf7K+ZrPk88T3wrysHsvGo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=nDhpwgGwrJRfIBy7r2ksIqvQKoAT+kJNfZnce9bdk2GF3cqQReLYpUCsgE+FSKx1t cHsExvLIyx91KR0wsLbxQxLj8iNOm5dYDDL1eIvQAoEj7cy3EWsuQcM9x3c7w6AkjZ BbBhm0kJjfiehpFPVj5HH6tjeIFPoIvbJ6QteoQk= Received: by mail-ej1-f46.google.com with SMTP id nv1so1279913ejb.0 for ; Wed, 06 May 2020 06:06:28 -0700 (PDT) X-Gm-Message-State: AGi0PuZT/ERuy1dr6oLwg9PVBt85SPAE6VPx4VQedhEpawMAQKjEvkdf mEbD7zu5LhmpXjhVYQHbeQF/Hxc0kHFOrcLSLA== X-Received: by 2002:a17:906:31d7:: with SMTP id f23mr7140816ejf.118.1588770387409; Wed, 06 May 2020 06:06:27 -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: Wed, 6 May 2020 21:06:16 +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. Reviewed-by: Chun-Kuang Hu > > 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 >