Skip to content

Commit

Permalink
HID: protect hid_device::bpf by CONFIG_HID_BPF
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Slaby (SUSE) authored and Jiri Kosina committed Feb 13, 2024
1 parent dcd5231 commit ed94a8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ed94a8f

Please sign in to comment.