On Fri, May 27, 2022 at 4:41 PM Sudip Mukherjee <sudipm.mukherjee@xxxxxxxxx> wrote: > > I just tested with various values, sizeof(*edid) is 144 bytes at that place. Hmm. What compiler do you have? Because it seems very broken. You don't actually have to try with various sizes, you could have just done something like int size_of_edid(const struct edid *edid) { return sizeof(*edid); } and then "make drivers/gpu/drm/drm_edid.s" to generate assembly and see what it looks like (obviously removing the BUG_ON() in order to build). That obviously generates code like movl $128, %eax ret for me, and looking at the definition of that type I really can't see how it would ever generate anything else. But it's apparently not even close for you. I suspect some of the structs inside of that 'struct edid' end up getting aligned, despite the '__attribute__((packed))'. For example, 'struct est_timings' is supposed to be just 3 bytes, and it's at an odd offset too (byte offset 35 in the 'struct edid' if I did the math correctly). But it obviously doesn't happen for me or for most other people, so it's something in your setup. Unusual compiler? Linus