From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>,
Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/4] tty/vt/keyboard: use defined macros for masks
Date: Fri, 27 Jan 2017 18:13:15 +0100 [thread overview]
Message-ID: <20170127171318.2596-2-benjamin.tissoires@redhat.com> (raw)
In-Reply-To: <20170127171318.2596-1-benjamin.tissoires@redhat.com>
Better using the defined macros to express the bit masks.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
drivers/tty/vt/keyboard.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
index 3dd6a49..4a3907e 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -1044,9 +1044,9 @@ static int kbd_update_leds_helper(struct input_handle *handle, void *data)
unsigned int leds = *(unsigned int *)data;
if (test_bit(EV_LED, handle->dev->evbit)) {
- input_inject_event(handle, EV_LED, LED_SCROLLL, !!(leds & 0x01));
- input_inject_event(handle, EV_LED, LED_NUML, !!(leds & 0x02));
- input_inject_event(handle, EV_LED, LED_CAPSL, !!(leds & 0x04));
+ input_inject_event(handle, EV_LED, LED_SCROLLL, !!(leds & BIT(VC_SCROLLOCK)));
+ input_inject_event(handle, EV_LED, LED_NUML, !!(leds & BIT(VC_NUMLOCK)));
+ input_inject_event(handle, EV_LED, LED_CAPSL, !!(leds & BIT(VC_CAPSLOCK)));
input_inject_event(handle, EV_SYN, SYN_REPORT, 0);
}
--
2.9.3
next prev parent reply other threads:[~2017-01-27 17:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-27 17:13 [PATCH 0/4] TTY: fix Caps Lock LED Benjamin Tissoires
2017-01-27 17:13 ` Benjamin Tissoires [this message]
2017-01-27 17:18 ` [PATCH 1/4] tty/vt/keyboard: use defined macros for masks Samuel Thibault
2017-01-27 17:13 ` [PATCH 2/4] tty/vt/keyboard: Fix Caps Lock LED on major distributions Benjamin Tissoires
2017-01-27 17:25 ` Samuel Thibault
2017-01-27 17:29 ` Dmitry Torokhov
2017-01-27 17:13 ` [PATCH 3/4] tty/vt/keyboard: reset the LEDs state at each console change Benjamin Tissoires
2017-01-27 17:31 ` Samuel Thibault
2017-01-27 18:18 ` Benjamin Tissoires
2017-01-27 17:13 ` [PATCH 4/4] Input: leds - force the LED status after .probe() Benjamin Tissoires
2017-01-27 17:34 ` Samuel Thibault
2017-01-27 18:19 ` Benjamin Tissoires
2017-01-27 17:23 ` [PATCH 0/4] TTY: fix Caps Lock LED Samuel Thibault
2017-01-27 18:34 ` Benjamin Tissoires
2017-01-27 18:47 ` Samuel Thibault
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=20170127171318.2596-2-benjamin.tissoires@redhat.com \
--to=benjamin.tissoires@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=samuel.thibault@ens-lyon.org \
/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).