linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c
@ 2012-10-10 12:20 YAMANE Toshiaki
  2012-10-22 19:52 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 9+ messages in thread
From: YAMANE Toshiaki @ 2012-10-10 12:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Ian Abbott, Frank Mori Hess, linux-kernel, YAMANE Toshiaki

fixed below checkpatch warning.
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...

and added pr_fmt.

Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
---
 drivers/staging/comedi/drivers/gsc_hpdi.c |   31 +++++++++++++++--------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c b/drivers/staging/comedi/drivers/gsc_hpdi.c
index abff660..30a27fd 100644
--- a/drivers/staging/comedi/drivers/gsc_hpdi.c
+++ b/drivers/staging/comedi/drivers/gsc_hpdi.c
@@ -45,6 +45,8 @@ support could be added to this driver.
 
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/interrupt.h>
 #include "../comedidev.h"
 #include <linux/delay.h>
@@ -107,8 +109,7 @@ enum hpdi_registers {
 int command_channel_valid(unsigned int channel)
 {
 	if (channel == 0 || channel > 6) {
-		printk(KERN_WARNING
-		       "gsc_hpdi: bug! invalid cable command channel\n");
+		pr_warn("bug! invalid cable command channel\n");
 		return 0;
 	}
 	return 1;
@@ -553,7 +554,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	int i;
 	int retval;
 
-	printk(KERN_WARNING "comedi%d: gsc_hpdi\n", dev->minor);
+	dev_warn(dev->class_dev, "gsc_hpdi\n");
 
 	if (alloc_private(dev, sizeof(struct hpdi_private)) < 0)
 		return -ENOMEM;
@@ -582,17 +583,17 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		} while (pcidev != NULL);
 	}
 	if (dev->board_ptr == NULL) {
-		printk(KERN_WARNING "gsc_hpdi: no hpdi card found\n");
+		dev_warn(dev->class_dev, "no hpdi card found\n");
 		return -EIO;
 	}
 
-	printk(KERN_WARNING
-	       "gsc_hpdi: found %s on bus %i, slot %i\n", board(dev)->name,
-	       pcidev->bus->number, PCI_SLOT(pcidev->devfn));
+	dev_warn(dev->class_dev,
+		 "found %s on bus %i, slot %i\n", board(dev)->name,
+		 pcidev->bus->number, PCI_SLOT(pcidev->devfn));
 
 	if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
-		printk(KERN_WARNING
-		       " failed enable PCI device and request regions\n");
+		dev_warn(dev->class_dev,
+			 " failed enable PCI device and request regions\n");
 		return -EIO;
 	}
 	pci_set_master(pcidev);
@@ -613,7 +614,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	    ioremap(priv(dev)->hpdi_phys_iobase,
 		    pci_resource_len(pcidev, HPDI_BADDRINDEX));
 	if (!priv(dev)->plx9080_iobase || !priv(dev)->hpdi_iobase) {
-		printk(KERN_WARNING " failed to remap io memory\n");
+		dev_warn(dev->class_dev, "failed to remap io memory\n");
 		return -ENOMEM;
 	}
 
@@ -625,13 +626,13 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	/*  get irq */
 	if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
 			dev->driver->driver_name, dev)) {
-		printk(KERN_WARNING
-		       " unable to allocate irq %u\n", pcidev->irq);
+		dev_warn(dev->class_dev,
+			 "unable to allocate irq %u\n", pcidev->irq);
 		return -EINVAL;
 	}
 	dev->irq = pcidev->irq;
 
-	printk(KERN_WARNING " irq %u\n", dev->irq);
+	dev_warn(dev->class_dev, "irq %u\n", dev->irq);
 
 	/*  allocate pci dma buffers */
 	for (i = 0; i < NUM_DMA_BUFFERS; i++) {
@@ -649,8 +650,8 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 						   &priv(dev)->
 						   dma_desc_phys_addr);
 	if (priv(dev)->dma_desc_phys_addr & 0xf) {
-		printk(KERN_WARNING
-		       " dma descriptors not quad-word aligned (bug)\n");
+		dev_warn(dev->class_dev,
+			 "dma descriptors not quad-word aligned (bug)\n");
 		return -EIO;
 	}
 
-- 
1.7.9.5


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

* Re: [PATCH] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c
  2012-10-10 12:20 [PATCH] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c YAMANE Toshiaki
