Staging: comedi: fix printk issue in adv_pci_dio.c
PATCH 1/1 Staging: comedi: fix printk issue in adv_pci_dio.c
From: Ravishankar <[email protected]>
This is a patch to the adv_pci_dio.c file that fixes up a printk warning found by the checkpatch.pl tool
--- drivers/staging/comedi/drivers/adv_pci_dio.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/comedi/drivers/adv_pci_dio.c +8 -7
@@ -1106,11 +1106,11 @@ static int pci_dio_attach(struct comedi_device *dev,unsigned long iobase;struct pci_dev *pcidev =NULL ; -printk ("comedi%d: adv_pci_dio: " , dev->minor); +printk (KERN_INFO "comedi%d: adv_pci_dio: " , dev->minor); ret =alloc_private (dev,sizeof (struct pci_dio_private ));if (ret <0 ) { -printk (", Error: Cann't allocate private memory!\n" ); +printk (KERN_CONT ", Error: Cann't allocate private memory!\n" );return -ENOMEM ; }
@@ -1140,19 +1140,19 @@ static int pci_dio_attach(struct comedi_device *dev, }if (!dev->board_ptr) { -printk (", Error: Requested type of the card was not found!\n" ); +printk (KERN_ERR ", Error: Requested type of the card was not found!\n" );return -EIO ; }if (comedi_pci_enable (pcidev, driver_pci_dio.driver_name)) {printk - (", Error: Can't enable PCI device and request regions!\n" ); + (KERN_ERR ", Error: Can't enable PCI device and request " +"regions!\n" );return -EIO ; } iobase =pci_resource_start (pcidev, this_board->main_pci_region); -printk (", b:s:f=%d:%d:%d, io=0x%4lx" , - pcidev->bus->number,PCI_SLOT (pcidev->devfn), -PCI_FUNC (pcidev->devfn), iobase); +printk (KERN_INFO ", b:s:f=%d:%d:%d, io=0x%4lx" , + pcidev->bus->number,PCI_SLOT (pcidev->devfn), +PCI_FUNC (pcidev->devfn), iobase); dev->iobase = iobase;
dev->board_name = this_board->name;
@@ -1178,11 +1178,11 @@ static int pci_dio_attach(struct comedi_device *dev,
ret = alloc_subdevices(dev, n_subdevices); if (ret < 0) {
- printk(", Error: Cann't allocate subdevice memory!\n");
+ printk(KERN_CONT ", Error: Cann't allocate subdevice memory!\n");
return ret;
}
- printk(".\n");
+ printk(KERN_CONT ".\n");
subdev = 0;
Signature · 1 line
1.6.5.2
Quoted 57 lines · Ravishankar
From: Ravishankar <[email protected]>
This is a patch to the
adv_pci_dio.cfile that fixes up a printk warning found by the checkpatch.pl toolSigned-off-by Ravishankar <[email protected]>--- drivers/staging/comedi/drivers/adv_pci_dio.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-)drivers/staging/comedi/drivers/adv_pci_dio.c +8
-7@@ -1106,11 +1106,11 @@ static int pci_dio_attach(struct comedi_device *dev,unsigned long iobase;struct pci_dev *pcidev =NULL ; -printk ("comedi%d: adv_pci_dio: " , dev->minor); +printk (KERN_INFO "comedi%d: adv_pci_dio: " , dev->minor); ret =alloc_private (dev,sizeof (struct pci_dio_private ));if (ret <0 ) { -printk (", Error: Cann't allocate private memory!\n" ); +printk (KERN_CONT ", Error: Cann't allocate private memory!\n" );return -ENOMEM ; }@@ -1140,19 +1140,19 @@ static int pci_dio_attach(struct comedi_device *dev, }if (!dev->board_ptr) { -printk (", Error: Requested type of the card was not found!\n" ); +printk (KERN_ERR ", Error: Requested type of the card was not found!\n" );return -EIO ; }if (comedi_pci_enable (pcidev, driver_pci_dio.driver_name)) {printk - (", Error: Can't enable PCI device and request regions!\n" ); + (KERN_ERR ", Error: Can't enable PCI device and request " +"regions!\n" );return -EIO ; } iobase =pci_resource_start (pcidev, this_board->main_pci_region); -printk (", b:s:f=%d:%d:%d, io=0x%4lx" , - pcidev->bus->number,PCI_SLOT (pcidev->devfn), -PCI_FUNC (pcidev->devfn), iobase); +printk (KERN_INFO ", b:s:f=%d:%d:%d, io=0x%4lx" , + pcidev->bus->number,PCI_SLOT (pcidev->devfn), +PCI_FUNC (pcidev->devfn), iobase); dev->iobase = iobase; dev->board_name = this_board->name;@@ -1178,11 +1178,11 @@ static int pci_dio_attach(struct comedi_device *dev, ret =alloc_subdevices (dev, n_subdevices);if (ret <0 ) {
drivers/staging/comedi/drivers/adv_pci_dio.c static int pci_dio_attach(struct comedi_device *dev, · line 1188
Quoted 10 lines
drivers/staging/comedi/drivers/adv_pci_dio.c +2
-2-printk (", Error: Cann't allocate subdevice memory!\n" ); +printk (KERN_CONT ", Error: Cann't allocate subdevice memory!\n" );return ret; } -printk (".\n" ); +printk (KERN_CONT ".\n" ); subdev =0 ;
Ravishankar, you _really_ aren't looking too hard when you do these changes. Your error rate is _quite_ high.
All of these changes are in the same function and are continuations of the initial printk. Every one of these after the first one should use KERN_CONT.
_Please_ look harder before submitting these changes.
Otherwise, I'm going to have to agree with Dan Carpenter.
I'm sure you can do these sorts of trivial changes, but you absolutely _must_ lower your error rate, otherwise you work will be ignored and you will lose whatever reputation you might want to establish within this community.
Best, Joe Perches