diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2018-03-20 14:04:47 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2018-03-23 17:44:57 +0300 |
commit | 1c6ef16d38091a1820e98df25900b5977e404bbd (patch) | |
tree | 099ab6e8199e5595e1665262ef66fb8296f062a6 /include/linux/hid.h | |
parent | 843e475f944a531210c71943efe09fca346a9a03 (diff) | |
download | linux-1c6ef16d38091a1820e98df25900b5977e404bbd.tar.xz |
HID: use BIT macro instead of plain integers for flags
This can lead to some hairy situation with the developer losing
a day or two realizing that 4 should be after 2, not 3.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
--
include/linux/hid.h | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r-- | include/linux/hid.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 091a81cf330f..d104f2ebc809 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -26,6 +26,7 @@ #define __HID_H +#include <linux/bitops.h> #include <linux/types.h> #include <linux/slab.h> #include <linux/list.h> @@ -494,13 +495,13 @@ struct hid_output_fifo { char *raw_report; }; -#define HID_CLAIMED_INPUT 1 -#define HID_CLAIMED_HIDDEV 2 -#define HID_CLAIMED_HIDRAW 4 -#define HID_CLAIMED_DRIVER 8 +#define HID_CLAIMED_INPUT BIT(0) +#define HID_CLAIMED_HIDDEV BIT(1) +#define HID_CLAIMED_HIDRAW BIT(2) +#define HID_CLAIMED_DRIVER BIT(3) -#define HID_STAT_ADDED 1 -#define HID_STAT_PARSED 2 +#define HID_STAT_ADDED BIT(0) +#define HID_STAT_PARSED BIT(1) struct hid_input { struct list_head list; |