linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/9] Staging: comedi: fix printk  issue in cb_pcidio.c
@ 2011-09-30 13:18 Ravishankar Karkala Mallikarjunayya
  2011-09-30 13:18 ` [PATCH 2/9] Staging: comedi: fix printk issue in cb_pcidda.c Ravishankar Karkala Mallikarjunayya
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-09-30 13:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcidio.c file that fixes up a printk warning found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/cb_pcidio.c |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidio.c b/drivers/staging/comedi/drivers/cb_pcidio.c
index 79477a5..85cc78d 100644
--- a/drivers/staging/comedi/drivers/cb_pcidio.c
+++ b/drivers/staging/comedi/drivers/cb_pcidio.c
@@ -184,7 +184,8 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	int index;
 	int i;
 
-	printk("comedi%d: cb_pcidio: \n", dev->minor);
+	dev_info(&pcidev->dev, "comedi%d: cb_pcidio:\n",
+		dev->minor);
 
 /*
  * Allocate the private structure area.  alloc_private() is a
@@ -223,8 +224,9 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		}
 	}
 
-	printk("No supported ComputerBoards/MeasurementComputing card found on "
-	       "requested position\n");
+	dev_err(&pcidev->dev, "No supported"
+		" ComputerBoards/MeasurementComputing"
+		" card found on requested position\n");
 	return -EIO;
 
 found:
@@ -236,12 +238,13 @@ found:
 	dev->board_name = thisboard->name;
 
 	devpriv->pci_dev = pcidev;
-	printk("Found %s on bus %i, slot %i\n", thisboard->name,
-	       devpriv->pci_dev->bus->number,
-	       PCI_SLOT(devpriv->pci_dev->devfn));
+	dev_info(&pcidev->dev, "Found %s on bus %i, slot %i\n",
+		thisboard->name,
+		devpriv->pci_dev->bus->number,
+		PCI_SLOT(devpriv->pci_dev->devfn));
 	if (comedi_pci_enable(pcidev, thisboard->name)) {
-		printk
-		    ("cb_pcidio: failed to enable PCI device and request regions\n");
+		dev_err(&pcidev->dev, "cb_pcidio: failed to enable PCI"
+			" device and request regions\n");
 		return -EIO;
 	}
 	devpriv->dio_reg_base
@@ -259,11 +262,11 @@ found:
 	for (i = 0; i < thisboard->n_8255; i++) {
 		subdev_8255_init(dev, dev->subdevices + i,
 				 NULL, devpriv->dio_reg_base + i * 4);
-		printk(" subdev %d: base = 0x%lx\n", i,
-		       devpriv->dio_reg_base + i * 4);
+		dev_dbg(&pcidev->dev, " subdev %d: base = 0x%lx\n", i,
+			devpriv->dio_reg_base + i * 4);
 	}
 
-	printk("attached\n");
+	dev_info(&pcidev->dev, "attached\n");
 	return 1;
 }
 
@@ -277,7 +280,7 @@ found:
  */
 static int pcidio_detach(struct comedi_device *dev)
 {
-	printk("comedi%d: cb_pcidio: remove\n", dev->minor);
+	pr_info("comedi%d: cb_pcidio: remove\n", dev->minor);
 	if (devpriv) {
 		if (devpriv->pci_dev) {
 			if (devpriv->dio_reg_base)
-- 
1.7.6.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/9] Staging: comedi: fix printk issue in cb_pcidda.c
  2011-09-30 13:18 [PATCH 1/9] Staging: comedi: fix printk issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
@ 2011-09-30 13:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-01 15:05   ` Dan Carpenter
  2011-09-30 13:18 ` [PATCH 3/9] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-09-30 13:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcidda.c file that fixes up a printk warning found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/cb_pcidda.c |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidda.c b/drivers/staging/comedi/drivers/cb_pcidda.c
index 49102b3..3dddffe 100644
--- a/drivers/staging/comedi/drivers/cb_pcidda.c
+++ b/drivers/staging/comedi/drivers/cb_pcidda.c
@@ -282,7 +282,8 @@ static int cb_pcidda_attach(struct comedi_device *dev,
 	struct pci_dev *pcidev = NULL;
 	int index;
 
-	printk("comedi%d: cb_pcidda: ", dev->minor);
+	dev_info(&pcidev->dev, "comedi%d: cb_pcidda:\n",
+		dev->minor);
 
 /*
  * Allocate the private structure area.
@@ -293,7 +294,6 @@ static int cb_pcidda_attach(struct comedi_device *dev,
 /*
  * Probe the device to determine what device in the series it is.
  */
-	printk("\n");
 
 	for_each_pci_dev(pcidev) {
 		if (pcidev->vendor == PCI_VENDOR_ID_CB) {
@@ -312,22 +312,24 @@ static int cb_pcidda_attach(struct comedi_device *dev,
 		}
 	}
 	if (!pcidev) {
-		printk
-		    ("Not a ComputerBoards/MeasurementComputing card on requested position\n");
+		dev_err(&pcidev->dev, "Not a "
+			"ComputerBoards/MeasurementComputing "
+			"card on requested position\n");
 		return -EIO;
 	}
 found:
 	devpriv->pci_dev = pcidev;
 	dev->board_ptr = cb_pcidda_boards + index;
 	/*  "thisboard" macro can be used from here. */
-	printk("Found %s at requested position\n", thisboard->name);
+	dev_info(&pcidev->dev, "Found %s at requested position\n",
+		thisboard->name);
 
 	/*
 	 * Enable PCI device and request regions.
 	 */
 	if (comedi_pci_enable(pcidev, thisboard->name)) {
-		printk
-		    ("cb_pcidda: failed to enable PCI device and request regions\n");
+		dev_err(&pcidev->dev, "cb_pcidda: failed to enable PCI "
+			"device and request regions\n");
 		return -EIO;
 	}
 
@@ -377,12 +379,8 @@ found:
 	s = dev->subdevices + 2;
 	subdev_8255_init(dev, s, NULL, devpriv->digitalio + PORT2A);
 
-	printk(" eeprom:");
-	for (index = 0; index < EEPROM_SIZE; index++) {
+	for (index = 0; index < EEPROM_SIZE; index++)
 		devpriv->eeprom_data[index] = cb_pcidda_read_eeprom(dev, index);
-		printk(" %i:0x%x ", index, devpriv->eeprom_data[index]);
-	}
-	printk("\n");
 
 	/*  set calibrations dacs */
 	for (index = 0; index < thisboard->ao_chans; index++)
@@ -417,7 +415,7 @@ static int cb_pcidda_detach(struct comedi_device *dev)
 		subdev_8255_cleanup(dev, dev->subdevices + 2);
 	}
 
-	printk("comedi%d: cb_pcidda: remove\n", dev->minor);
+	pr_info("comedi%d: cb_pcidda: remove\n", dev->minor);
 
 	return 0;
 }
-- 
1.7.6.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/9] Staging: comedi: fix printk issue in cb_pcidas.c
  2011-09-30 13:18 [PATCH 1/9] Staging: comedi: fix printk issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
  2011-09-30 13:18 ` [PATCH 2/9] Staging: comedi: fix printk issue in cb_pcidda.c Ravishankar Karkala Mallikarjunayya
