From patchwork Fri Jan 27 17:13:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 9542341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A82D0604AB for ; Fri, 27 Jan 2017 17:21:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BE3D27F85 for ; Fri, 27 Jan 2017 17:21:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90AA927FC0; Fri, 27 Jan 2017 17:21:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EA8527F85 for ; Fri, 27 Jan 2017 17:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933254AbdA0RQ5 (ORCPT ); Fri, 27 Jan 2017 12:16:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36120 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932902AbdA0RPl (ORCPT ); Fri, 27 Jan 2017 12:15:41 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 71B92C05AA55; Fri, 27 Jan 2017 17:13:26 +0000 (UTC) Received: from plouf.banquise.eu.com (ovpn-117-6.ams2.redhat.com [10.36.117.6]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0RHDMtX021227; Fri, 27 Jan 2017 12:13:24 -0500 From: Benjamin Tissoires To: Dmitry Torokhov , Greg Kroah-Hartman , Jiri Slaby , Samuel Thibault 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 Message-Id: <20170127171318.2596-2-benjamin.tissoires@redhat.com> In-Reply-To: <20170127171318.2596-1-benjamin.tissoires@redhat.com> References: <20170127171318.2596-1-benjamin.tissoires@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 27 Jan 2017 17:13:26 +0000 (UTC) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Better using the defined macros to express the bit masks. Signed-off-by: Benjamin Tissoires --- 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); }