Commit 857af455 authored by Marek Belisko's avatar Marek Belisko Committed by Greg Kroah-Hartman

staging: ft1000: Fix coding style in write_blk_fifo() function.

Signed-off-by: default avatarMarek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d7a7318b
...@@ -644,44 +644,42 @@ static void usb_dnld_complete (struct urb *urb) ...@@ -644,44 +644,42 @@ static void usb_dnld_complete (struct urb *urb)
// Notes: // Notes:
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
static u32 write_blk_fifo (struct ft1000_device *ft1000dev, u16 **pUsFile, u8 **pUcFile, long word_length) static u32 write_blk_fifo(struct ft1000_device *ft1000dev, u16 **pUsFile,
u8 **pUcFile, long word_length)
{ {
u32 Status = STATUS_SUCCESS; u32 Status = STATUS_SUCCESS;
int byte_length; int byte_length;
long aligncnt; long aligncnt;
byte_length = word_length * 4;
if (byte_length % 4) byte_length = word_length * 4;
aligncnt = 4 - (byte_length % 4);
else
aligncnt = 0;
byte_length += aligncnt;
if (byte_length && ((byte_length % 64) == 0)) { if (byte_length % 4)
byte_length += 4; aligncnt = 4 - (byte_length % 4);
} else
aligncnt = 0;
byte_length += aligncnt;
if (byte_length < 64) if (byte_length && ((byte_length % 64) == 0))
byte_length = 68; byte_length += 4;
if (byte_length < 64)
byte_length = 68;
usb_init_urb(ft1000dev->tx_urb); usb_init_urb(ft1000dev->tx_urb);
memcpy (ft1000dev->tx_buf, *pUcFile, byte_length); memcpy(ft1000dev->tx_buf, *pUcFile, byte_length);
usb_fill_bulk_urb(ft1000dev->tx_urb, usb_fill_bulk_urb(ft1000dev->tx_urb,
ft1000dev->dev, ft1000dev->dev,
usb_sndbulkpipe(ft1000dev->dev, ft1000dev->bulk_out_endpointAddr), usb_sndbulkpipe(ft1000dev->dev,
ft1000dev->tx_buf, ft1000dev->bulk_out_endpointAddr),
byte_length, ft1000dev->tx_buf, byte_length, usb_dnld_complete,
usb_dnld_complete, (void *)ft1000dev);
(void*)ft1000dev);
usb_submit_urb(ft1000dev->tx_urb, GFP_ATOMIC); usb_submit_urb(ft1000dev->tx_urb, GFP_ATOMIC);
*pUsFile = *pUsFile + (word_length << 1); *pUsFile = *pUsFile + (word_length << 1);
*pUcFile = *pUcFile + (word_length << 2); *pUcFile = *pUcFile + (word_length << 2);
return Status; return Status;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment