Re: + drivers-block-floppyc-use-pr_level.patch added to -mm tree

From: Joe Perches
Date: Wed Jan 27 2010 - 09:09:17 EST


On Wed, 2010-01-27 at 10:31 +0100, Jiri Slaby wrote:
> On 01/27/2010 01:37 AM, akpm@xxxxxxxxxxxxxxxxxxxx wrote:
> > @@ -687,9 +687,7 @@ static void __reschedule_timeout(int dri
> > fd_timeout.expires = jiffies + UDP->timeout;
> > add_timer(&fd_timeout);
> > if (UDP->flags & FD_DEBUG) {
> > - DPRINT("reschedule timeout ");
> > - printk(message, marg);
> > - printk("\n");
> > + DPRINT("reschedule timeout %s %d\n", message, marg);
>
> This is wrong.

I disagree.

It does add an always output decimal value to the DPRINT
instead of a mostly mismatched format and argument
printk(message, marg).

Previous single matched output use of message/marg:

- reschedule_timeout(MAXTIMEOUT, "request done %d", uptodate);
+ reschedule_timeout(MAXTIMEOUT, "request done", uptodate);

vs now:

$ grep reschedule_timeout drivers/block/floppy.c
static void __reschedule_timeout(int drive, const char *message, int marg)
static void reschedule_timeout(int drive, const char *message, int marg)
__reschedule_timeout(drive, message, marg);
__reschedule_timeout(drive, "lock fdc", 0);
reschedule_timeout(current_reqD, "floppy start", 0);
reschedule_timeout(MAXTIMEOUT, "do wakeup", 0);
reschedule_timeout(MAXTIMEOUT, "request done", uptodate);
reschedule_timeout(current_reqD, "redo fd request", 0);
reschedule_timeout(MAXTIMEOUT, "floppy init", MAXTIMEOUT);

Arguably, that single use could be something like:

char msg_buf[sizeof("request done ") + 20];
snprintf(msg_buf, sizeof(msg_buf), "request_done %d", uptodate);
reschedule_timeout(MAXTIMEOUT, msg_buf);

(uptodate should be 0, 1 or 2)

with the now unused marg argument removed from
reschedule_timeout and __reschedule_timeout.

--
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/