@ 2011-09-30 13:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-01 15:09   ` Dan Carpenter
  2011-10-03 23:30   ` Ryan Mallon
  2011-09-30 13:18 ` [PATCH 4/9] Staging: comedi: fix printk issue in cb_pcidas64.c Ravishankar Karkala Mallikarjunayya
                   ` (6 subsequent siblings)
  8 siblings, 2 replies; 14+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-09-30 13:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcidas.c file that fixes up a printk warning found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/cb_pcidas.c |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c
index 9dec153..9d16c6c 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas.c
@@ -565,7 +565,8 @@ static int cb_pcidas_attach(struct comedi_device *dev,
 	int index;
 	int i;
 
-	pr_info("comedi%d: cb_pcidas: ", dev->minor);
+	dev_info(&pcidev->dev, "comedi%d: cb_pcidas:\n",
+		dev->minor);
 
 /*
  * Allocate the private structure area.
@@ -576,7 +577,6 @@ static int cb_pcidas_attach(struct comedi_device *dev,
 /*
  * Probe the device to determine what device in the series it is.
  */
-	printk("\n");
 
 	for_each_pci_dev(pcidev) {
 		/*  is it not a computer boards card? */
@@ -600,20 +600,24 @@ static int cb_pcidas_attach(struct comedi_device *dev,
 		}
 	}
 
-	printk("No supported ComputerBoards/MeasurementComputing card found on "
-	       "requested position\n");
+	dev_err(&pcidev->dev, "No supported "
+		"ComputerBoards/MeasurementComputing "
+		"card found on requested position\n");
 	return -EIO;
 
 found:
 
-	printk("Found %s on bus %i, slot %i\n", cb_pcidas_boards[index].name,
-	       pcidev->bus->number, PCI_SLOT(pcidev->devfn));
+	dev_info(&pcidev->dev, "Found %s on bus %i, slot %i\n",
+		cb_pcidas_boards[index].name,
+		pcidev->bus->number,
+		PCI_SLOT(pcidev->devfn));
 
 	/*
 	 * Enable PCI device and reserve I/O ports.
 	 */
 	if (comedi_pci_enable(pcidev, "cb_pcidas")) {
-		printk(" Failed to enable PCI device and request regions\n");
+		dev_err(&pcidev->dev, " Failed to enable PCI "
+			"device and request regions\n");
 		return -EIO;
 	}
 	/*
@@ -639,7 +643,8 @@ found:
 	/*  get irq */
 	if (request_irq(devpriv->pci_dev->irq, cb_pcidas_interrupt,
 			IRQF_SHARED, "cb_pcidas", dev)) {
-		printk(" unable to allocate irq %d\n", devpriv->pci_dev->irq);
+		dev_warn(&pcidev->dev, " unable to allocate irq %d\n",
+			devpriv->pci_dev->irq);
 		return -EINVAL;
 	}
 	dev->irq = devpriv->pci_dev->irq;
-- 
1.7.6.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/9] Staging: comedi: fix printk issue in cb_pcidas64.c
  2011-09-30 13:18 [PATCH 1/9] Staging: comedi: fix printk issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
  2011-09-30 13:18 ` [PATCH 2/9] Staging: comedi: fix printk issue in cb_pcidda.c Ravishankar Karkala Mallikarjunayya
  2011-09-30 13:18 ` [PATCH 3/9] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
@ 2011-09-30 13:18 ` Ravishankar Karkala Mallikarjunayya
  2011-09-30 13:18 ` [PATCH 5/9] Staging: comedi: fix printk issue in cb_pcimdas.c Ravishankar Karkala Mallikarjunayya
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-09-30 13:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcidas64.c file that fixes up a printk warning found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/cb_pcidas64.c |   32 ++++++++++++++-----------
 1 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
index 3dc68ef..8598fa5 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -1739,7 +1739,8 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	uint32_t local_range, local_decode;
 	int retval;
 
-	pr_info("comedi%d: cb_pcidas64\n", dev->minor);
+	dev_info(&pcidev->dev, "comedi%d: cb_pcidas64\n",
+		dev->minor);
 
 /*
  * Allocate the private structure area.
@@ -1776,17 +1777,20 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	}
 
 	if (dev->board_ptr == NULL) {
-		printk
-		    ("No supported ComputerBoards/MeasurementComputing card found\n");
+		dev_err(&pcidev->dev, "No supported "
+			"ComputerBoards/MeasurementComputing "
+			"card found\n");
 		return -EIO;
 	}
 
-	printk("Found %s on bus %i, slot %i\n", board(dev)->name,
-	       pcidev->bus->number, PCI_SLOT(pcidev->devfn));
+	dev_info(&pcidev->dev, "Found %s on bus %i, slot %i\n",
+		board(dev)->name,
+		pcidev->bus->number,
+		PCI_SLOT(pcidev->devfn));
 
 	if (comedi_pci_enable(pcidev, driver_cb_pcidas.driver_name)) {
-		printk(KERN_WARNING
-		       " failed to enable PCI device and request regions\n");
+		dev_warn(&pcidev->dev, "failed to enable PCI "
+			"device and request regions\n");
 		return -EIO;
 	}
 	pci_set_master(pcidev);
@@ -1814,7 +1818,6 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	if (!priv(dev)->plx9080_iobase || !priv(dev)->main_iobase
 	    || !priv(dev)->dio_counter_iobase) {
-		printk(" failed to remap io memory\n");
 		return -ENOMEM;
 	}
 
@@ -1850,17 +1853,17 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	priv(dev)->hw_revision =
 	    hw_revision(dev, readw(priv(dev)->main_iobase + HW_STATUS_REG));
-	printk(" stc hardware revision %i\n", priv(dev)->hw_revision);
 	init_plx9080(dev);
 	init_stc_registers(dev);
 	/*  get irq */
 	if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
 			"cb_pcidas64", dev)) {
-		printk(" unable to allocate irq %u\n", pcidev->irq);
+		dev_warn(&pcidev->dev, "unable to allocate irq %u\n",
+			pcidev->irq);
 		return -EINVAL;
 	}
 	dev->irq = pcidev->irq;
-	printk(" irq %u\n", dev->irq);
+	dev_dbg(&pcidev->dev, " irq %u\n", dev->irq);
 
 	retval = setup_subdevices(dev);
 	if (retval < 0)