@ 2012-10-22 19:52 ` Greg Kroah-Hartman
  2012-10-25  2:23   ` [PATCH v2] " YAMANE Toshiaki
  2012-10-25 10:50   ` [PATCH] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c Toshiaki Yamane
  0 siblings, 2 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2012-10-22 19:52 UTC (permalink / raw)
  To: YAMANE Toshiaki; +Cc: Ian Abbott, Frank Mori Hess, linux-kernel

On Wed, Oct 10, 2012 at 09:20:59PM +0900, YAMANE Toshiaki wrote:
> fixed below checkpatch warning.
> - WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...
> 
> and added pr_fmt.
> 
> Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
> ---
>  drivers/staging/comedi/drivers/gsc_hpdi.c |   31 +++++++++++++++--------------
>  1 file changed, 16 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c b/drivers/staging/comedi/drivers/gsc_hpdi.c
> index abff660..30a27fd 100644
> --- a/drivers/staging/comedi/drivers/gsc_hpdi.c
> +++ b/drivers/staging/comedi/drivers/gsc_hpdi.c
> @@ -45,6 +45,8 @@ support could be added to this driver.
>  
>  */
>  
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/interrupt.h>
>  #include "../comedidev.h"
>  #include <linux/delay.h>
> @@ -107,8 +109,7 @@ enum hpdi_registers {
>  int command_channel_valid(unsigned int channel)
>  {
>  	if (channel == 0 || channel > 6) {
> -		printk(KERN_WARNING
> -		       "gsc_hpdi: bug! invalid cable command channel\n");
> +		pr_warn("bug! invalid cable command channel\n");
>  		return 0;
>  	}
>  	return 1;
> @@ -553,7 +554,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>  	int i;
>  	int retval;
>  
> -	printk(KERN_WARNING "comedi%d: gsc_hpdi\n", dev->minor);
> +	dev_warn(dev->class_dev, "gsc_hpdi\n");

What is this warning about?

>  
>  	if (alloc_private(dev, sizeof(struct hpdi_private)) < 0)
>  		return -ENOMEM;
> @@ -582,17 +583,17 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>  		} while (pcidev != NULL);
>  	}
>  	if (dev->board_ptr == NULL) {
> -		printk(KERN_WARNING "gsc_hpdi: no hpdi card found\n");
> +		dev_warn(dev->class_dev, "no hpdi card found\n");
>  		return -EIO;
>  	}
>  
> -	printk(KERN_WARNING
> -	       "gsc_hpdi: found %s on bus %i, slot %i\n", board(dev)->name,
> -	       pcidev->bus->number, PCI_SLOT(pcidev->devfn));
> +	dev_warn(dev->class_dev,
> +		 "found %s on bus %i, slot %i\n", board(dev)->name,
> +		 pcidev->bus->number, PCI_SLOT(pcidev->devfn));
>  
>  	if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
> -		printk(KERN_WARNING
> -		       " failed enable PCI device and request regions\n");
> +		dev_warn(dev->class_dev,
> +			 " failed enable PCI device and request regions\n");
>  		return -EIO;
>  	}
>  	pci_set_master(pcidev);
> @@ -613,7 +614,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>  	    ioremap(priv(dev)->hpdi_phys_iobase,
>  		    pci_resource_len(pcidev, HPDI_BADDRINDEX));
>  	if (!priv(dev)->plx9080_iobase || !priv(dev)->hpdi_iobase) {
> -		printk(KERN_WARNING " failed to remap io memory\n");
> +		dev_warn(dev->class_dev, "failed to remap io memory\n");
>  		return -ENOMEM;
>  	}
>  
> @@ -625,13 +626,13 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>  	/*  get irq */
>  	if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
>  			dev->driver->driver_name, dev)) {
> -		printk(KERN_WARNING
> -		       " unable to allocate irq %u\n", pcidev->irq);
> +		dev_warn(dev->class_dev,
> +			 "unable to allocate irq %u\n", pcidev->irq);
>  		return -EINVAL;
>  	}
>  	dev->irq = pcidev->irq;
>  
> -	printk(KERN_WARNING " irq %u\n", dev->irq);
> +	dev_warn(dev->class_dev, "irq %u\n", dev->irq);

Again a warning?  Shouldn't most of these be debugging lines instead?

greg k-h

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

* [PATCH v2] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c
  2012-10-22 19:52 ` Greg Kroah-Hartman
