lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 1 Apr 2022 13:57:26 +0200
From:   Florian Klink <flokli@...kli.de>
To:     Benjamin Tissoires <benjamin.tissoires@...hat.com>
Cc:     Jiri Kosina <jikos@...nel.org>,
        "open list:HID CORE LAYER" <linux-input@...r.kernel.org>,
        lkml <linux-kernel@...r.kernel.org>,
        ValdikSS <iam@...dikss.org.ru>
Subject: Re: [PATCH v4 1/3] HID: lenovo: Add support for ThinkPad TrackPoint
 Keyboard II

>On 22-04-01 12:30:47, Benjamin Tissoires wrote:
>>Thanks for the work Florian, and sorry for the delay.
>>
>>One comment below:
>>> @@ -977,11 +1114,14 @@ static int lenovo_probe_cptkbd(struct hid_device *hdev)
>>>
>>>         /*
>>>          * Tell the keyboard a driver understands it, and turn F7, F9, F11 into
>>> -        * regular keys
>>> +        * regular keys (Compact only)
>>>          */
>>> -       ret = lenovo_send_cmd_cptkbd(hdev, 0x01, 0x03);
>>> -       if (ret)
>>> -               hid_warn(hdev, "Failed to switch F7/9/11 mode: %d\n", ret);
>>> +       if (hdev->product == USB_DEVICE_ID_LENOVO_CUSBKBD ||
>>> +           hdev->product == USB_DEVICE_ID_LENOVO_CBTKBD) {
>>
>>Is there a chance that other PIDs included in the files are needing that call?
>>I'm just worried about regressions here.
>>
>>Beside that question, the series is:
>>Reviewed-by: Benjamin Tissoires <benjamin.tissoires@...hat.com>

`lenovo_probe_cptkbd` was introduced in

f3d4ff0e04cc4450bdc7a4140020913b1280d205
HID: lenovo: Add support for Compact (BT|USB) keyboard)

Back then, it was only called for these two "Compact (BT|USB) keyboard)"
devices (see switch case in `lenovo_probe`).

The new code now calls `lenovo_probe_cptkbd` also for
`USB_DEVICE_ID_LENOVO_TPII{BT,USB}KBD`:

> 	case USB_DEVICE_ID_LENOVO_CUSBKBD:
> 	case USB_DEVICE_ID_LENOVO_CBTKBD:
> 	case USB_DEVICE_ID_LENOVO_TPIIUSBKBD:
> 	case USB_DEVICE_ID_LENOVO_TPIIBTKBD:
> 		ret = lenovo_probe_cptkbd(hdev);

… and the F7/9/11 thing is only done for the compact variants.

Other keyboards still use other `lenovo_probe_tpkbd` and
`lenovo_probe_tp10ubkbd` functions.

I agree the `lenovo_probe_*` names became a bit less self-explaining
over time, but the switch case in `lenovo_probe` itself should be pretty
authoritative about which hardware causes which function to be called.

Regards,
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