Commit fd449bb9 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

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: default avatarJohan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20220822151456.27178-3-johan@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3de50478
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -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)
static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)
{
{
	u16 frame_size = le16_to_cpu(
	struct usb_host_interface *alt = fc_usb->uintf->cur_altsetting;
		fc_usb->uintf->cur_altsetting->endpoint[0].desc.wMaxPacketSize);
	u16 frame_size;
	int bufsize = B2C2_USB_NUM_ISO_URB * B2C2_USB_FRAMES_PER_ISO *
	int bufsize, i, j, ret;
		frame_size, i, j, ret;
	int buffer_offset = 0;
	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",
	deb_ts("creating %d iso-urbs with %d frames each of %d bytes size = %d.\n",
	       B2C2_USB_NUM_ISO_URB,
	       B2C2_USB_NUM_ISO_URB,
			B2C2_USB_FRAMES_PER_ISO, frame_size, bufsize);
			B2C2_USB_FRAMES_PER_ISO, frame_size, bufsize);