@@ -1882,7 +1885,7 @@ static int detach(struct comedi_device *dev)
 {
 	unsigned int i;
 
-	printk("comedi%d: cb_pcidas: remove\n", dev->minor);
+	pr_info("comedi%d: cb_pcidas: remove\n", dev->minor);
 
 	if (dev->irq)
 		free_irq(dev->irq, dev);
@@ -2093,7 +2096,8 @@ static int ai_config_calibration_source(struct comedi_device *dev,
 	else
 		num_calibration_sources = 8;
 	if (source >= num_calibration_sources) {
-		printk("invalid calibration source: %i\n", source);
+		printk(KERN_WARNING "invalid calibration source: %i\n",
+			source);
 		return -EINVAL;
 	}
 
@@ -3483,7 +3487,7 @@ static int prep_ao_dma(struct comedi_device *dev, const struct comedi_cmd *cmd)
 	num_bytes = load_ao_dma_buffer(dev, cmd);
 	if (num_bytes == 0)
 		return -1;
-	if (num_bytes >= DMA_BUFFER_SIZE) ;
+	if (num_bytes >= DMA_BUFFER_SIZE);
 	load_ao_dma(dev, cmd);
 
 	dma_start_sync(dev, 0);
-- 
1.7.6.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 5/9] Staging: comedi: fix printk  issue in cb_pcimdas.c
  2011-09-30 13:18 [PATCH 1/9] Staging: comedi: fix printk issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
                   ` (2 preceding siblings ...)
  2011-09-30 13:18 ` [PATCH 4/9] Staging: comedi: fix printk issue in cb_pcidas64.c Ravishankar Karkala Mallikarjunayya
@ 2011-09-30 13:18 ` Ravishankar Karkala Mallikarjunayya
  2011-09-30 13:18 ` [PATCH 6/9] Staging: comedi: fix line over 80 character issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-09-30 13:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcimdas.c file that fixes up a printk warning found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/cb_pcimdas.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcimdas.c b/drivers/staging/comedi/drivers/cb_pcimdas.c
index b1b832b..20e1421 100644
--- a/drivers/staging/comedi/drivers/cb_pcimdas.c
+++ b/drivers/staging/comedi/drivers/cb_pcimdas.c
@@ -212,7 +212,8 @@ static int cb_pcimdas_attach(struct comedi_device *dev,
 	int index;
 	/* int i; */
 
-	printk("comedi%d: cb_pcimdas: ", dev->minor);
+	dev_info(&pcidev->dev, "comedi%d: cb_pcimdas:\n",
+		dev->minor);
 
 /*
  * Allocate the private structure area.
@@ -223,7 +224,6 @@ static int cb_pcimdas_attach(struct comedi_device *dev,
 /*
  * Probe the device to determine what device in the series it is.
  */
-	printk("\n");
 
 	for_each_pci_dev(pcidev) {
 		/*  is it not a computer boards card? */
@@ -248,14 +248,17 @@ static int cb_pcimdas_attach(struct comedi_device *dev,
 		}
 	}
 
-	printk("No supported ComputerBoards/MeasurementComputing card found on "
-	       "requested position\n");
+	dev_err(&pcidev->dev, "No supported"
+		" ComputerBoards/MeasurementComputing"
+		" card found on requested position\n");
 	return -EIO;
 
 found:
 
-	printk("Found %s on bus %i, slot %i\n", cb_pcimdas_boards[index].name,
-	       pcidev->bus->number, PCI_SLOT(pcidev->devfn));
+	dev_info(&pcidev->dev, "Found %s on bus %i, slot %i\n",
+		cb_pcimdas_boards[index].name,
+		pcidev->bus->number,
+		PCI_SLOT(pcidev->devfn));
 
 	/*  Warn about non-tested features */
 	switch (thisboard->device_id) {
@@ -267,7 +270,8 @@ found:
 	}
 
 	if (comedi_pci_enable(pcidev, "cb_pcimdas")) {
-		printk(" Failed to enable PCI device and request regions\n");
+		dev_warn(&pcidev->dev, "Failed to enable PCI"
+			" device and request regions\n");
 		return -EIO;
 	}
 
@@ -333,7 +337,7 @@ found:
 	else
 		s->type = COMEDI_SUBD_UNUSED;
 
-	printk("attached\n");
+	dev_info(&pcidev->dev, "attached\n");
 
 	return 1;
 }
@@ -357,7 +361,7 @@ static int cb_pcimdas_detach(struct comedi_device *dev)
 		printk("devpriv->BADR4 = 0x%lx\n", devpriv->BADR4);
 	}
 #endif
-	printk("comedi%d: cb_pcimdas: remove\n", dev->minor);
+	pr_info("comedi%d: cb_pcimdas: remove\n", dev->minor);
 	if (dev->irq)
 		free_irq(dev->irq, dev);
 	if (devpriv) {
-- 
1.7.6.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 6/9] Staging: comedi: fix line over 80 character issue in cb_pcidio.c
  2011-09-30 13:18 [PATCH 1/9] Staging: comedi: fix printk issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
                   ` (3 preceding siblings ...)
  2011-09-30 13:18 ` [PATCH 5/9] Staging: comedi: fix printk issue in cb_pcimdas.c Ravishankar Karkala Mallikarjunayya
@ 2011-09-30 13:18 ` Ravishankar Karkala Mallikarjunayya
  2011-09-30 13:18 ` [PATCH 7/9] Staging: comedi: fix line over 80 character issue in cb_pcidda.c Ravishankar Karkala Mallikarjunayya
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-09-30 13:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcidio.c file that fixes up a line over 80 character warning found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/cb_pcidio.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidio.c b/drivers/staging/comedi/drivers/cb_pcidio.c
index 85cc78d..40a3eb0 100644
--- a/drivers/staging/comedi/drivers/cb_pcidio.c
+++ b/drivers/staging/comedi/drivers/cb_pcidio.c
@@ -104,9 +104,12 @@ MODULE_DEVICE_TABLE(pci, pcidio_pci_table);
  */
 #define thisboard ((const struct pcidio_board *)dev->board_ptr)
 
