Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: rework usb_maxpacket() using usb_pipe_endpoint()

Rework the body of usb_maxpacket() and just rely on the
usb_pipe_endpoint() helper function to retrieve the host endpoint
instead of doing it by hand.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/r/20220317035514.6378-10-mailhol.vincent@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Vincent Mailhol and committed by
Greg Kroah-Hartman
bdddc253 2ddf7617

+1 -7
+1 -7
include/linux/usb.h
··· 1971 1971 1972 1972 static inline u16 usb_maxpacket(struct usb_device *udev, int pipe) 1973 1973 { 1974 - struct usb_host_endpoint *ep; 1975 - unsigned epnum = usb_pipeendpoint(pipe); 1976 - 1977 - if (usb_pipeout(pipe)) 1978 - ep = udev->ep_out[epnum]; 1979 - else 1980 - ep = udev->ep_in[epnum]; 1974 + struct usb_host_endpoint *ep = usb_pipe_endpoint(udev, pipe); 1981 1975 1982 1976 if (!ep) 1983 1977 return 0;