On Fri, May 27, 2022 at 06:04:14PM -0700, Linus Torvalds wrote:
On Fri, May 27, 2022 at 4:41 PM Sudip Mukherjee sudipm.mukherjee@gmail.com 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).
just tried this with make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- drivers/gpu/drm/drm_edid.s
That obviously generates code like
movl $128, %eax ret
and for me it looks like:
.L1030: .word .LC40 .word .LC41 .word -1431655765 .word .LC39 .size drm_edid_to_sad, .-drm_edid_to_sad .align 2 .global size_of_edid .syntax unified .arm .type size_of_edid, %function size_of_edid: @ args = 0, pretend = 0, frame = 0 @ frame_needed = 1, uses_anonymous_args = 0 mov ip, sp @, push {fp, ip, lr, pc} @ sub fp, ip, #4 @,, @ drivers/gpu/drm/drm_edid.c:1573: } mov r0, #144 @, ldmfd sp, {fp, sp, pc} @ .size size_of_edid, .-size_of_edid
-- Regards Sudip