-/* this structure is for data unique to this hardware driver.  If
-   several hardware drivers keep similar information in this structure,
-   feel free to suggest moving the variable to the struct comedi_device struct.  */
+/*
+ * this structure is for data unique to this hardware driver.  If
+ * several hardware drivers keep similar information in this structure,
+ * feel free to suggest moving the variable to the struct comedi_device
+ * struct.
+ */
 struct pcidio_private {
 	int data;		/*  currently unused */
 
@@ -114,9 +117,11 @@ struct pcidio_private {
 	struct pci_dev *pci_dev;
 
 	/* used for DO readback, currently unused */
-	unsigned int do_readback[4];	/* up to 4 unsigned int suffice to hold 96 bits for PCI-DIO96 */
+	/* up to 4 unsigned int suffice to hold 96 bits for PCI-DIO96 */
+	unsigned int do_readback[4];
 
-	unsigned long dio_reg_base;	/*  address of port A of the first 8255 chip on board */
+	/* address of port A of the first 8255 chip on board */
+	unsigned long dio_reg_base;
 };
 
 /*
-- 
1.7.6.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 7/9] Staging: comedi: fix line over 80 character issue in cb_pcidda.c
  2011-09-30 13:18 [PATCH 1/9] Staging: comedi: fix printk issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
                   ` (4 preceding siblings ...)
  2011-09-30 13:18 ` [PATCH 6/9] Staging: comedi: fix line over 80 character issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
@ 2011-09-30 13:18 ` Ravishankar Karkala Mallikarjunayya
  2011-09-30 13:18 ` [PATCH 8/9] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-09-30 13:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcidda.c file that fixes up a line over 80 character warning found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/cb_pcidda.c |   92 +++++++++++++++++++---------
 1 files changed, 63 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidda.c b/drivers/staging/comedi/drivers/cb_pcidda.c
index 3dddffe..d83ac1f 100644
--- a/drivers/staging/comedi/drivers/cb_pcidda.c
+++ b/drivers/staging/comedi/drivers/cb_pcidda.c
@@ -50,10 +50,12 @@ Please report success/failure with other different cards to
 
 #include "comedi_pci.h"
 #include "8255.h"
-
-#define PCI_VENDOR_ID_CB	0x1307	/*  PCI vendor number of ComputerBoards */
-#define EEPROM_SIZE	128	/*  number of entries in eeprom */
-#define MAX_AO_CHANNELS 8	/*  maximum number of ao channels for supported boards */
+/* PCI vendor number of ComputerBoards */
+#define PCI_VENDOR_ID_CB        0x1307
+/* number of entries in eeprom */
+#define EEPROM_SIZE     128
+/* maximum number of ao channels for supported boards */
+#define MAX_AO_CHANNELS 8
 
 /* PCI-DDA base addresses */
 #define DIGITALIO_BADRINDEX	2
@@ -94,20 +96,31 @@ Please report success/failure with other different cards to
 
 #define DACALIBRATION1	4	/*  D/A CALIBRATION REGISTER 1 */
 /* write bits */
-#define	SERIAL_IN_BIT	0x1	/*  serial data input for eeprom, caldacs, reference dac */
+#define	SERIAL_IN_BIT	0x1	/*
+				 * serial data input for eeprom,
+				 * caldacs, reference dac
+				 */
 #define	CAL_CHANNEL_MASK	(0x7 << 1)
 #define	CAL_CHANNEL_BITS(channel)	(((channel) << 1) & CAL_CHANNEL_MASK)
 /* read bits */
 #define	CAL_COUNTER_MASK	0x1f
-#define	CAL_COUNTER_OVERFLOW_BIT	0x20	/*  calibration counter overflow status bit */
-#define	AO_BELOW_REF_BIT	0x40	/*  analog output is less than reference dac voltage */
-#define	SERIAL_OUT_BIT	0x80	/*  serial data out, for reading from eeprom */
-
-#define DACALIBRATION2	6	/*  D/A CALIBRATION REGISTER 2 */
-#define	SELECT_EEPROM_BIT	0x1	/*  send serial data in to eeprom */
-#define	DESELECT_REF_DAC_BIT	0x2	/*  don't send serial data to MAX542 reference dac */
-#define	DESELECT_CALDAC_BIT(n)	(0x4 << (n))	/*  don't send serial data to caldac n */
-#define	DUMMY_BIT	0x40	/*  manual says to set this bit with no explanation */
+/* calibration counter overflow status bit */
+#define CAL_COUNTER_OVERFLOW_BIT        0x20
+/* analog output is less than reference dac voltage */
+#define AO_BELOW_REF_BIT        0x40
+/* serial data out, for reading from eeprom */
+#define SERIAL_OUT_BIT  0x80
+
+/* D/A CALIBRATION REGISTER 2 */
+#define DACALIBRATION2  6
+/* send serial data in to eeprom */
+#define SELECT_EEPROM_BIT       0x1
+/* don't send serial data to MAX542 reference dac */
+#define DESELECT_REF_DAC_BIT    0x2
+/* don't send serial data to caldac n */
+#define DESELECT_CALDAC_BIT(n)  (0x4 << (n))
+/* manual says to set this bit with no explanation */
+#define DUMMY_BIT       0x40
 
 #define DADATA	8		/*  FIRST D/A DATA REGISTER (0) */
 
@@ -212,9 +225,12 @@ MODULE_DEVICE_TABLE(pci, cb_pcidda_pci_table);
  */
 #define thisboard ((const struct cb_pcidda_board *)dev->board_ptr)
 
-/* this structure is for data unique to this hardware driver.  If
-   several hardware drivers keep similar information in this structure,
-   feel free to suggest moving the variable to the struct comedi_device struct.  */
+/*
+ * this structure is for data unique to this hardware driver.  If
+ * several hardware drivers keep similar information in this structure,
+ * feel free to suggest moving the variable to the struct comedi_device
+ * struct.
+ */
 struct cb_pcidda_private {
 	int data;
 
@@ -227,9 +243,12 @@ struct cb_pcidda_private {
 	/* unsigned long control_status; */
 	/* unsigned long adc_fifo; */
 
-	unsigned int dac_cal1_bits;	/*  bits last written to da calibration register 1 */
-	unsigned int ao_range[MAX_AO_CHANNELS];	/*  current range settings for output channels */
-	u16 eeprom_data[EEPROM_SIZE];	/*  software copy of board's eeprom */
+	/* bits last written to da calibration register 1 */
+	unsigned int dac_cal1_bits;
+	/* current range settings for output channels */
+	unsigned int ao_range[MAX_AO_CHANNELS];
+	/* software copy of board's eeprom */
+	u16 eeprom_data[EEPROM_SIZE];
 };
 
 /*
@@ -488,7 +507,9 @@ static int cb_pcidda_ai_cmdtest(struct comedi_device *dev,
 	if (err)
 		return 1;
 
-	/* step 2: make sure trigger sources are unique and mutually compatible */
+	/*
+	 * step 2: make sure trigger sources are unique and mutually compatible
+	 */
 
 	/* note that mutual compatibility is not an issue here */
 	if (cmd->scan_begin_src != TRIG_TIMER
@@ -700,8 +721,10 @@ static unsigned int cb_pcidda_read_eeprom(struct comedi_device *dev,
 	unsigned int i;
 	unsigned int cal2_bits;
 	unsigned int value;
-	const int max_num_caldacs = 4;	/*  one caldac for every two dac channels */
-	const int read_instruction = 0x6;	/*  bits to send to tell eeprom we want to read */
+	/* one caldac for every two dac channels */
+	const int max_num_caldacs = 4;
+	/* bits to send to tell eeprom we want to read */
+	const int read_instruction = 0x6;
 	const int instruction_length = 3;
 	const int address_length = 8;
 
@@ -733,9 +756,12 @@ static void cb_pcidda_write_caldac(struct comedi_device *dev,
 {
 	unsigned int cal2_bits;
 	unsigned int i;
-	const int num_channel_bits = 3;	/*  caldacs use 3 bit channel specification */
-	const int num_caldac_bits = 8;	/*  8 bit calibration dacs */
-	const int max_num_caldacs = 4;	/*  one caldac for every two dac channels */
+	/* caldacs use 3 bit channel specification */
+	const int num_channel_bits = 3;
+	/* 8 bit calibration dacs */
+	const int num_caldac_bits = 8;
+	/* one caldac for every two dac channels */
+	const int max_num_caldacs = 4;
 
 	/* write 3 bit channel */
 	cb_pcidda_serial_out(dev, channel, num_channel_bits);
@@ -794,14 +820,19 @@ static unsigned int offset_eeprom_address(unsigned int ao_channel,
 	return 0x7 + 2 * range + 12 * ao_channel;
 }
 
-/* returns eeprom address that provides gain calibration for given ao channel and range */
+/*
+ * returns eeprom address that provides gain calibration for
+ * given ao channel and range
+ */
 static unsigned int gain_eeprom_address(unsigned int ao_channel,
 					unsigned int range)
 {
 	return 0x8 + 2 * range + 12 * ao_channel;
 }
 
-/* returns upper byte of eeprom entry, which gives the coarse adjustment values */
+/* returns upper byte of eeprom entry, which gives
+ * the coarse adjustment values
+ */
 static unsigned int eeprom_coarse_byte(unsigned int word)
 {
 	return (word >> 8) & 0xff;
@@ -819,7 +850,10 @@ static void cb_pcidda_calibrate(struct comedi_device *dev, unsigned int channel,
 {
 	unsigned int coarse_offset, fine_offset, coarse_gain, fine_gain;
 
-	/*  remember range so we can tell when we need to readjust calibration */
+	/*
+	 * remember range so we can tell when we need to
+	 * readjust calibration
+	 */
 	devpriv->ao_range[channel] = range;
 
 	/*  get values from eeprom data */
-- 
1.7.6.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 8/9] Staging: comedi: fix printk  issue in cb_pcidas.c
  2011-09-30 13:18 [PATCH 1/9] Staging: comedi: fix printk issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
                   ` (5 preceding siblings ...)
  2011-09-30 13:18 ` [PATCH 7/9] Staging: comedi: fix line over 80 character issue in cb_pcidda.c Ravishankar Karkala Mallikarjunayya
@ 2011-09-30 13:18 ` Ravishankar Karkala Mallikarjunayya
  2011-09-30 13:18 ` [PATCH 9/9] Staging: comedi: fix line over 80 character " Ravishankar Karkala Mallikarjunayya
  2011-10-03 23:27 ` [PATCH 1/9] Staging: comedi: fix printk issue in cb_pcidio.c Ryan Mallon
  8 siblings, 0 replies; 14+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-09-30 13:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcidas.c file that fixes up a printk warning found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/cb_pcidas.c |   40 +++++++++++----------------
 1 files changed, 16 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c
index 9d16c6c..617d3a6 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas.c
@@ -780,10 +780,8 @@ static int cb_pcidas_detach(struct comedi_device *dev)
 			/*  disable and clear interrupts on amcc s5933 */
 			outl(INTCSR_INBOX_INTR_STATUS,
 			     devpriv->s5933_config + AMCC_OP_REG_INTCSR);
-#ifdef CB_PCIDAS_DEBUG
-			printk("detaching, incsr is 0x%x\n",
-			       inl(devpriv->s5933_config + AMCC_OP_REG_INTCSR));
-#endif
+			dev_dbg(&pcidev->dev, "detaching, incsr is 0x%x\n",
+				inl(devpriv->s5933_config + AMCC_OP_REG_INTCSR));
 		}
 	}
 	if (dev->irq)
@@ -863,7 +861,7 @@ static int ai_config_calibration_source(struct comedi_device *dev,
 	unsigned int source = data[1];
 
 	if (source >= num_calibration_sources) {
-		printk("invalid calibration source: %i\n", source);
+		printk(KERN_WARNING "invalid calibration source: %i\n", source);
 		return -EINVAL;
 	}
 
@@ -1283,9 +1281,8 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
 		bits |= PACER_INT;
 	outw(bits, devpriv->control_status + ADCMUX_CONT);
 
-#ifdef CB_PCIDAS_DEBUG
-	printk("comedi: sent 0x%x to adcmux control\n", bits);
-#endif
+	dev_dbg(&pcidev->dev, "comedi: sent 0x%x to adcmux control\n",
+		bits);
 
 	/*  load counters */
 	if (cmd->convert_src == TRIG_TIMER)
@@ -1310,9 +1307,8 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
 	} else {
 		devpriv->adc_fifo_bits |= INT_FHF;	/* interrupt fifo half full */
 	}
-#ifdef CB_PCIDAS_DEBUG
-	printk("comedi: adc_fifo_bits are 0x%x\n", devpriv->adc_fifo_bits);
-#endif
+	dev_dbg(&pcidev->dev, "comedi: adc_fifo_bits are 0x%x\n",
+		devpriv->adc_fifo_bits);
 	/*  enable (and clear) interrupts */
 	outw(devpriv->adc_fifo_bits | EOAI | INT | LADFUL,
 	     devpriv->control_status + INT_ADCFIFO);
@@ -1336,9 +1332,8 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
 	if (cmd->convert_src == TRIG_NOW && cmd->chanlist_len > 1)
 		bits |= BURSTE;
 	outw(bits, devpriv->control_status + TRIG_CONTSTAT);
-#ifdef CB_PCIDAS_DEBUG
-	printk("comedi: sent 0x%x to trig control\n", bits);
-#endif
+	dev_dbg(&pcidev->dev, "comedi: sent 0x%x to trig control\n",
+		bits);
 
 	return 0;
 }
@@ -1553,9 +1548,8 @@ static int cb_pcidas_ao_inttrig(struct comedi_device *dev,
 	/*  enable dac half-full and empty interrupts */
 	spin_lock_irqsave(&dev->spinlock, flags);
 	devpriv->adc_fifo_bits |= DAEMIE | DAHFIE;
-#ifdef CB_PCIDAS_DEBUG
-	printk("comedi: adc_fifo_bits are 0x%x\n", devpriv->adc_fifo_bits);
-#endif
+	dev_dbg(&pcidev->dev, "comedi: adc_fifo_bits are 0x%x\n",
+		devpriv->adc_fifo_bits);
 	/*  enable and clear interrupts */
 	outw(devpriv->adc_fifo_bits | DAEMI | DAHFI,
 	     devpriv->control_status + INT_ADCFIFO);
@@ -1563,9 +1557,8 @@ static int cb_pcidas_ao_inttrig(struct comedi_device *dev,
 	/*  start dac */
 	devpriv->ao_control_bits |= DAC_START | DACEN | DAC_EMPTY;
 	outw(devpriv->ao_control_bits, devpriv->control_status + DAC_CSR);
-#ifdef CB_PCIDAS_DEBUG
-	printk("comedi: sent 0x%x to dac control\n", devpriv->ao_control_bits);
-#endif
+	dev_dbg(&pcidev->dev, "comedi: sent 0x%x to dac control\n",
+		devpriv->ao_control_bits);
 	spin_unlock_irqrestore(&dev->spinlock, flags);
 
 	async->inttrig = NULL;
@@ -1591,10 +1584,9 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
 	async->events = 0;
 
 	s5933_status = inl(devpriv->s5933_config + AMCC_OP_REG_INTCSR);
-#ifdef CB_PCIDAS_DEBUG
-	printk("intcsr 0x%x\n", s5933_status);
-	printk("mbef 0x%x\n", inl(devpriv->s5933_config + AMCC_OP_REG_MBEF));
-#endif
+	dev_dbg(&pcidev->dev, "intcsr 0x%x\n", s5933_status);
+	dev_dbg(&pcidev->dev, "mbef 0x%x\n",
+		inl(devpriv->s5933_config + AMCC_OP_REG_MBEF));
 
 	if ((INTCSR_INTR_ASSERTED & s5933_status) == 0)
 		return IRQ_NONE;
-- 
1.7.6.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 9/9] Staging: comedi: fix line over 80 character issue in cb_pcidas.c
  2011-09-30 13:18 [PATCH 1/9] Staging: comedi: fix printk issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
                   ` (6 preceding siblings ...)
  2011-09-30 13:18 ` [PATCH 8/9] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
@ 2011-09-30 13:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-03 23:27 ` [PATCH 1/9] Staging: comedi: fix printk issue in cb_pcidio.c Ryan Mallon
  8 siblings, 0 replies; 14+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-09-30 13:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcidas.c file that fixes up a line over 80 character warning found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/cb_pcidas.c |  112 +++++++++++++++++++++-------
 1 files changed, 84 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c
index 617d3a6..0a2d6f2 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas.c
@@ -116,16 +116,31 @@ analog triggering on 1602 series
 #define   INTE 0x4		/*  interrupt enable */
 #define   DAHFIE 0x8		/*  dac half full interrupt enable */
 #define   EOAIE	0x10		/*  end of acquisition interrupt enable */
-#define   DAHFI	0x20		/*  dac half full read status / write interrupt clear */
-#define   EOAI 0x40		/*  read end of acq. interrupt status / write clear */
+#define   DAHFI 0x20            /*
+				 * dac half full read status / write
+				 * interrupt clear
+				 */
+#define   EOAI 0x40             /*
+				 * read end of acq. interrupt status / write
+				 * clear
+				 */
 #define   INT 0x80		/*  read interrupt status / write clear */
 #define   EOBI 0x200		/*  read end of burst interrupt status */
 #define   ADHFI 0x400		/*  read half-full interrupt status */
-#define   ADNEI 0x800		/*  read fifo not empty interrupt latch status */
-#define   ADNE 0x1000		/*  read, fifo not empty (realtime, not latched) status */
+#define   ADNEI 0x800		/*
+				 * read fifo not empty interrupt
+				 * latch status
+				 */
+#define   ADNE 0x1000           /*
+				 * read, fifo not empty (realtime,
+				 * not latched) status
+				 */
 #define   DAEMIE	0x1000	/*  write, dac empty interrupt enable */
 #define   LADFUL 0x2000		/*  read fifo overflow / write clear */
-#define   DAEMI 0x4000		/*  dac fifo empty interrupt status / write clear */
+#define   DAEMI 0x4000		/*
+				 * dac fifo empty interrupt
+				 * status / write clear
+				 */
 
 #define ADCMUX_CONT	2	/*  ADC CHANNEL MUX AND CONTROL register */
 #define   BEGIN_SCAN(x)	((x) & 0xf)
@@ -144,8 +159,14 @@ analog triggering on 1602 series
 #define   EXT_TRIGGER 0x2	/*  external start trigger */
 #define   ANALOG_TRIGGER 0x3	/*  external analog trigger */
 #define   TRIGGER_MASK	0x3	/*  mask of bits that determine start trigger */
-#define   TGPOL	0x04		/*  invert the edge/level of the external trigger (1602 only) */
-#define   TGSEL	0x08		/*  if set edge triggered, otherwise level trigerred (1602 only) */
+#define   TGPOL	0x04		/*
+				 * invert the edge/level of the external
+				 * trigger (1602 only)
+				 */
+#define   TGSEL	0x08		/*
+				 * if set edge triggered, otherwise level
+				 * trigerred (1602 only)
+				 */
 #define   TGEN	0x10		/*  enable external start trigger */
 #define   BURSTE 0x20		/*  burst mode enable */
 #define   XTRCL	0x80		/*  clear external trigger */
@@ -155,13 +176,20 @@ analog triggering on 1602 series
 #define   SELECT_TRIMPOT_BIT	0x200	/*  select ad7376 trim pot */
 #define   SELECT_DAC08_BIT	0x400	/*  select dac08 caldac */
 #define   CAL_SRC_BITS(x)	(((x) & 0x7) << 11)
-#define   CAL_EN_BIT	0x4000	/*  read calibration source instead of analog input channel 0 */
-#define   SERIAL_DATA_IN_BIT	0x8000	/*  serial data stream going to 8800 and 7376 */
+#define   CAL_EN_BIT	0x4000	/*
+				 * read calibration source instead of
+				 * analog input channel 0
+				 */
+/* serial data stream going to 8800 and 7376 */
+#define   SERIAL_DATA_IN_BIT    0x8000
 
 #define DAC_CSR	0x8		/*  dac control and status register */
 enum dac_csr_bits {
 	DACEN = 0x2,		/*  dac enable */
-	DAC_MODE_UPDATE_BOTH = 0x80,	/*  update both dacs when dac0 is written */
+	DAC_MODE_UPDATE_BOTH = 0x80,	/*
+					 * update both dacs when dac0 is
+					 * written
+					 */
 };
 static inline unsigned int DAC_RANGE(unsigned int channel, unsigned int range)
 {
@@ -206,7 +234,10 @@ static inline unsigned int DAC_DATA_REG(unsigned int channel)
 #define DACDATA	0		/*  DAC DATA register */
 #define DACFIFOCLR	2	/*  DAC FIFO CLEAR */
 
-/* bit in hexadecimal representation of range index that indicates unipolar input range */
+/*
+ * bit in hexadecimal representation of range index that
+ * indicates unipolar input range
+ */
 #define IS_UNIPOLAR 0x4
 /* analog input ranges for most boards */
 static const struct comedi_lrange cb_pcidas_ranges = {
@@ -263,13 +294,18 @@ struct cb_pcidas_board {
 	int ai_speed;		/*  fastest conversion period in ns */
 	int ao_nchan;		/*  number of analog out channels */
 	int has_ao_fifo;	/*  analog output has fifo */
-	int ao_scan_speed;	/*  analog output speed for 1602 series (for a scan, not conversion) */
+	int ao_scan_speed;	/*
+				 * analog output speed for 1602 series
+				 * (for a scan, not conversion)
+				 */
 	int fifo_size;		/*  number of samples fifo can hold */
 	const struct comedi_lrange *ranges;
 	enum trimpot_model trimpot;
 	unsigned has_dac08:1;
-	unsigned has_ai_trig_gated:1;	/* Tells if the AI trigger can be gated */
-	unsigned has_ai_trig_invert:1;	/* Tells if the AI trigger can be inverted */
+	/* Tells if the AI trigger can be gated */
+	unsigned has_ai_trig_gated:1;
+	/* Tells if the AI trigger can be inverted */
+	unsigned has_ai_trig_invert:1;
 };
 
 static const struct cb_pcidas_board cb_pcidas_boards[] = {
@@ -424,9 +460,12 @@ MODULE_DEVICE_TABLE(pci, cb_pcidas_pci_table);
  */
 #define thisboard ((const struct cb_pcidas_board *)dev->board_ptr)
 
-/* this structure is for data unique to this hardware driver.  If
-   several hardware drivers keep similar information in this structure,
-   feel free to suggest moving the variable to the struct comedi_device struct.  */
+/*
+ * this structure is for data unique to this hardware driver.  If
+ * several hardware drivers keep similar information in this structure,
+ * feel free to suggest moving the variable to the struct comedi_device
+ * struct.
+ */
 struct cb_pcidas_private {
 	/* would be useful for a PCI device */
 	struct pci_dev *pci_dev;
@@ -449,9 +488,12 @@ struct cb_pcidas_private {
 	unsigned int ao_divisor1;
 	unsigned int ao_divisor2;
 	volatile unsigned int ao_count;	/*  number of analog output samples remaining */
-	int ao_value[2];	/*  remember what the analog outputs are set to, to allow readback */
-	unsigned int caldac_value[NUM_CHANNELS_8800];	/*  for readback of caldac */
-	unsigned int trimpot_value[NUM_CHANNELS_8402];	/*  for readback of trimpot */
+	/* remember what the analog outputs are set to, to allow readback */
+	int ao_value[2];
+	/* for readback of caldac */
+	unsigned int caldac_value[NUM_CHANNELS_8800];
+	/* for readback of trimpot */
+	unsigned int trimpot_value[NUM_CHANNELS_8402];
 	unsigned int dac08_value;
 	unsigned int calibration_source;
 };
@@ -680,7 +722,10 @@ found:
 		s->type = COMEDI_SUBD_AO;
 		s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_GROUND;
 		s->n_chan = thisboard->ao_nchan;
-		/*  analog out resolution is the same as analog input resolution, so use ai_bits */
+		/*
+		 * analog out resolution is the same as analog
+		 * input resolution, so use ai_bits
+		 */
 		s->maxdata = (1 << thisboard->ai_bits) - 1;
 		s->range_table = &cb_pcidas_ao_ranges;
 		s->insn_read = cb_pcidas_ao_readback_insn;
@@ -781,7 +826,8 @@ static int cb_pcidas_detach(struct comedi_device *dev)
 			outl(INTCSR_INBOX_INTR_STATUS,
 			     devpriv->s5933_config + AMCC_OP_REG_INTCSR);
 			dev_dbg(&pcidev->dev, "detaching, incsr is 0x%x\n",
-				inl(devpriv->s5933_config + AMCC_OP_REG_INTCSR));
+				inl(devpriv->s5933_config +
+					AMCC_OP_REG_INTCSR));
 		}
 	}
 	if (dev->irq)
@@ -947,7 +993,10 @@ static int cb_pcidas_ao_fifo_winsn(struct comedi_device *dev,
 }
 
 /* analog output readback insn */
-/* XXX loses track of analog output value back after an analog ouput command is executed */
+/*
+ * XXX loses track of analog output value back after
+ * an analog ouput command is executed
+ */
 static int cb_pcidas_ao_readback_insn(struct comedi_device *dev,
 				      struct comedi_subdevice *s,
 				      struct comedi_insn *insn,
@@ -1117,7 +1166,9 @@ static int cb_pcidas_ai_cmdtest(struct comedi_device *dev,
 	if (err)
 		return 1;
 
-	/* step 2: make sure trigger sources are unique and mutually compatible */
+	/*
+	 * step 2: make sure trigger sources are unique and mutually compatible
+	 */
 
 	if (cmd->start_src != TRIG_NOW && cmd->start_src != TRIG_EXT)
 		err++;
@@ -1301,11 +1352,14 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
 	devpriv->adc_fifo_bits &= ~INT_MASK;
 	if (cmd->flags & TRIG_WAKE_EOS) {
 		if (cmd->convert_src == TRIG_NOW && cmd->chanlist_len > 1)
-			devpriv->adc_fifo_bits |= INT_EOS;	/*  interrupt end of burst */
+			/* interrupt end of burst */
+			devpriv->adc_fifo_bits |= INT_EOS;
 		else
-			devpriv->adc_fifo_bits |= INT_FNE;	/*  interrupt fifo not empty */
+			/*  interrupt fifo not empty */
+			devpriv->adc_fifo_bits |= INT_FNE;
 	} else {
-		devpriv->adc_fifo_bits |= INT_FHF;	/* interrupt fifo half full */
+		/* interrupt fifo half full */
+		devpriv->adc_fifo_bits |= INT_FHF;
 	}
 	dev_dbg(&pcidev->dev, "comedi: adc_fifo_bits are 0x%x\n",
 		devpriv->adc_fifo_bits);
@@ -1382,7 +1436,9 @@ static int cb_pcidas_ao_cmdtest(struct comedi_device *dev,
 	if (err)
 		return 1;
 
-	/* step 2: make sure trigger sources are unique and mutually compatible */
+	/*
+	 * step 2: make sure trigger sources are unique and mutually compatible
+	 */
 
 	if (cmd->scan_begin_src != TRIG_TIMER &&
 	    cmd->scan_begin_src != TRIG_EXT)
-- 
1.7.6.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/9] Staging: comedi: fix printk issue in cb_pcidda.c
  2011-09-30 13:18 ` [PATCH 2/9] Staging: comedi: fix printk issue in cb_pcidda.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-01 15:05   ` Dan Carpenter
  0 siblings, 0 replies; 14+ messages in thread
From: Dan Carpenter @ 2011-10-01 15:05 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya; +Cc: gregkh, wfp5p, devel, linux-kernel

On Fri, Sep 30, 2011 at 06:48:20PM +0530, Ravishankar Karkala Mallikarjunayya wrote:
> @@ -377,12 +379,8 @@ found:
>  	s = dev->subdevices + 2;
>  	subdev_8255_init(dev, s, NULL, devpriv->digitalio + PORT2A);
>  
> -	printk(" eeprom:");
> -	for (index = 0; index < EEPROM_SIZE; index++) {
> +	for (index = 0; index < EEPROM_SIZE; index++)
>  		devpriv->eeprom_data[index] = cb_pcidda_read_eeprom(dev, index);
> -		printk(" %i:0x%x ", index, devpriv->eeprom_data[index]);
> -	}
> -	printk("\n");
>  

This wasn't mentioned in the change log.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/9] Staging: comedi: fix printk issue in cb_pcidas.c
  2011-09-30 13:18 ` [PATCH 3/9] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-01 15:09   ` Dan Carpenter
  2011-10-03 23:30   ` Ryan Mallon
  1 sibling, 0 replies; 14+ messages in thread
From: Dan Carpenter @ 2011-10-01 15:09 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya; +Cc: gregkh, wfp5p, devel, linux-kernel

On Fri, Sep 30, 2011 at 06:48:21PM +0530, Ravishankar Karkala Mallikarjunayya wrote:
>  	if (comedi_pci_enable(pcidev, "cb_pcidas")) {
> -		printk(" Failed to enable PCI device and request regions\n");
> +		dev_err(&pcidev->dev, " Failed to enable PCI "
                                       ^
This space isn't needed any more now that it's at the start of a
line.

> +			"device and request regions\n");
>  		return -EIO;

I'm not going to review the remaining 6 patches.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/9] Staging: comedi: fix printk  issue in cb_pcidio.c
  2011-09-30 13:18 [PATCH 1/9] Staging: comedi: fix printk issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
                   ` (7 preceding siblings ...)
  2011-09-30 13:18 ` [PATCH 9/9] Staging: comedi: fix line over 80 character " Ravishankar Karkala Mallikarjunayya
@ 2011-10-03 23:27 ` Ryan Mallon
  8 siblings, 0 replies; 14+ messages in thread
From: Ryan Mallon @ 2011-10-03 23:27 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya; +Cc: gregkh, wfp5p, devel, linux-kernel

On 30/09/11 23:18, Ravishankar Karkala Mallikarjunayya wrote:

> This is a patch to the cb_pcidio.c file that fixes up a printk warning found by the checkpatch.pl tool
> 
> Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
> ---
>  drivers/staging/comedi/drivers/cb_pcidio.c |   27 +++++++++++++++------------
>  1 files changed, 15 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/cb_pcidio.c b/drivers/staging/comedi/drivers/cb_pcidio.c
> index 79477a5..85cc78d 100644
> --- a/drivers/staging/comedi/drivers/cb_pcidio.c
> +++ b/drivers/staging/comedi/drivers/cb_pcidio.c
> @@ -184,7 +184,8 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>  	int index;
>  	int i;
>  
> -	printk("comedi%d: cb_pcidio: \n", dev->minor);
> +	dev_info(&pcidev->dev, "comedi%d: cb_pcidio:\n",
> +		dev->minor);
>  
>  /*
>   * Allocate the private structure area.  alloc_private() is a
> @@ -223,8 +224,9 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>  		}
>  	}
>  
> -	printk("No supported ComputerBoards/MeasurementComputing card found on "
> -	       "requested position\n");
> +	dev_err(&pcidev->dev, "No supported"
> +		" ComputerBoards/MeasurementComputing"
> +		" card found on requested position\n");


printk strings should be on a single line (80 column rule doesn't apply)
so that they can be easily grepped for. There are many instances which
need to be fixed in this series.

~Ryan

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/9] Staging: comedi: fix printk issue in cb_pcidas.c
  2011-09-30 13:18 ` [PATCH 3/9] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
  2011-10-01 15:09   ` Dan Carpenter
@ 2011-10-03 23:30   ` Ryan Mallon
  2011-10-04  0:57     ` Joe Perches
  1 sibling, 1 reply; 14+ messages in thread
From: Ryan Mallon @ 2011-10-03 23:30 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya; +Cc: gregkh, wfp5p, devel, linux-kernel

On 30/09/11 23:18, Ravishankar Karkala Mallikarjunayya wrote:

> This is a patch to the cb_pcidas.c file that fixes up a printk warning found by the checkpatch.pl tool
> 
> Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
> ---
>  drivers/staging/comedi/drivers/cb_pcidas.c |   21 +++++++++++++--------
>  1 files changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c
> index 9dec153..9d16c6c 100644
> --- a/drivers/staging/comedi/drivers/cb_pcidas.c
> +++ b/drivers/staging/comedi/drivers/cb_pcidas.c
> @@ -565,7 +565,8 @@ static int cb_pcidas_attach(struct comedi_device *dev,
>  	int index;
>  	int i;
>  
> -	pr_info("comedi%d: cb_pcidas: ", dev->minor);
> +	dev_info(&pcidev->dev, "comedi%d: cb_pcidas:\n",
> +		dev->minor);

This printk can probably be removed now. It's just noise. Similar in
other places too.

~Ryan

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/9] Staging: comedi: fix printk issue in cb_pcidas.c
  2011-10-03 23:30   ` Ryan Mallon
@ 2011-10-04  0:57     ` Joe Perches
  0 siblings, 0 replies; 14+ messages in thread
From: Joe Perches @ 2011-10-04  0:57 UTC (permalink / raw)
  To: Ryan Mallon, Dan Carpenter
  Cc: Ravishankar Karkala Mallikarjunayya, devel, gregkh, linux-kernel

On Tue, 2011-10-04 at 10:30 +1100, Ryan Mallon wrote:
> On 30/09/11 23:18, Ravishankar Karkala Mallikarjunayya wrote:
> 
> > This is a patch to the cb_pcidas.c file that fixes up a printk warning found by the checkpatch.pl tool
> > 
> > Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
> > ---
> >  drivers/staging/comedi/drivers/cb_pcidas.c |   21 +++++++++++++--------
> >  1 files changed, 13 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c
> > index 9dec153..9d16c6c 100644
> > --- a/drivers/staging/comedi/drivers/cb_pcidas.c
> > +++ b/drivers/staging/comedi/drivers/cb_pcidas.c
> > @@ -565,7 +565,8 @@ static int cb_pcidas_attach(struct comedi_device *dev,
> >  	int index;
> >  	int i;
> >  
> > -	pr_info("comedi%d: cb_pcidas: ", dev->minor);
> > +	dev_info(&pcidev->dev, "comedi%d: cb_pcidas:\n",
> > +		dev->minor);
> 
> This printk can probably be removed now. It's just noise. Similar in
> other places too.

Looking a bit further at the patch and the function it
modifies, it converts dev->minor to &pcidev->dev.  In the
function, pcidev is initialized to NULL a couple of lines
before the dev_info so this proposed patch is truly broken.

I've now officially given up looking at comedi printk cleanups.

Most of the proposed patches have very high error rates and
the submitters don't seem to want to improve their submissions
or lower their error rate significantly.

I could probably fix the whole thing correctly in an afternoon.

I'd add and use comedi_<level> functions that Greg doesn't like
and until Greg changes his mind, I won't bother.



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-10-04  0:57 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-30 13:18 [PATCH 1/9] Staging: comedi: fix printk issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
2011-09-30 13:18 ` [PATCH 2/9] Staging: comedi: fix printk issue in cb_pcidda.c Ravishankar Karkala Mallikarjunayya
2011-10-01 15:05   ` Dan Carpenter
2011-09-30 13:18 ` [PATCH 3/9] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
2011-10-01 15:09   ` Dan Carpenter
2011-10-03 23:30   ` Ryan Mallon
2011-10-04  0:57     ` Joe Perches
2011-09-30 13:18 ` [PATCH 4/9] Staging: comedi: fix printk issue in cb_pcidas64.c Ravishankar Karkala Mallikarjunayya
2011-09-30 13:18 ` [PATCH 5/9] Staging: comedi: fix printk issue in cb_pcimdas.c Ravishankar Karkala Mallikarjunayya
2011-09-30 13:18 ` [PATCH 6/9] Staging: comedi: fix line over 80 character issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
2011-09-30 13:18 ` [PATCH 7/9] Staging: comedi: fix line over 80 character issue in cb_pcidda.c Ravishankar Karkala Mallikarjunayya
2011-09-30 13:18 ` [PATCH 8/9] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
2011-09-30 13:18 ` [PATCH 9/9] Staging: comedi: fix line over 80 character " Ravishankar Karkala Mallikarjunayya
2011-10-03 23:27 ` [PATCH 1/9] Staging: comedi: fix printk issue in cb_pcidio.c Ryan Mallon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).