HID: protect hid_device::bpf by CONFIG_HID_BPF
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Thu, 1 Feb 2024 11:53:16 +0000 (12:53 +0100)
committerJiri Kosina <jkosina@suse.com>
Tue, 13 Feb 2024 10:43:55 +0000 (11:43 +0100)
And not by CONFIG_BPF. BPF can be selected while HID_BPF does not have
to. It actually cannot be on some platforms due to Kconfig dependences.

This saves quite some bytes on those setups.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
include/linux/hid.h

index 7c26db874ff0323c2cfc91785ae1c45ec567440f..b12cb1c8e68214a13da61064c2857a02e4055b1d 100644 (file)
@@ -683,9 +683,9 @@ struct hid_device {                                                 /* device report descriptor */
 
        unsigned int id;                                                /* system unique id */
 
-#ifdef CONFIG_BPF
+#ifdef CONFIG_HID_BPF
        struct hid_bpf bpf;                                             /* hid-bpf data */
-#endif /* CONFIG_BPF */
+#endif /* CONFIG_HID_BPF */
 };
 
 void hiddev_free(struct kref *ref);