The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Jiri Kosina <jikos@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Peter Hutterer <peter.hutterer@who-t.net>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>
Subject: [PATCH v2 1/2] HID: use BIT macro instead of plain integers for flags
Date: Fri,  8 Dec 2017 15:28:17 +0100	[thread overview]
Message-ID: <20171208142818.15156-2-benjamin.tissoires@redhat.com> (raw)
In-Reply-To: <20171208142818.15156-1-benjamin.tissoires@redhat.com>

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>
---

new in v2

 include/linux/hid.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/hid.h b/include/linux/hid.h
index a62ee4a609ac..421b62b77c69 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -494,13 +494,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;
-- 
2.14.3

  reply	other threads:[~2017-12-08 14:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-08 14:28 [PATCH v2 0/2] HID: input: do not increment usages when a duplicate is found Benjamin Tissoires
2017-12-08 14:28 ` Benjamin Tissoires [this message]
2017-12-08 19:30   ` [PATCH v2 1/2] HID: use BIT macro instead of plain integers for flags Dmitry Torokhov
2017-12-08 14:28 ` [PATCH v2 2/2] HID: input: do not increment usages when a duplicate is found Benjamin Tissoires
2017-12-08 19:32   ` Dmitry Torokhov
2017-12-10 22:29   ` Peter Hutterer
2018-04-16 23:51     ` Dmitry Torokhov
2018-04-17 12:11       ` Jiri Kosina
2018-04-17 12:56         ` Benjamin Tissoires
2018-04-17 13:18           ` Benjamin Tissoires
2018-04-17 13:18             ` [PATCH 1/2] HID: generic: create one input report per application type Benjamin Tissoires
2018-04-17 13:18             ` [PATCH 2/2] HID: input: append a suffix matching the application Benjamin Tissoires

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171208142818.15156-2-benjamin.tissoires@redhat.com \
    --to=benjamin.tissoires@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.hutterer@who-t.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox