dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Adam Jackson <ajax@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>, dri-devel@lists.sourceforge.net
Subject: [patch] drm_edid: There should be 6 Standard Timings
Date: Fri, 14 May 2010 13:06:19 +0200	[thread overview]
Message-ID: <20100514110618.GE5695@bicker> (raw)
In-Reply-To: <1273507704.25350.3405.camel@atropine.boston.devel.redhat.com>

Smatch complained that we initialize 6 elements in add_detailed_modes() 
but the timings[] array is declared with 5 elements.  Adam Jackson 
verified that 6 is the correct number of timings.

On Mon, May 10, 2010 at 12:08:24PM -0400, Adam Jackson wrote:
> > >                 struct std_timing timings[5];
> > >                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> This decl is wrong, should be 6.  From the 1.4 spec:
> 
> "Six additional Standard Timings may be listed as a display descriptor
> (tag #FAh)."
> 
> The 1.3 spec is a little less explicit about it, but does show 6
> standard timing codes in the 0xFA detailed subblock, terminated by 0x0A
> in the 18th byte.  I don't have the docs for 1.2 or earlier, but we're
> paranoid enough about not adding broken timings that we should be fine.

This patch is basically a clean up, because timings[] is declared inside
a union and increasing the number of elements here doesn't change the
overall size of the union.

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
This patch applies to drm-next.

diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index d33c3e0..39e2cc5 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -120,7 +120,7 @@ struct detailed_non_pixel {
 		struct detailed_data_string str;
 		struct detailed_data_monitor_range range;
 		struct detailed_data_wpindex color;
-		struct std_timing timings[5];
+		struct std_timing timings[6];
 		struct cvt_timing cvt[4];
 	} data;
 } __attribute__((packed));

------------------------------------------------------------------------------

--

  reply	other threads:[~2010-05-14 11:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-28 11:25 drm_edid: potential range checking issue? Dan Carpenter
2010-05-07  8:35 ` Dan Carpenter
2010-05-10 16:08   ` Adam Jackson
2010-05-14 11:06     ` Dan Carpenter [this message]
2010-05-18 14:30       ` [patch] drm_edid: There should be 6 Standard Timings Adam Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100514110618.GE5695@bicker \
    --to=error27@gmail.com \
    --cc=airlied@redhat.com \
    --cc=ajax@redhat.com \
    --cc=dri-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox