Re: [PATCH] staging: comedi: Added log subjects to printk()s inpcmmio

From: Dan Carpenter
Date: Tue Sep 27 2011 - 10:16:32 EST


On Sun, Sep 25, 2011 at 06:49:12AM +0200, Johannes Thumshirn wrote:
> - printk("comedi%d: %s: io: %lx ", dev->minor, driver.driver_name,
> + printk(KERN_INFO "comedi%d: %s: io: %lx ", dev->minor, driver.driver_name,
> iobase);
>
> dev->iobase = iobase;
> @@ -379,7 +379,7 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
> if (!iobase || !request_region(iobase,
> thisboard->total_iosize,
> driver.driver_name)) {
> - printk("I/O port conflict\n");
> + printk(KERN_ERR "I/O port conflict\n");

The KERN_ERR stuff is only supposed to be used at the start of the
line of output. (The previous KERN_INFO printk didn't have a new
line at the end).

All this code needs to be rewritten so each printk() only prints
one line. Otherwise you could get messages printed out in the
middle of other messages and it looks like crap.

This code is trickier than it looks. Quite a few newbies have run
into trouble here. My advice is to start with something that looks
tricky so at least if you mess up, you were doing something awesome.
:)

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/