Skip to content

Commit 5bd2717

Browse files
vincent-mailholUlrich Hecht
authored andcommitted
Input: remove third argument of usb_maxpacket()
[ 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> Signed-off-by: Ulrich Hecht <uli@kernel.org>
1 parent c5c1159 commit 5bd2717

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/input/misc/ati_remote2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ static int ati_remote2_urb_init(struct ati_remote2 *ar2)
642642
return -ENOMEM;
643643

644644
pipe = usb_rcvintpipe(udev, ar2->ep[i]->bEndpointAddress);
645-
maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
645+
maxp = usb_maxpacket(udev, pipe);
646646
maxp = maxp > 4 ? 4 : maxp;
647647

648648
usb_fill_int_urb(ar2->urb[i], udev, pipe, ar2->buf[i], maxp,

drivers/input/misc/cm109.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ static int cm109_usb_probe(struct usb_interface *intf,
752752

753753
/* get a handle to the interrupt data pipe */
754754
pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
755-
ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
755+
ret = usb_maxpacket(udev, pipe);
756756
if (ret != USB_PKT_LEN)
757757
dev_err(&intf->dev, "invalid payload size %d, expected %d\n",
758758
ret, USB_PKT_LEN);

drivers/input/misc/powermate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i
373373

374374
/* get a handle to the interrupt data pipe */
375375
pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
376-
maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
376+
maxp = usb_maxpacket(udev, pipe);
377377

378378
if (maxp < POWERMATE_PAYLOAD_SIZE_MIN || maxp > POWERMATE_PAYLOAD_SIZE_MAX) {
379379
printk(KERN_WARNING "powermate: Expected payload of %d--%d bytes, found %d bytes!\n",

drivers/input/misc/yealink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
918918

919919
/* get a handle to the interrupt data pipe */
920920
pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
921-
ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
921+
ret = usb_maxpacket(udev, pipe);
922922
if (ret != USB_PKT_LEN)
923923
dev_err(&intf->dev, "invalid payload size %d, expected %zd\n",
924924
ret, USB_PKT_LEN);

drivers/input/tablet/acecad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
143143
return -ENODEV;
144144

145145
pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
146-
maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
146+
maxp = usb_maxpacket(dev, pipe);
147147

148148
acecad = kzalloc(sizeof(struct usb_acecad), GFP_KERNEL);
149149
input_dev = input_allocate_device();

drivers/input/tablet/pegasus_notetaker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static int pegasus_probe(struct usb_interface *intf,
295295
pegasus->intf = intf;
296296

297297
pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
298-
pegasus->data_len = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
298+
pegasus->data_len = usb_maxpacket(dev, pipe);
299299

300300
pegasus->data = usb_alloc_coherent(dev, pegasus->data_len, GFP_KERNEL,
301301
&pegasus->data_dma);

0 commit comments

Comments
 (0)