Commit 91d42194 authored by Vincent Bernat's avatar Vincent Bernat Committed by Greg Kroah-Hartman

staging: xillybus: fix some coding style errors

This includes:
 - keep "else" on the same line as the closing brace
 - don't use "else" after "return"
 - don't issue a message for an out-of-memory error
 - blank line after a declaration
Signed-off-by: default avatarVincent Bernat <vincent@bernat.im>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4168ac9d
...@@ -138,7 +138,6 @@ irqreturn_t xillybus_isr(int irq, void *data) ...@@ -138,7 +138,6 @@ irqreturn_t xillybus_isr(int irq, void *data)
* guaranteed no interrupt will occur, but in theory, the cache * guaranteed no interrupt will occur, but in theory, the cache
* lines may not be updated. So a memory barrier is issued. * lines may not be updated. So a memory barrier is issued.
*/ */
smp_rmb(); smp_rmb();
buf = ep->msgbuf_addr; buf = ep->msgbuf_addr;
...@@ -546,8 +545,7 @@ static int xilly_setupchannels(struct xilly_endpoint *ep, ...@@ -546,8 +545,7 @@ static int xilly_setupchannels(struct xilly_endpoint *ep,
channel->rd_buffers = buffers; channel->rd_buffers = buffers;
rc = xilly_get_dma_buffers(ep, &rd_alloc, buffers, rc = xilly_get_dma_buffers(ep, &rd_alloc, buffers,
bufnum, bytebufsize); bufnum, bytebufsize);
} } else if (channelnum > 0) {
else if (channelnum > 0) {
channel->num_wr_buffers = bufnum; channel->num_wr_buffers = bufnum;
channel->seekable = seekable; channel->seekable = seekable;
...@@ -610,7 +608,7 @@ static void xilly_scan_idt(struct xilly_endpoint *endpoint, ...@@ -610,7 +608,7 @@ static void xilly_scan_idt(struct xilly_endpoint *endpoint,
"IDT device name list overflow. Aborting.\n"); "IDT device name list overflow. Aborting.\n");
idt_handle->chandesc = NULL; idt_handle->chandesc = NULL;
return; return;
} else }
idt_handle->chandesc = scan; idt_handle->chandesc = scan;
len = endpoint->idtlen - (3 + ((int) (scan - idt))); len = endpoint->idtlen - (3 + ((int) (scan - idt)));
...@@ -722,6 +720,7 @@ static ssize_t xillybus_read(struct file *filp, char __user *userbuf, ...@@ -722,6 +720,7 @@ static ssize_t xillybus_read(struct file *filp, char __user *userbuf,
while (1) { /* Note that we may drop mutex within this loop */ while (1) { /* Note that we may drop mutex within this loop */
int bytes_to_do = count - bytes_done; int bytes_to_do = count - bytes_done;
spin_lock_irqsave(&channel->wr_spinlock, flags); spin_lock_irqsave(&channel->wr_spinlock, flags);
empty = channel->wr_empty; empty = channel->wr_empty;
...@@ -1963,10 +1962,8 @@ struct xilly_endpoint *xillybus_init_endpoint(struct pci_dev *pdev, ...@@ -1963,10 +1962,8 @@ struct xilly_endpoint *xillybus_init_endpoint(struct pci_dev *pdev,
struct xilly_endpoint *endpoint; struct xilly_endpoint *endpoint;
endpoint = devm_kzalloc(dev, sizeof(*endpoint), GFP_KERNEL); endpoint = devm_kzalloc(dev, sizeof(*endpoint), GFP_KERNEL);
if (!endpoint) { if (!endpoint)
dev_err(dev, "Failed to allocate memory. Aborting.\n");
return NULL; return NULL;
}
endpoint->pdev = pdev; endpoint->pdev = pdev;
endpoint->dev = dev; endpoint->dev = dev;
......
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