OSDN Git Service

Fix gralloc_drm_handle_t size mismatch on 32 and 64 bit builds, take 2
authorRob Herring <robh@kernel.org>
Wed, 23 Mar 2016 20:48:39 +0000 (15:48 -0500)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 1 Apr 2016 05:55:38 +0000 (13:55 +0800)
On x86 there was still a size mismatch due to x86-32 structs not following
natural alignment for 64-bit values. Force the alignment of the union.
Also, there appeared to be some padding on the end, so move the union to
the end of the struct.

Signed-off-by: Rob Herring <robh@kernel.org>
gralloc_drm_handle.h

index ee96fbf..8e0ea95 100644 (file)
@@ -55,7 +55,7 @@ struct gralloc_drm_handle_t {
        union {
                struct gralloc_drm_bo_t *data; /* pointer to struct gralloc_drm_bo_t */
                int64_t __padding;
-       };
+       } __attribute__((aligned(8)));
 };
 
 #define GRALLOC_DRM_HANDLE_MAGIC 0x12345678