video/hdmi: Reorder fields in 'struct hdmi_avi_infoframe'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 18 Jun 2023 20:52:28 +0000 (22:52 +0200)
committerHelge Deller <deller@gmx.de>
Mon, 19 Jun 2023 07:02:51 +0000 (09:02 +0200)
Group some variables based on their sizes to reduce hole and avoid padding.
On x86_64, this shrinks the size of 'struct hdmi_avi_infoframe'
from 68 to 60 bytes.

It saves a few bytes of memory and is more cache-line friendly.

This also reduces the union hdmi_infoframe the same way.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Helge Deller <deller@gmx.de>
include/linux/hdmi.h

index 2f4dcc8..3bb87bf 100644 (file)
@@ -170,19 +170,19 @@ struct hdmi_avi_infoframe {
        enum hdmi_infoframe_type type;
        unsigned char version;
        unsigned char length;
+       bool itc;
+       unsigned char pixel_repeat;
        enum hdmi_colorspace colorspace;
        enum hdmi_scan_mode scan_mode;
        enum hdmi_colorimetry colorimetry;
        enum hdmi_picture_aspect picture_aspect;
        enum hdmi_active_aspect active_aspect;
-       bool itc;
        enum hdmi_extended_colorimetry extended_colorimetry;
        enum hdmi_quantization_range quantization_range;
        enum hdmi_nups nups;
        unsigned char video_code;
        enum hdmi_ycc_quantization_range ycc_quantization_range;
        enum hdmi_content_type content_type;
-       unsigned char pixel_repeat;
        unsigned short top_bar;
        unsigned short bottom_bar;
        unsigned short left_bar;