From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [Intel-gfx] [PATCH 04/12] video/hmdi: Clear the whole incoming buffer, not just the infoframe size Date: Wed, 7 Aug 2013 13:56:58 +0300 Message-ID: <20130807105658.GT5004@intel.com> References: <1375817544-14565-1-git-send-email-damien.lespiau@intel.com> <1375817544-14565-5-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <1375817544-14565-5-git-send-email-damien.lespiau@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Damien Lespiau Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, Aug 06, 2013 at 08:32:16PM +0100, Damien Lespiau wrote: > If the user if this API is providing a bigger buffer than the infoframe > size, it could be for a could reason. For instance it could be because > it gives the buffer that will be written to the hardware, up to the > maximum of an infoframe size. > = > Instead of just zeroing up to the infoframe size, let's zero the whole > incoming buffer as those extra bytes are also used to compute the > ECC and need to be 0. > = > Signed-off-by: Damien Lespiau One concern that came to mind was someone needing to preserve the buffer contents beyond the infoframe. But I guess if someone really needs to do that, they can go and figure out the exact length of the infoframe and pass that. Reviewed-by: Ville Syrj=E4l=E4 > --- > drivers/video/hdmi.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > = > diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c > index f7a85e5..635d569 100644 > --- a/drivers/video/hdmi.c > +++ b/drivers/video/hdmi.c > @@ -84,7 +84,7 @@ ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infofra= me *frame, void *buffer, > if (size < length) > return -ENOSPC; > = > - memset(buffer, 0, length); > + memset(buffer, 0, size); > = > ptr[0] =3D frame->type; > ptr[1] =3D frame->version; > @@ -186,7 +186,7 @@ ssize_t hdmi_spd_infoframe_pack(struct hdmi_spd_infof= rame *frame, void *buffer, > if (size < length) > return -ENOSPC; > = > - memset(buffer, 0, length); > + memset(buffer, 0, size); > = > ptr[0] =3D frame->type; > ptr[1] =3D frame->version; > @@ -251,7 +251,7 @@ ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_i= nfoframe *frame, > if (size < length) > return -ENOSPC; > = > - memset(buffer, 0, length); > + memset(buffer, 0, size); > = > if (frame->channels >=3D 2) > channels =3D frame->channels - 1; > @@ -308,7 +308,7 @@ ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor= _infoframe *frame, > if (size < length) > return -ENOSPC; > = > - memset(buffer, 0, length); > + memset(buffer, 0, size); > = > ptr[0] =3D frame->type; > ptr[1] =3D frame->version; > -- = > 1.8.3.1 > = > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- = Ville Syrj=E4l=E4 Intel OTC