]> git.baikalelectronics.ru Git - kernel.git/commitdiff
HID: usbhid: remove third argument of usb_maxpacket()
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Thu, 17 Mar 2022 03:55:07 +0000 (12:55 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Apr 2022 08:33:53 +0000 (10:33 +0200)
The third argument of usb_maxpacket(): in_out has been deprecated
because it could be derived from the second argument (e.g. using
usb_pipeout(pipe)).

N.B. function usb_maxpacket() was made variadic to accommodate the
transition from the old prototype with three arguments to the new one
with only two arguments (so that no renaming is needed). The variadic
argument is to be removed once all users of usb_maxpacket() get
migrated.

CC: Jiri Kosina <jikos@kernel.org>
CC: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/r/20220317035514.6378-3-mailhol.vincent@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/usbhid/hid-core.c
drivers/hid/usbhid/usbkbd.c
drivers/hid/usbhid/usbmouse.c

index 54752c85604b153ddf27dd524af0e3727edca1fa..4490e2f7252ac7c55023c2d11a0384e5924e0128 100644 (file)
@@ -387,7 +387,7 @@ static int hid_submit_ctrl(struct hid_device *hid)
 
                usbhid->urbctrl->pipe = usb_rcvctrlpipe(hid_to_usb_dev(hid), 0);
                maxpacket = usb_maxpacket(hid_to_usb_dev(hid),
-                                         usbhid->urbctrl->pipe, 0);
+                                         usbhid->urbctrl->pipe);
                len += (len == 0);      /* Don't allow 0-length reports */
                len = round_up(len, maxpacket);
                if (len > usbhid->bufsize)
index df02002066cef4860f977cb61d2e16b3e6cb39c8..b4b007c4beb6eb381262b24d8554f6e59decd108 100644 (file)
@@ -279,7 +279,7 @@ static int usb_kbd_probe(struct usb_interface *iface,
                return -ENODEV;
 
        pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
-       maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
+       maxp = usb_maxpacket(dev, pipe);
 
        kbd = kzalloc(sizeof(struct usb_kbd), GFP_KERNEL);
        input_dev = input_allocate_device();
index c89332017d5d4f128e517f01fa9805e2b700b242..fb1d7d1f6999465babfb2227663af968209d1a90 100644 (file)
@@ -123,7 +123,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
                return -ENODEV;
 
        pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
-       maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
+       maxp = usb_maxpacket(dev, pipe);
 
        mouse = kzalloc(sizeof(struct usb_mouse), GFP_KERNEL);
        input_dev = input_allocate_device();