[PATCH 04/14] staging: comedi: jr3_pci: rename some local vars in the (*attach)

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

 



For aesthetics, rename the subdevice private data pointer from 'p'
to 'spriv' and the variable used to check the errno from 'result'
to 'ret'.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/jr3_pci.c | 43 ++++++++++++++++----------------
 1 file changed, 21 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c
index 8dc1ccb..4553016 100644
--- a/drivers/staging/comedi/drivers/jr3_pci.c
+++ b/drivers/staging/comedi/drivers/jr3_pci.c
@@ -672,9 +672,9 @@ static int jr3_pci_auto_attach(struct comedi_device *dev,
 {
 	struct pci_dev *pcidev = comedi_to_pci_dev(dev);
 	struct jr3_pci_dev_private *devpriv;
-	struct jr3_pci_subdev_private *p;
+	struct jr3_pci_subdev_private *spriv;
 	struct comedi_subdevice *s;
-	int result;
+	int ret;
 	int i;
 
 	if (sizeof(struct jr3_channel) != 0xc00) {
@@ -710,17 +710,17 @@ static int jr3_pci_auto_attach(struct comedi_device *dev,
 		break;
 	}
 
-	result = comedi_pci_enable(dev);
-	if (result)
-		return result;
+	ret = comedi_pci_enable(dev);
+	if (ret)
+		return ret;
 
 	devpriv->iobase = pci_ioremap_bar(pcidev, 0);
 	if (!devpriv->iobase)
 		return -ENOMEM;
 
-	result = comedi_alloc_subdevices(dev, devpriv->n_channels);
-	if (result)
-		return result;
+	ret = comedi_alloc_subdevices(dev, devpriv->n_channels);
+	if (ret)
+		return ret;
 
 	dev->open = jr3_pci_open;
 	for (i = 0; i < devpriv->n_channels; i++) {
@@ -730,24 +730,23 @@ static int jr3_pci_auto_attach(struct comedi_device *dev,
 		s->n_chan	= 8 * 7 + 2;
 		s->insn_read	= jr3_pci_ai_insn_read;
 
-		p = jr3_pci_alloc_spriv(dev, s);
-		if (p) {
+		spriv = jr3_pci_alloc_spriv(dev, s);
+		if (spriv) {
 			/* Channel specific range and maxdata */
-			s->range_table_list	= p->range_table_list;
-			s->maxdata_list		= p->maxdata_list;
+			s->range_table_list	= spriv->range_table_list;
+			s->maxdata_list		= spriv->maxdata_list;
 		}
 	}
 
 	/*  Reset DSP card */
 	writel(0, &devpriv->iobase->channel[0].reset);
 
-	result = comedi_load_firmware(dev, &comedi_to_pci_dev(dev)->dev,
-				      "comedi/jr3pci.idm",
-				      jr3_download_firmware, 0);
-	dev_dbg(dev->class_dev, "Firmare load %d\n", result);
-
-	if (result < 0)
-		return result;
+	ret = comedi_load_firmware(dev, &comedi_to_pci_dev(dev)->dev,
+				   "comedi/jr3pci.idm",
+				   jr3_download_firmware, 0);
+	dev_dbg(dev->class_dev, "Firmare load %d\n", ret);
+	if (ret < 0)
+		return ret;
 	/*
 	 * TODO: use firmware to load preferred offset tables. Suggested
 	 * format:
@@ -772,10 +771,10 @@ static int jr3_pci_auto_attach(struct comedi_device *dev,
 	/*  Start card timer */
 	for (i = 0; i < devpriv->n_channels; i++) {
 		s = &dev->subdevices[i];
-		p = s->private;
+		spriv = s->private;
 
-		p->next_time_min = jiffies + msecs_to_jiffies(500);
-		p->next_time_max = jiffies + msecs_to_jiffies(2000);
+		spriv->next_time_min = jiffies + msecs_to_jiffies(500);
+		spriv->next_time_max = jiffies + msecs_to_jiffies(2000);
 	}
 
 	devpriv->timer.data = (unsigned long)dev;
-- 
1.8.5.2

_______________________________________________
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