@ 2012-10-25  2:23   ` YAMANE Toshiaki
  2012-10-25  2:43     ` Greg Kroah-Hartman
  2012-10-25 10:50   ` [PATCH] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c Toshiaki Yamane
  1 sibling, 1 reply; 9+ messages in thread
From: YAMANE Toshiaki @ 2012-10-25  2:23 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Ian Abbott, Frank Mori Hess, linux-kernel, YAMANE Toshiaki

fixed below checkpatch warning.
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...

some of them have been replaced by dev_dbg or pr_debug,
and added pr_fmt.

Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
---
 drivers/staging/comedi/drivers/gsc_hpdi.c |   31 +++++++++++++++--------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c b/drivers/staging/comedi/drivers/gsc_hpdi.c
index abff660..31d89d5 100644
--- a/drivers/staging/comedi/drivers/gsc_hpdi.c
+++ b/drivers/staging/comedi/drivers/gsc_hpdi.c
@@ -45,6 +45,8 @@ support could be added to this driver.
 
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/interrupt.h>
 #include "../comedidev.h"
 #include <linux/delay.h>
@@ -107,8 +109,7 @@ enum hpdi_registers {
 int command_channel_valid(unsigned int channel)
 {
 	if (channel == 0 || channel > 6) {
-		printk(KERN_WARNING
-		       "gsc_hpdi: bug! invalid cable command channel\n");
+		pr_debug("bug! invalid cable command channel\n");
 		return 0;
 	}
 	return 1;
@@ -553,7 +554,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	int i;
 	int retval;
 
-	printk(KERN_WARNING "comedi%d: gsc_hpdi\n", dev->minor);
+	dev_dbg(dev->class_dev, "gsc_hpdi\n");
 
 	if (alloc_private(dev, sizeof(struct hpdi_private)) < 0)
 		return -ENOMEM;
@@ -582,17 +583,17 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		} while (pcidev != NULL);
 	}
 	if (dev->board_ptr == NULL) {
-		printk(KERN_WARNING "gsc_hpdi: no hpdi card found\n");
+		dev_warn(dev->class_dev, "no hpdi card found\n");
 		return -EIO;
 	}
 
-	printk(KERN_WARNING
-	       "gsc_hpdi: found %s on bus %i, slot %i\n", board(dev)->name,
-	       pcidev->bus->number, PCI_SLOT(pcidev->devfn));
+	dev_dbg(dev->class_dev,
+		"found %s on bus %i, slot %i\n", board(dev)->name,
+		pcidev->bus->number, PCI_SLOT(pcidev->devfn));
 
 	if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
-		printk(KERN_WARNING
-		       " failed enable PCI device and request regions\n");
+		dev_warn(dev->class_dev,
+			 " failed enable PCI device and request regions\n");
 		return -EIO;
 	}
 	pci_set_master(pcidev);
@@ -613,7 +614,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	    ioremap(priv(dev)->hpdi_phys_iobase,
 		    pci_resource_len(pcidev, HPDI_BADDRINDEX));
 	if (!priv(dev)->plx9080_iobase || !priv(dev)->hpdi_iobase) {
-		printk(KERN_WARNING " failed to remap io memory\n");
+		dev_warn(dev->class_dev, "failed to remap io memory\n");
 		return -ENOMEM;
 	}
 
@@ -625,13 +626,13 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	/*  get irq */
 	if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
 			dev->driver->driver_name, dev)) {
-		printk(KERN_WARNING
-		       " unable to allocate irq %u\n", pcidev->irq);
+		dev_warn(dev->class_dev,
+			 "unable to allocate irq %u\n", pcidev->irq);
 		return -EINVAL;
 	}
 	dev->irq = pcidev->irq;
 
-	printk(KERN_WARNING " irq %u\n", dev->irq);
+	dev_dbg(dev->class_dev, "irq %u\n", dev->irq);
 
 	/*  allocate pci dma buffers */
 	for (i = 0; i < NUM_DMA_BUFFERS; i++) {
@@ -649,8 +650,8 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 						   &priv(dev)->
 						   dma_desc_phys_addr);
 	if (priv(dev)->dma_desc_phys_addr & 0xf) {
-		printk(KERN_WARNING
-		       " dma descriptors not quad-word aligned (bug)\n");
+		dev_warn(dev->class_dev,
+			 "dma descriptors not quad-word aligned (bug)\n");
 		return -EIO;
 	}
 
-- 
1.7.9.5


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

* Re: [PATCH v2] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c
  2012-10-25  2:23   ` [PATCH v2] " YAMANE Toshiaki
