Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: cros_ec_keyb - use BIT() macro instead of open-coding shifts

Using the macro clarifies the code.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260222003717.471977-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+4 -5
+4 -5
drivers/input/keyboard/cros_ec_keyb.c
··· 277 277 278 278 for (col = 0; col < ckdev->cols; col++) { 279 279 for (row = 0; row < ckdev->rows; row++) { 280 - new_state = kb_state[col] & (1 << row); 281 - old_state = ckdev->old_kb_state[col] & (1 << row); 280 + new_state = kb_state[col] & BIT(row); 281 + old_state = ckdev->old_kb_state[col] & BIT(row); 282 282 283 283 if (new_state == old_state) 284 284 continue; ··· 411 411 for (row = 0; row < ckdev->rows; row++) { 412 412 code = keymap[MATRIX_SCAN_CODE(row, col, row_shift)]; 413 413 if (code && (code != KEY_BATTERY)) 414 - ckdev->valid_keys[col] |= 1 << row; 414 + ckdev->valid_keys[col] |= BIT(row); 415 415 } 416 416 dev_dbg(ckdev->dev, "valid_keys[%02d] = 0x%02x\n", 417 417 col, ckdev->valid_keys[col]); ··· 780 780 idev->dev.parent = dev; 781 781 idev->setkeycode = cros_ec_keyb_setkeycode; 782 782 783 - ckdev->ghost_filter = device_property_read_bool(dev, 784 - "google,needs-ghost-filter"); 783 + ckdev->ghost_filter = device_property_read_bool(dev, "google,needs-ghost-filter"); 785 784 786 785 err = matrix_keypad_build_keymap(NULL, NULL, ckdev->rows * 2, ckdev->cols, 787 786 NULL, idev);