From patchwork Wed Jan 30 05:28:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [02/10] drm/edid: Add packed attribute to new gtf2 and cvt structs Date: Tue, 29 Jan 2013 19:28:23 -0000 From: Dave Chiluk X-Patchwork-Id: 216792 Message-Id: <1359523711-5875-3-git-send-email-chiluk@canonical.com> To: kernel-team@lists.ubuntu.com From: Takashi Iwai BugLink: http://bugs.launchpad.net/bugs/1109112 The new structs added in struct detailed_data_monitor_range must be marked with packed attribute although the outer struct itself is already marked as packed. Otherwise these 7-bytes structs may be aligned, and give the wrong position and size for the data. Signed-off-by: Takashi Iwai Acked-by: Adam Jackson Signed-off-by: Dave Airlie (cherry picked from commit 8353e6c632aeaea1470a286b83e68ca233073068) Signed-off-by: David Chiluk --- include/drm/drm_edid.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 8cefbbe..0cac551 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -99,7 +99,7 @@ struct detailed_data_monitor_range { __le16 m; u8 k; u8 j; /* need to divide by 2 */ - } gtf2; + } __attribute__((packed)) gtf2; struct { u8 version; u8 data1; /* high 6 bits: extra clock resolution */ @@ -108,7 +108,7 @@ struct detailed_data_monitor_range { u8 flags; /* preferred aspect and blanking support */ u8 supported_scalings; u8 preferred_refresh; - } cvt; + } __attribute__((packed)) cvt; } formula; } __attribute__((packed));