aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2022-08-22 17:14:55 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-26 10:59:25 +0200
commitfd449bb9ac44fdc334907db7bcc20ade9a4037cd (patch)
tree2c92998018f3129d76f7ae7ae0fac8b2ef7205ce /drivers/media
parentmedia: flexcop-usb: clean up endpoint sanity checks (diff)
downloadwireguard-linux-fd449bb9ac44fdc334907db7bcc20ade9a4037cd.tar.xz
wireguard-linux-fd449bb9ac44fdc334907db7bcc20ade9a4037cd.zip
media: flexcop-usb: clean up URB initialisation
Clean up URB initialisation somewhat by introducing a temporary variable and separating declaration and non-trivial initialisation. Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20220822151456.27178-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/b2c2/flexcop-usb.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c
index 31dd37d8236c..7102b346db05 100644
--- a/drivers/media/usb/b2c2/flexcop-usb.c
+++ b/drivers/media/usb/b2c2/flexcop-usb.c
@@ -425,12 +425,14 @@ static void flexcop_usb_transfer_exit(struct flexcop_usb *fc_usb)
static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)
{
- u16 frame_size = le16_to_cpu(
- fc_usb->uintf->cur_altsetting->endpoint[0].desc.wMaxPacketSize);
- int bufsize = B2C2_USB_NUM_ISO_URB * B2C2_USB_FRAMES_PER_ISO *
- frame_size, i, j, ret;
+ struct usb_host_interface *alt = fc_usb->uintf->cur_altsetting;
+ u16 frame_size;
+ int bufsize, i, j, ret;
int buffer_offset = 0;
+ frame_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
+ bufsize = B2C2_USB_NUM_ISO_URB * B2C2_USB_FRAMES_PER_ISO * frame_size;
+
deb_ts("creating %d iso-urbs with %d frames each of %d bytes size = %d.\n",
B2C2_USB_NUM_ISO_URB,
B2C2_USB_FRAMES_PER_ISO, frame_size, bufsize);