Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753410AbdLHTaX (ORCPT ); Fri, 8 Dec 2017 14:30:23 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:45195 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752111AbdLHTaT (ORCPT ); Fri, 8 Dec 2017 14:30:19 -0500 X-Google-Smtp-Source: AGs4zMaOd4k1RWScIC3jvx1R2YDLMpeKoRvkI3GJ8yCoISWkGdLyHOLmHSIFtZqqeFywVzSRhjjMHQ== Date: Fri, 8 Dec 2017 11:30:15 -0800 From: Dmitry Torokhov To: Benjamin Tissoires Cc: Jiri Kosina , Peter Hutterer , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] HID: use BIT macro instead of plain integers for flags Message-ID: <20171208193015.mhkvpws66vmg37bc@dtor-ws> References: <20171208142818.15156-1-benjamin.tissoires@redhat.com> <20171208142818.15156-2-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171208142818.15156-2-benjamin.tissoires@redhat.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1267 Lines: 53 On Fri, Dec 08, 2017 at 03:28:17PM +0100, Benjamin Tissoires wrote: > 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 > --- Please add #include to make sure we have definition if BIT(), otherwise Reviewed-by: Dmitry Torokhov Thanks! > > 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 > -- Dmitry