Commit c5c1159
usb: deprecate the third argument of usb_maxpacket()
[ Upstream commit 0f08c2e7458e25c967d844170f8ad1aac3b57a02 ]
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: 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 7f3af94 commit c5c1159
1 file changed
Lines changed: 5 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1953 | 1953 | | |
1954 | 1954 | | |
1955 | 1955 | | |
1956 | | - | |
1957 | | - | |
1958 | | - | |
1959 | | - | |
| 1956 | + | |
| 1957 | + | |
1960 | 1958 | | |
1961 | 1959 | | |
1962 | 1960 | | |
1963 | 1961 | | |
1964 | | - | |
1965 | | - | |
| 1962 | + | |
1966 | 1963 | | |
1967 | | - | |
1968 | | - | |
| 1964 | + | |
1969 | 1965 | | |
1970 | | - | |
| 1966 | + | |
1971 | 1967 | | |
1972 | 1968 | | |
1973 | 1969 | | |
1974 | 1970 | | |
1975 | 1971 | | |
1976 | 1972 | | |
1977 | 1973 | | |
1978 | | - | |
1979 | | - | |
1980 | 1974 | | |
1981 | 1975 | | |
1982 | 1976 | | |
| |||
0 commit comments