@ 2012-10-25  2:43     ` Greg Kroah-Hartman
  2012-10-25  2:46       ` Toshiaki Yamane
  2012-10-25 11:12       ` [PATCH v3] " YAMANE Toshiaki
  0 siblings, 2 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2012-10-25  2:43 UTC (permalink / raw)
  To: YAMANE Toshiaki; +Cc: Ian Abbott, Frank Mori Hess, linux-kernel

On Thu, Oct 25, 2012 at 11:23:13AM +0900, YAMANE Toshiaki wrote:
> fixed below checkpatch warning.
> - WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...
> 
> some of them have been replaced by dev_dbg or pr_debug,
> and added pr_fmt.
> 
> Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>

This patch doesn't apply, can you redo it against the next linux-next
release and resend it?

thanks,

greg k-h

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

* Re: [PATCH v2] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c
  2012-10-25  2:43     ` Greg Kroah-Hartman
@ 2012-10-25  2:46       ` Toshiaki Yamane
  2012-10-25 11:12       ` [PATCH v3] " YAMANE Toshiaki
  1 sibling, 0 replies; 9+ messages in thread
From: Toshiaki Yamane @ 2012-10-25  2:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Ian Abbott, Frank Mori Hess, linux-kernel

On Thu, Oct 25, 2012 at 11:43 AM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Thu, Oct 25, 2012 at 11:23:13AM +0900, YAMANE Toshiaki wrote:
>> fixed below checkpatch warning.
>> - WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...
>>
>> some of them have been replaced by dev_dbg or pr_debug,
>> and added pr_fmt.
>>
>> Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
>
> This patch doesn't apply, can you redo it against the next linux-next
> release and resend it?

Yes, thanks.


-- 

Regards,

YAMANE Toshiaki

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

* Re: [PATCH] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c
  2012-10-22 19:52 ` Greg Kroah-Hartman
  2012-10-25  2:23   ` [PATCH v2] " YAMANE Toshiaki
