[PATCH 2/2] staging: comedi: cb_pcidas64: refactor relocated code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Code was moved to a separate function in a previous patch. Code
structure wast maintained to ease review. Code may now be refactored
to ease reading.

Move multi-line dereference onto single line. Give function parameter
more meaningful name. Fix minor alignment issue.

Signed-off-by: Tobin C. Harding <me@xxxxxxxx>
---
 drivers/staging/comedi/drivers/cb_pcidas64.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
index 385f007..16d2491 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -1480,18 +1480,17 @@ static void init_stc_registers(struct comedi_device *dev)
 	disable_ai_pacing(dev);
 };
 
-static int alloc_dma_member(int i, struct comedi_device *dev)
+static int alloc_dma_member(int member, struct comedi_device *dev)
 {
 	struct pci_dev *pcidev = comedi_to_pci_dev(dev);
 	struct pcidas64_private *devpriv = dev->private;
 
-	devpriv->ao_buffer[i] =
+	devpriv->ao_buffer[member] =
 		dma_alloc_coherent(&pcidev->dev,
-				DMA_BUFFER_SIZE,
-				&devpriv->
-				ao_buffer_bus_addr[i],
-				GFP_KERNEL);
-	if (!devpriv->ao_buffer[i])
+				   DMA_BUFFER_SIZE,
+				   &devpriv->ao_buffer_bus_addr[member],
+				   GFP_KERNEL);
+	if (!devpriv->ao_buffer[member])
 		return -ENOMEM;
 	return 0;
 }
-- 
2.7.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux