From: Randy Dunlap <rdunlap@infradead.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Hans de Goede <hdegoede@redhat.com>,
Lyude Paul <lyude@redhat.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/7] Input: libps2 - use BIT() for bitmask constants
Date: Fri, 19 Jan 2018 14:26:20 -0800 [thread overview]
Message-ID: <2d0591a7-ccab-872f-d52d-c8adf51d4373@infradead.org> (raw)
In-Reply-To: <20180119194111.185590-4-dmitry.torokhov@gmail.com>
On 01/19/2018 11:41 AM, Dmitry Torokhov wrote:
> Let's explicitly document bit numbers with BIT() macro.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Makes sense, but something should
#include <linux/bitops.h>
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
next prev parent reply other threads:[~2018-01-19 22:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 19:41 [PATCH 0/7] libps2 facelift Dmitry Torokhov
2018-01-19 19:41 ` [PATCH 1/7] Input: libps2 - fix switch statement formatting Dmitry Torokhov
2018-01-19 19:41 ` [PATCH 2/7] Input: libps2 - use u8 for byte data Dmitry Torokhov
2018-01-19 19:41 ` [PATCH 3/7] Input: libps2 - use BIT() for bitmask constants Dmitry Torokhov
2018-01-19 22:26 ` Randy Dunlap [this message]
2018-01-19 22:39 ` Dmitry Torokhov
2018-01-19 19:41 ` [PATCH 4/7] Input: psmouse - move sliced command implementation to libps2 Dmitry Torokhov
2018-01-19 19:41 ` [PATCH 5/7] Input: libps2 - add debugging statements Dmitry Torokhov
2018-01-21 20:22 ` ulrik.debie-os
2018-01-22 18:33 ` Dmitry Torokhov
2018-01-19 19:41 ` [PATCH 6/7] Input: libps2 - support retransmission of command data Dmitry Torokhov
2018-01-19 19:41 ` [PATCH 7/7] Input: libps2 - relax command byte ACK handling Dmitry Torokhov
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=2d0591a7-ccab-872f-d52d-c8adf51d4373@infradead.org \
--to=rdunlap@infradead.org \
--cc=benjamin.tissoires@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=hdegoede@redhat.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).