vt: keyboard, make use of assign_bit() API
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 9 Nov 2020 10:56:01 +0000 (12:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Nov 2020 08:43:51 +0000 (09:43 +0100)
We have for some time the assign_bit() API to replace open coded

if (foo)
set_bit(n, bar);
else
clear_bit(n, bar);

Use this API in VT keyboard library code.

Acked-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20201109105601.47159-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/keyboard.c

index 8727915..52922d2 100644 (file)
@@ -1433,10 +1433,7 @@ static void kbd_keycode(unsigned int keycode, int down, bool hw_raw)
                raw_mode = true;
        }
 
-       if (down)
-               set_bit(keycode, key_down);
-       else
-               clear_bit(keycode, key_down);
+       assign_bit(keycode, key_down, down);
 
        if (rep &&
            (!vc_kbd_mode(kbd, VC_REPEAT) ||