ep->msg_buf_size,
DMA_FROM_DEVICE);
- for (i = 0; i < buf_size; i += 2)
+ for (i = 0; i < buf_size; i += 2) {
if (((buf[i+1] >> 28) & 0xf) != ep->msg_counter) {
malformed_message(ep, &buf[i]);
dev_warn(ep->dev,
return IRQ_HANDLED;
} else if (buf[i] & (1 << 22)) /* Last message */
break;
+ }
if (i >= buf_size) {
dev_err(ep->dev, "Bad interrupt message. Stopping.\n");
channel->endpoint->registers + fpga_buf_ctrl_reg);
mutex_unlock(&channel->endpoint->register_mutex);
- } else if (bufidx == 0)
+ } else if (bufidx == 0) {
bufidx = channel->num_rd_buffers - 1;
- else
+ } else {
bufidx--;
+ }
channel->rd_host_buf_pos = new_rd_host_buf_pos;
* nobody and use 32 bits DMA addressing in any case.
*/
- if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))
+ if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
endpoint->dma_using_dac = 0;
- else {
+ } else {
dev_err(endpoint->dev, "Failed to set DMA mask. Aborting.\n");
return -ENODEV;
}