From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756692AbeASW0a (ORCPT ); Fri, 19 Jan 2018 17:26:30 -0500 Received: from merlin.infradead.org ([205.233.59.134]:58780 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756567AbeASW0W (ORCPT ); Fri, 19 Jan 2018 17:26:22 -0500 Subject: Re: [PATCH 3/7] Input: libps2 - use BIT() for bitmask constants To: Dmitry Torokhov , Benjamin Tissoires , Hans de Goede , Lyude Paul Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180119194111.185590-1-dmitry.torokhov@gmail.com> <20180119194111.185590-4-dmitry.torokhov@gmail.com> From: Randy Dunlap Message-ID: <2d0591a7-ccab-872f-d52d-c8adf51d4373@infradead.org> Date: Fri, 19 Jan 2018 14:26:20 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20180119194111.185590-4-dmitry.torokhov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/19/2018 11:41 AM, Dmitry Torokhov wrote: > Let's explicitly document bit numbers with BIT() macro. > > Signed-off-by: Dmitry Torokhov Makes sense, but something should #include per Documentation/process/submit-checklist.rst Rule #1: 1) If you use a facility then #include the file that defines/declares that facility. Don't depend on other header files pulling in ones that you use. > --- > include/linux/libps2.h | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/include/linux/libps2.h b/include/linux/libps2.h > index 365c50b097ded..649295a5ff47d 100644 > --- a/include/linux/libps2.h > +++ b/include/linux/libps2.h > @@ -20,11 +20,11 @@ > #define PS2_RET_NAK 0xfe > #define PS2_RET_ERR 0xfc > > -#define PS2_FLAG_ACK 1 /* Waiting for ACK/NAK */ > -#define PS2_FLAG_CMD 2 /* Waiting for command to finish */ > -#define PS2_FLAG_CMD1 4 /* Waiting for the first byte of command response */ > -#define PS2_FLAG_WAITID 8 /* Command execiting is GET ID */ > -#define PS2_FLAG_NAK 16 /* Last transmission was NAKed */ > +#define PS2_FLAG_ACK BIT(0) /* Waiting for ACK/NAK */ > +#define PS2_FLAG_CMD BIT(1) /* Waiting for a command to finish */ > +#define PS2_FLAG_CMD1 BIT(2) /* Waiting for the first byte of command response */ > +#define PS2_FLAG_WAITID BIT(3) /* Command executing is GET ID */ > +#define PS2_FLAG_NAK BIT(4) /* Last transmission was NAKed */ > > struct ps2dev { > struct serio *serio; > -- ~Randy