Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754058AbdLHO2k (ORCPT ); Fri, 8 Dec 2017 09:28:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51010 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753419AbdLHO2f (ORCPT ); Fri, 8 Dec 2017 09:28:35 -0500 From: Benjamin Tissoires To: Jiri Kosina , Dmitry Torokhov , Peter Hutterer Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH v2 1/2] HID: use BIT macro instead of plain integers for flags Date: Fri, 8 Dec 2017 15:28:17 +0100 Message-Id: <20171208142818.15156-2-benjamin.tissoires@redhat.com> In-Reply-To: <20171208142818.15156-1-benjamin.tissoires@redhat.com> References: <20171208142818.15156-1-benjamin.tissoires@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 08 Dec 2017 14:28:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 950 Lines: 37 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 --- 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