HID: Reorder fields in 'struct hid_input'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 18 Jun 2023 09:11:58 +0000 (11:11 +0200)
committerJiri Kosina <jkosina@suse.cz>
Mon, 14 Aug 2023 09:21:22 +0000 (11:21 +0200)
Group some variables based on their sizes to reduce hole and avoid padding.
On x86_64, this shrinks the size of 'struct hid_input'
from 72 to 64 bytes.

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

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
include/linux/hid.h

index 9e8f878..be9e16c 100644 (file)
@@ -556,9 +556,9 @@ struct hid_input {
        struct hid_report *report;
        struct input_dev *input;
        const char *name;
-       bool registered;
        struct list_head reports;       /* the list of reports */
        unsigned int application;       /* application usage for this input */
+       bool registered;
 };
 
 enum hid_type {