Files
linux-stable-mirror/include/linux
Vincent MailholandGreg Kroah-Hartman 38c4f5dd91 usb: deprecate the third argument of usb_maxpacket()
[ Upstream commit 0f08c2e745 ]

This is a transitional patch with the ultimate goal of changing the
prototype of usb_maxpacket() from:
| static inline __u16
| usb_maxpacket(struct usb_device *udev, int pipe, int is_out)

into:
| static inline u16 usb_maxpacket(struct usb_device *udev, int pipe)

The third argument of usb_maxpacket(): is_out gets removed because it
can be derived from its second argument: pipe using
usb_pipeout(pipe). Furthermore, in the current version,
ubs_pipeout(pipe) is called regardless in order to sanitize the is_out
parameter.

In order to make a smooth change, we first deprecate the is_out
parameter by simply ignoring it (using a variadic function) and will
remove it later, once all the callers get updated.

The body of the function is reworked accordingly and is_out is
replaced by usb_pipeout(pipe). The WARN_ON() calls become unnecessary
and get removed.

Finally, the return type is changed from __u16 to u16 because this is
not a UAPI function.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/r/20220317035514.6378-2-mailhol.vincent@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 69aeb50731 ("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>
2025-12-07 06:08:21 +09:00
..
2025-06-27 11:04:09 +01:00
2024-07-05 09:12:55 +02:00
2025-09-11 17:16:06 +02:00
2023-12-20 15:44:30 +01:00
2024-06-21 14:53:19 +02:00
2024-06-21 14:53:46 +02:00
2025-12-07 06:08:09 +09:00
2024-10-17 15:07:44 +02:00
2025-10-29 14:01:18 +01:00
2023-10-25 11:54:20 +02:00
2025-07-17 18:27:44 +02:00
2024-06-21 14:53:28 +02:00
2025-10-29 14:01:21 +01:00
2024-04-13 12:58:31 +02:00
2024-01-25 14:37:40 -08:00
2025-06-04 14:37:08 +02:00
2025-08-28 16:22:31 +02:00
2025-04-10 14:30:53 +02:00
2023-11-28 16:54:53 +00:00
2023-10-25 11:54:13 +02:00
2023-10-25 11:54:13 +02:00
2025-02-01 18:22:32 +01:00
2025-06-27 11:04:09 +01:00
2024-07-05 09:12:55 +02:00
2025-06-04 14:37:09 +02:00
2024-02-23 08:41:51 +01:00
2024-10-17 15:07:57 +02:00
2025-08-28 16:22:37 +02:00