@ 2012-10-25 10:50   ` Toshiaki Yamane
  1 sibling, 0 replies; 9+ messages in thread
From: Toshiaki Yamane @ 2012-10-25 10:50 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Ian Abbott, Frank Mori Hess, linux-kernel

On Tue, Oct 23, 2012 at 4:52 AM, Greg Kroah-Hartman <greg@kroah.com> wrote:
> On Wed, Oct 10, 2012 at 09:20:59PM +0900, YAMANE Toshiaki wrote:
>> fixed below checkpatch warning.
>> - WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...
>>
>> and added pr_fmt.
>>
>> Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
>> ---
>>  drivers/staging/comedi/drivers/gsc_hpdi.c |   31 +++++++++++++++--------------
>>  1 file changed, 16 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c b/drivers/staging/comedi/drivers/gsc_hpdi.c
>> index abff660..30a27fd 100644
>> --- a/drivers/staging/comedi/drivers/gsc_hpdi.c
>> +++ b/drivers/staging/comedi/drivers/gsc_hpdi.c
>> @@ -45,6 +45,8 @@ support could be added to this driver.
>>
>>  */
>>
>> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>> +
>>  #include <linux/interrupt.h>
>>  #include "../comedidev.h"
>>  #include <linux/delay.h>
>> @@ -107,8 +109,7 @@ enum hpdi_registers {
>>  int command_channel_valid(unsigned int channel)
>>  {
>>       if (channel == 0 || channel > 6) {
>> -             printk(KERN_WARNING
>> -                    "gsc_hpdi: bug! invalid cable command channel\n");
>> +             pr_warn("bug! invalid cable command channel\n");
>>               return 0;
>>       }
>>       return 1;
>> @@ -553,7 +554,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>>       int i;
>>       int retval;
>>
>> -     printk(KERN_WARNING "comedi%d: gsc_hpdi\n", dev->minor);
>> +     dev_warn(dev->class_dev, "gsc_hpdi\n");
>
> What is this warning about?
>
>>
>>       if (alloc_private(dev, sizeof(struct hpdi_private)) < 0)
>>               return -ENOMEM;
>> @@ -582,17 +583,17 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>>               } while (pcidev != NULL);
>>       }
>>       if (dev->board_ptr == NULL) {
>> -             printk(KERN_WARNING "gsc_hpdi: no hpdi card found\n");
>> +             dev_warn(dev->class_dev, "no hpdi card found\n");
>>               return -EIO;
>>       }
>>
>> -     printk(KERN_WARNING
>> -            "gsc_hpdi: found %s on bus %i, slot %i\n", board(dev)->name,
>> -            pcidev->bus->number, PCI_SLOT(pcidev->devfn));
>> +     dev_warn(dev->class_dev,
>> +              "found %s on bus %i, slot %i\n", board(dev)->name,
>> +              pcidev->bus->number, PCI_SLOT(pcidev->devfn));
>>
>>       if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
>> -             printk(KERN_WARNING
>> -                    " failed enable PCI device and request regions\n");
>> +             dev_warn(dev->class_dev,
>> +                      " failed enable PCI device and request regions\n");
>>               return -EIO;
>>       }
>>       pci_set_master(pcidev);
>> @@ -613,7 +614,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>>           ioremap(priv(dev)->hpdi_phys_iobase,
>>                   pci_resource_len(pcidev, HPDI_BADDRINDEX));
>>       if (!priv(dev)->plx9080_iobase || !priv(dev)->hpdi_iobase) {
>> -             printk(KERN_WARNING " failed to remap io memory\n");
>> +             dev_warn(dev->class_dev, "failed to remap io memory\n");
>>               return -ENOMEM;
>>       }
>>
>> @@ -625,13 +626,13 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>>       /*  get irq */
>>       if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
>>                       dev->driver->driver_name, dev)) {
>> -             printk(KERN_WARNING
>> -                    " unable to allocate irq %u\n", pcidev->irq);
>> +             dev_warn(dev->class_dev,
>> +                      "unable to allocate irq %u\n", pcidev->irq);
>>               return -EINVAL;
>>       }
>>       dev->irq = pcidev->irq;
>>
>> -     printk(KERN_WARNING " irq %u\n", dev->irq);
>> +     dev_warn(dev->class_dev, "irq %u\n", dev->irq);
>
> Again a warning?  Shouldn't most of these be debugging lines instead?
>
> greg k-h

Only two points above should be in debugging line?
Should it modify dev_dbg on 589 also?

>> -     printk(KERN_WARNING
>> -            "gsc_hpdi: found %s on bus %i, slot %i\n", board(dev)->name,
>> -            pcidev->bus->number, PCI_SLOT(pcidev->devfn));
>> +     dev_warn(dev->class_dev,
>> +              "found %s on bus %i, slot %i\n", board(dev)->name,
>> +              pcidev->bus->number, PCI_SLOT(pcidev->devfn));

I am grad to tell me why.

And I will resend the patch only two points are in debugging line.

-- 

Regards,

YAMANE Toshiaki

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

* [PATCH v3] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c
  2012-10-25  2:43     ` Greg Kroah-Hartman
  2012-10-25  2:46       ` Toshiaki Yamane
@ 2012-10-25 11:12       ` YAMANE Toshiaki
  2012-10-25 19:24         ` Greg Kroah-Hartman
  1 sibling, 1 reply; 9+ messages in thread
From: YAMANE Toshiaki @ 2012-10-25 11:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Ian Abbott, Frank Mori Hess, linux-kernel, YAMANE Toshiaki

fixed below checkpatch warning.
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...

some of them have been replaced by dev_dbg,
and added pr_fmt.

Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
---
 drivers/staging/comedi/drivers/gsc_hpdi.c |   31 +++++++++++++++--------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c b/drivers/staging/comedi/drivers/gsc_hpdi.c
index abff660..a9d4372 100644
--- a/drivers/staging/comedi/drivers/gsc_hpdi.c
+++ b/drivers/staging/comedi/drivers/gsc_hpdi.c
@@ -45,6 +45,8 @@ support could be added to this driver.
 
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/interrupt.h>
 #include "../comedidev.h"
 #include <linux/delay.h>
@@ -107,8 +109,7 @@ enum hpdi_registers {
 int command_channel_valid(unsigned int channel)
 {
 	if (channel == 0 || channel > 6) {
-		printk(KERN_WARNING
-		       "gsc_hpdi: bug! invalid cable command channel\n");
+		pr_warn("bug! invalid cable command channel\n");
 		return 0;
 	}
 	return 1;
@@ -553,7 +554,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	int i;
 	int retval;
 
-	printk(KERN_WARNING "comedi%d: gsc_hpdi\n", dev->minor);
+	dev_dbg(dev->class_dev, "gsc_hpdi\n");
 
 	if (alloc_private(dev, sizeof(struct hpdi_private)) < 0)
 		return -ENOMEM;
@@ -582,17 +583,17 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		} while (pcidev != NULL);
 	}
 	if (dev->board_ptr == NULL) {
-		printk(KERN_WARNING "gsc_hpdi: no hpdi card found\n");
+		dev_warn(dev->class_dev, "no hpdi card found\n");
 		return -EIO;
 	}
 
-	printk(KERN_WARNING
-	       "gsc_hpdi: found %s on bus %i, slot %i\n", board(dev)->name,
-	       pcidev->bus->number, PCI_SLOT(pcidev->devfn));
+	dev_warn(dev->class_dev,
+		 "found %s on bus %i, slot %i\n", board(dev)->name,
+		 pcidev->bus->number, PCI_SLOT(pcidev->devfn));
 
 	if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
-		printk(KERN_WARNING
-		       " failed enable PCI device and request regions\n");
+		dev_warn(dev->class_dev,
+			 " failed enable PCI device and request regions\n");
 		return -EIO;
 	}
 	pci_set_master(pcidev);
@@ -613,7 +614,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	    ioremap(priv(dev)->hpdi_phys_iobase,
 		    pci_resource_len(pcidev, HPDI_BADDRINDEX));
 	if (!priv(dev)->plx9080_iobase || !priv(dev)->hpdi_iobase) {
-		printk(KERN_WARNING " failed to remap io memory\n");
+		dev_warn(dev->class_dev, "failed to remap io memory\n");
 		return -ENOMEM;
 	}
 
@@ -625,13 +626,13 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	/*  get irq */
 	if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
 			dev->driver->driver_name, dev)) {
-		printk(KERN_WARNING
-		       " unable to allocate irq %u\n", pcidev->irq);
+		dev_warn(dev->class_dev,
+			 "unable to allocate irq %u\n", pcidev->irq);
 		return -EINVAL;
 	}
 	dev->irq = pcidev->irq;
 
-	printk(KERN_WARNING " irq %u\n", dev->irq);
+	dev_dbg(dev->class_dev, "irq %u\n", dev->irq);
 
 	/*  allocate pci dma buffers */
 	for (i = 0; i < NUM_DMA_BUFFERS; i++) {
@@ -649,8 +650,8 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 						   &priv(dev)->
 						   dma_desc_phys_addr);
 	if (priv(dev)->dma_desc_phys_addr & 0xf) {
-		printk(KERN_WARNING
-		       " dma descriptors not quad-word aligned (bug)\n");
+		dev_warn(dev->class_dev,
+			 "dma descriptors not quad-word aligned (bug)\n");
 		return -EIO;
 	}
 
-- 
1.7.9.5


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

* Re: [PATCH v3] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c
  2012-10-25 11:12       ` [PATCH v3] " YAMANE Toshiaki
