]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Input: remove third argument of usb_maxpacket()
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Mon, 24 Nov 2025 19:20:45 +0000 (14:20 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Dec 2025 11:45:22 +0000 (12:45 +0100)
[ Upstream commit 948bf187694fc1f4c20cf972fa18b1a6fb3d7603 ]

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: Ville Syrjala <syrjala@sci.fi>
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Henk Vergonet <Henk.Vergonet@gmail.com>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/r/20220317035514.6378-4-mailhol.vincent@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 69aeb5073123 ("Input: pegasus-notetaker - fix potential out-of-bounds access")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/misc/ati_remote2.c
drivers/input/misc/cm109.c
drivers/input/misc/powermate.c
drivers/input/misc/yealink.c
drivers/input/tablet/acecad.c
drivers/input/tablet/pegasus_notetaker.c

index 8a36d78fed63adc01282c25f4d8d346673cc57e0..946bf75aa1061dcd551f89bcbb79cf11373f27d7 100644 (file)
@@ -639,7 +639,7 @@ static int ati_remote2_urb_init(struct ati_remote2 *ar2)
                        return -ENOMEM;
 
                pipe = usb_rcvintpipe(udev, ar2->ep[i]->bEndpointAddress);
-               maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
+               maxp = usb_maxpacket(udev, pipe);
                maxp = maxp > 4 ? 4 : maxp;
 
                usb_fill_int_urb(ar2->urb[i], udev, pipe, ar2->buf[i], maxp,
index c872ba579b03995200cced5d58625ef3fa7b7124..dba8b09ebda55adc1f1dfdc431d7636446c5d2de 100644 (file)
@@ -749,7 +749,7 @@ static int cm109_usb_probe(struct usb_interface *intf,
 
        /* get a handle to the interrupt data pipe */
        pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
-       ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
+       ret = usb_maxpacket(udev, pipe);
        if (ret != USB_PKT_LEN)
                dev_err(&intf->dev, "invalid payload size %d, expected %d\n",
                        ret, USB_PKT_LEN);
index 6b1b95d58e6b5a62926749a1034ed75afea933c0..db2ba89adaefa624f47e7ad7e24d366e411d6d36 100644 (file)
@@ -374,7 +374,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i
 
        /* get a handle to the interrupt data pipe */
        pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
-       maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
+       maxp = usb_maxpacket(udev, pipe);
 
        if (maxp < POWERMATE_PAYLOAD_SIZE_MIN || maxp > POWERMATE_PAYLOAD_SIZE_MAX) {
                printk(KERN_WARNING "powermate: Expected payload of %d--%d bytes, found %d bytes!\n",
index 8ab01c7601b1204960f541ed499cc7103726545f..69420781db300cc606e10656369cef217e8f3ec5 100644 (file)
@@ -905,7 +905,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
 
        /* get a handle to the interrupt data pipe */
        pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
-       ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
+       ret = usb_maxpacket(udev, pipe);
        if (ret != USB_PKT_LEN)
                dev_err(&intf->dev, "invalid payload size %d, expected %zd\n",
                        ret, USB_PKT_LEN);
index a38d1fe973340b2b3bbc4259655027a5d04eeec7..56c7e471ac32eda41815070d9fdfc4a5f3c78c6b 100644 (file)
@@ -130,7 +130,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
                return -ENODEV;
 
        pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
-       maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
+       maxp = usb_maxpacket(dev, pipe);
 
        acecad = kzalloc(sizeof(struct usb_acecad), GFP_KERNEL);
        input_dev = input_allocate_device();
index 38f087404f7af1c18614c507ffb105308f28743b..4e412a73a5aad285dc438fd510361b898c23bf6d 100644 (file)
@@ -296,7 +296,7 @@ static int pegasus_probe(struct usb_interface *intf,
        pegasus->intf = intf;
 
        pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
-       pegasus->data_len = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
+       pegasus->data_len = usb_maxpacket(dev, pipe);
 
        pegasus->data = usb_alloc_coherent(dev, pegasus->data_len, GFP_KERNEL,
                                           &pegasus->data_dma);