Updated: [PATCH] staging: comedi: CodingStyle cleanup for drivers/acl7225b.c
Updated based on feedback from Joe, thanks Joe!
-- brucej
---------------
Cleanup the printk's in this driver to use KERN_foo log levels.
--- drivers/staging/comedi/drivers/acl7225b.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
drivers/staging/comedi/drivers/acl7225b.c +3 -5
@@ -94,10 +94,10 @@ static int acl7225b_attach(struct comedi_device *dev, iobase = it->options[0 ]; iorange = this_board->io_range; -printk ("comedi%d: acl7225b: board=%s 0x%04x " , dev->minor, +printk (KERN_INFO "comedi%d: acl7225b: board=%s 0x%04x\n" , dev->minor, this_board->name, iobase);if (!request_region (iobase, iorange,"acl7225b" )) { -printk ("I/O port conflict\n" ); +printk (KERN_CONT "I/O port conflict\n" );return -EIO ; } dev->board_name = this_board->name;
@@ -137,14 +137,12 @@ static int acl7225b_attach(struct comedi_device *dev, s->range_table = &range_digital; s->private = (void *)ACL7225_DI_LO ; -printk ("\n" ); -return 0 ; }static int acl7225b_detach (struct comedi_device *dev) { -printk ("comedi%d: acl7225b: remove\n" , dev->minor); +printk (KERN_INFO "comedi%d: acl7225b: remove\n" , dev->minor);if (dev->iobase)release_region (dev->iobase, this_board->io_range);
Signature · 1 line
1.6.5.rc2
drivers/staging/comedi/drivers/acl7225b.c static int acl7225b_attach(struct comedi_device *dev, · line 100
Quoted 7 lines · Bruce Jones
Cleanup the printk's in this driver to use
KERN_foolog levels.drivers/staging/comedi/drivers/acl7225b.c +2
-1+printk (KERN_INFO "comedi%d: acl7225b: board=%s 0x%04x\n" , dev->minor, this_board->name, iobase);if (!request_region (iobase, iorange,"acl7225b" )) { -printk ("I/O port conflict\n" ); +printk (KERN_CONT "I/O port conflict\n" );
This should not be KERN_CONT but KERN_INFO or KERN_ERR and should probably have a "comedi%d:" leader.
Maybe:
printk(KERN_ERR "comedi%d: request_region failed - I/O port conflict\n");
cheers, Joe
Quoted 12 lines · Joe Perches
Review
Quoted 7 lines · Bruce Jones
Cleanup the printk's in this driver to use
KERN_foolog levels.(quoted diff) +2
-1+ printk(KERN_INFO "comedi%d: acl7225b: board=%s 0x%04x\n", dev->minor, this_board->name, iobase); if (!request_region(iobase, iorange, "acl7225b")) { - printk("I/O port conflict\n"); + printk(KERN_CONT "I/O port conflict\n");This should not be
KERN_CONTbutKERN_INFOorKERN_ERRand should probably have a "comedi%d:" leader.
Quoted 4 lines
Maybe:
printk(KERN_ERR "comedi%d: request_region failed - I/O port conflict\n");cheers, Joe
Joe, thanks! Greg, here's an updated patch.
-- brucej
------------------
Clean up the printk's in this driver.
Signed-off-by Bruce Jones <[email protected]>
--- drivers/staging/comedi/drivers/acl7225b.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-)
drivers/staging/comedi/drivers/acl7225b.c +4 -5
@@ -94,10 +94,11 @@ static int acl7225b_attach(struct comedi_device *dev, iobase = it->options[0 ]; iorange = this_board->io_range; -printk ("comedi%d: acl7225b: board=%s 0x%04x " , dev->minor, +printk (KERN_INFO "comedi%d: acl7225b: board=%s 0x%04x\n" , dev->minor, this_board->name, iobase);if (!request_region (iobase, iorange,"acl7225b" )) { -printk ("I/O port conflict\n" ); +printk (KERN_ERR "comedi%d: request_region failed - I/O port conflict\n" , + dev->minor);return -EIO ; } dev->board_name = this_board->name;
@@ -137,14 +138,12 @@ static int acl7225b_attach(struct comedi_device *dev, s->range_table = &range_digital; s->private = (void *)ACL7225_DI_LO ; -printk ("\n" ); -return 0 ; }static int acl7225b_detach (struct comedi_device *dev) { -printk ("comedi%d: acl7225b: remove\n" , dev->minor); +printk (KERN_INFO "comedi%d: acl7225b: remove\n" , dev->minor);if (dev->iobase)release_region (dev->iobase, this_board->io_range);
Signature · 1 line
1.6.5.rc2