@ 2012-10-25 19:24         ` Greg Kroah-Hartman
  2012-10-26  0:21           ` [PATCH v4] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hpdi.c YAMANE Toshiaki
  0 siblings, 1 reply; 9+ messages in thread
From: Greg Kroah-Hartman @ 2012-10-25 19:24 UTC (permalink / raw)
  To: YAMANE Toshiaki; +Cc: Ian Abbott, Frank Mori Hess, linux-kernel

On Thu, Oct 25, 2012 at 08:12:26PM +0900, YAMANE Toshiaki wrote:
> fixed below checkpatch warning.
> - WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...
> 
> some of them have been replaced by dev_dbg,
> and added pr_fmt.
> 
> Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
> ---
>  drivers/staging/comedi/drivers/gsc_hpdi.c |   31 +++++++++++++++--------------
>  1 file changed, 16 insertions(+), 15 deletions(-)

This patch does not apply against my tree, can you please redo it
against the latest linux-next release and resend it?

thanks,

greg k-h

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

* [PATCH v4] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hpdi.c
  2012-10-25 19:24         ` Greg Kroah-Hartman
@ 2012-10-26  0:21           ` YAMANE Toshiaki
  0 siblings, 0 replies; 9+ messages in thread
From: YAMANE Toshiaki @ 2012-10-26  0:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Ian Abbott, Frank Mori Hess, linux-kernel, YAMANE Toshiaki

