Commit c9b8015b authored by Erik Andrén's avatar Erik Andrén Committed by Greg Kroah-Hartman

Staging: altpciechdma: checkpatch fixups

Signed-off-by: default avatarErik Andrén <erik.andren@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2c77cb3e
...@@ -320,7 +320,8 @@ static int __devinit map_bars(struct ape_dev *ape, struct pci_dev *dev) ...@@ -320,7 +320,8 @@ static int __devinit map_bars(struct ape_dev *ape, struct pci_dev *dev)
/* BAR length is less than driver requires? */ /* BAR length is less than driver requires? */
if (bar_length < bar_min_len[i]) { if (bar_length < bar_min_len[i]) {
printk(KERN_DEBUG "BAR #%d length = %lu bytes but driver " printk(KERN_DEBUG "BAR #%d length = %lu bytes but driver "
"requires at least %lu bytes\n", i, bar_length, bar_min_len[i]); "requires at least %lu bytes\n",
i, bar_length, bar_min_len[i]);
rc = -1; rc = -1;
goto fail; goto fail;
} }
...@@ -466,15 +467,14 @@ static inline int compare(u32 *p, u32 *q, int len) ...@@ -466,15 +467,14 @@ static inline int compare(u32 *p, u32 *q, int len)
} else { } else {
fail++; fail++;
/* show the first few miscompares */ /* show the first few miscompares */
if (fail < 10) { if (fail < 10)
printk(KERN_DEBUG "[%p] = 0x%08x != [%p] = 0x%08x ?!\n", p, *p, q, *q); printk(KERN_DEBUG "[%p] = 0x%08x != [%p] = 0x%08x ?!\n", p, *p, q, *q);
/* but stop after a while */ /* but stop after a while */
} else if (fail == 10) { else if (fail == 10)
printk(KERN_DEBUG "---more errors follow! not printed---\n"); printk(KERN_DEBUG "---more errors follow! not printed---\n");
} else { else
/* stop compare after this many errors */ /* stop compare after this many errors */
break; break;
}
} }
p++; p++;
q++; q++;
...@@ -564,9 +564,8 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev) ...@@ -564,9 +564,8 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev)
/* read 8192 bytes from RC buffer to EP address 4096 */ /* read 8192 bytes from RC buffer to EP address 4096 */
ape_chdma_desc_set(&ape->table_virt->desc[n], buffer_bus, 4096, 2 * PAGE_SIZE); ape_chdma_desc_set(&ape->table_virt->desc[n], buffer_bus, 4096, 2 * PAGE_SIZE);
#if 1 #if 1
for (i = 0; i < 255; i++) { for (i = 0; i < 255; i++)
ape_chdma_desc_set(&ape->table_virt->desc[i], buffer_bus, 4096, 2 * PAGE_SIZE); ape_chdma_desc_set(&ape->table_virt->desc[i], buffer_bus, 4096, 2 * PAGE_SIZE);
}
/* index of last descriptor */ /* index of last descriptor */
n = i - 1; n = i - 1;
#endif #endif
...@@ -660,9 +659,9 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev) ...@@ -660,9 +659,9 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev)
n = 0; n = 0;
ape_chdma_desc_set(&ape->table_virt->desc[n], buffer_bus + 8192, 4096, 2 * PAGE_SIZE); ape_chdma_desc_set(&ape->table_virt->desc[n], buffer_bus + 8192, 4096, 2 * PAGE_SIZE);
#if 1 #if 1
for (i = 0; i < 255; i++) { for (i = 0; i < 255; i++)
ape_chdma_desc_set(&ape->table_virt->desc[i], buffer_bus + 8192, 4096, 2 * PAGE_SIZE); ape_chdma_desc_set(&ape->table_virt->desc[i], buffer_bus + 8192, 4096, 2 * PAGE_SIZE);
}
/* index of last descriptor */ /* index of last descriptor */
n = i - 1; n = i - 1;
#endif #endif
...@@ -690,7 +689,7 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev) ...@@ -690,7 +689,7 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev)
w = (u32)(n + 1); w = (u32)(n + 1);
/* enable updates of eplast for each descriptor completion */ /* enable updates of eplast for each descriptor completion */
w |= (u32)(1UL << 18)/*global EPLAST_EN*/; w |= (u32)(1UL << 18)/*global EPLAST_EN*/;
#if 0 // test variable, make a module option later #if 0 /* test variable, make a module option later */
/* enable MSI for each descriptor completion */ /* enable MSI for each descriptor completion */
if (ape->msi_enabled) if (ape->msi_enabled)
w |= (1UL << 17)/*global MSI*/; w |= (1UL << 17)/*global MSI*/;
...@@ -714,7 +713,7 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev) ...@@ -714,7 +713,7 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev)
/** memory write barrier */ /** memory write barrier */
wmb(); wmb();
/** dummy read to flush posted writes */ /** dummy read to flush posted writes */
//(void)ioread32(); /* (void) ioread32(); */
printk(KERN_DEBUG "POLL FOR WRITE:\n"); printk(KERN_DEBUG "POLL FOR WRITE:\n");
/* poll for completion, 1000 times 1 millisecond */ /* poll for completion, 1000 times 1 millisecond */
...@@ -843,7 +842,7 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -843,7 +842,7 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id)
} }
ape->got_regions = 1; ape->got_regions = 1;
#if 1 // @todo For now, disable 64-bit, because I do not understand the implications (DAC!) #if 1 /* @todo For now, disable 64-bit, because I do not understand the implications (DAC!) */
/* query for DMA transfer */ /* query for DMA transfer */
/* @see Documentation/PCI/PCI-DMA-mapping.txt */ /* @see Documentation/PCI/PCI-DMA-mapping.txt */
if (!pci_set_dma_mask(dev, DMA_64BIT_MASK)) { if (!pci_set_dma_mask(dev, DMA_64BIT_MASK)) {
...@@ -1048,10 +1047,9 @@ static ssize_t sg_write(struct file *file, const char __user *buf, size_t count, ...@@ -1048,10 +1047,9 @@ static ssize_t sg_write(struct file *file, const char __user *buf, size_t count,
printk(KERN_DEBUG DRV_NAME "_write(buf=0x%p, count=%lld, pos=%llu)\n", printk(KERN_DEBUG DRV_NAME "_write(buf=0x%p, count=%lld, pos=%llu)\n",
buf, (s64)count, (u64)*pos); buf, (s64)count, (u64)*pos);
/* TODO transfer boundaries at PAGE_SIZE granularity */ /* TODO transfer boundaries at PAGE_SIZE granularity */
while (remaining > 0) while (remaining > 0) {
{
/* limit DMA transfer size */ /* limit DMA transfer size */
transfer_len = (remaining < APE_CHDMA_MAX_TRANSFER_LEN)? remaining: transfer_len = (remaining < APE_CHDMA_MAX_TRANSFER_LEN) ? remaining :
APE_CHDMA_MAX_TRANSFER_LEN; APE_CHDMA_MAX_TRANSFER_LEN;
/* get all user space buffer pages and create a scattergather list */ /* get all user space buffer pages and create a scattergather list */
sgm_map_user_pages(ape->sgm, transfer_addr, transfer_len, 0/*read from userspace*/); sgm_map_user_pages(ape->sgm, transfer_addr, transfer_len, 0/*read from userspace*/);
...@@ -1085,7 +1083,7 @@ static ssize_t sg_write(struct file *file, const char __user *buf, size_t count, ...@@ -1085,7 +1083,7 @@ static ssize_t sg_write(struct file *file, const char __user *buf, size_t count,
/* /*
* character device file operations * character device file operations
*/ */
static struct file_operations sg_fops = { static const struct file_operations sg_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = sg_open, .open = sg_open,
.release = sg_close, .release = sg_close,
......
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