fixed below checkpatch warning.
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...

some of them have been replaced by dev_dbg.

Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
---
 drivers/staging/comedi/drivers/gsc_hpdi.c |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c b/drivers/staging/comedi/drivers/gsc_hpdi.c
index 17aec51..4809295 100644
--- a/drivers/staging/comedi/drivers/gsc_hpdi.c
+++ b/drivers/staging/comedi/drivers/gsc_hpdi.c
@@ -479,7 +479,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	int i;
 	int retval;
 
-	printk(KERN_WARNING "comedi%d: gsc_hpdi\n", dev->minor);
+	dev_dbg(dev->class_dev, "gsc_hpdi\n");
 
 	devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
 	if (!devpriv)
@@ -510,17 +510,17 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		} while (pcidev != NULL);
 	}
 	if (dev->board_ptr == NULL) {
-		printk(KERN_WARNING "gsc_hpdi: no hpdi card found\n");
+		dev_warn(dev->class_dev, "no hpdi card found\n");
 		return -EIO;
 	}
 
-	printk(KERN_WARNING
-	       "gsc_hpdi: found %s on bus %i, slot %i\n", board(dev)->name,
-	       pcidev->bus->number, PCI_SLOT(pcidev->devfn));
+	dev_warn(dev->class_dev,
+		 "found %s on bus %i, slot %i\n", board(dev)->name,
+		 pcidev->bus->number, PCI_SLOT(pcidev->devfn));
 
 	if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
-		printk(KERN_WARNING
-		       " failed enable PCI device and request regions\n");
+		dev_warn(dev->class_dev,
+			 "failed enable PCI device and request regions\n");
 		return -EIO;
 	}
 	pci_set_master(pcidev);
@@ -541,7 +541,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	    ioremap(devpriv->hpdi_phys_iobase,
 		    pci_resource_len(pcidev, HPDI_BADDRINDEX));
 	if (!devpriv->plx9080_iobase || !devpriv->hpdi_iobase) {
-		printk(KERN_WARNING " failed to remap io memory\n");
+		dev_warn(dev->class_dev, "failed to remap io memory\n");
 		return -ENOMEM;
 	}
 
@@ -553,13 +553,13 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	/*  get irq */
 	if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
 			dev->driver->driver_name, dev)) {
-		printk(KERN_WARNING
-		       " unable to allocate irq %u\n", pcidev->irq);
+		dev_warn(dev->class_dev,
+			 "unable to allocate irq %u\n", pcidev->irq);
 		return -EINVAL;
 	}
 	dev->irq = pcidev->irq;
 
-	printk(KERN_WARNING " irq %u\n", dev->irq);
+	dev_dbg(dev->class_dev, " irq %u\n", dev->irq);
 
 	/*  allocate pci dma buffers */
 	for (i = 0; i < NUM_DMA_BUFFERS; i++) {
@@ -577,8 +577,8 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 						   &devpriv->
 						   dma_desc_phys_addr);
 	if (devpriv->dma_desc_phys_addr & 0xf) {
-		printk(KERN_WARNING
-		       " dma descriptors not quad-word aligned (bug)\n");
+		dev_warn(dev->class_dev,
+			 " dma descriptors not quad-word aligned (bug)\n");
 		return -EIO;
 	}
 
-- 
1.7.9.5


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

end of thread, other threads:[~2012-10-26  0:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-10 12:20 [PATCH] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c YAMANE Toshiaki
2012-10-22 19:52 ` Greg Kroah-Hartman
2012-10-25  2:23   ` [PATCH v2] " YAMANE Toshiaki
2012-10-25  2:43     ` Greg Kroah-Hartman
2012-10-25  2:46       ` Toshiaki Yamane
2012-10-25 11:12       ` [PATCH v3] " YAMANE Toshiaki
2012-10-25 19:24         ` Greg Kroah-Hartman
2012-10-26  0:21           ` [PATCH v4] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hpdi.c YAMANE Toshiaki
2012-10-25 10:50   ` [PATCH] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c Toshiaki Yamane

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).