public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: + drivers-block-floppyc-use-pr_level.patch added to -mm tree
       [not found] <201001270037.o0R0bN6S032517@imap1.linux-foundation.org>
@ 2010-01-27  9:31 ` Jiri Slaby
  2010-01-27 14:09   ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Slaby @ 2010-01-27  9:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: akpm, mm-commits, joe, bzolnier, jens.axboe, marcin.slusarz,
	shemminger

On 01/27/2010 01:37 AM, akpm@linux-foundation.org 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.

/me stopped to read here. Recheck the rest of changes.

-- 
js

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

* Re: + drivers-block-floppyc-use-pr_level.patch added to -mm tree
  2010-01-27  9:31 ` + drivers-block-floppyc-use-pr_level.patch added to -mm tree Jiri Slaby
@ 2010-01-27 14:09   ` Joe Perches
  2010-01-27 14:21     ` Jiri Slaby
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2010-01-27 14:09 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: linux-kernel, akpm, mm-commits, bzolnier, jens.axboe,
	marcin.slusarz, shemminger

On Wed, 2010-01-27 at 10:31 +0100, Jiri Slaby wrote:
> On 01/27/2010 01:37 AM, akpm@linux-foundation.org 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.


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

* Re: + drivers-block-floppyc-use-pr_level.patch added to -mm tree
  2010-01-27 14:09   ` Joe Perches
@ 2010-01-27 14:21     ` Jiri Slaby
  2010-01-27 14:35       ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Slaby @ 2010-01-27 14:21 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, akpm, mm-commits, bzolnier, jens.axboe,
	marcin.slusarz, shemminger

On 01/27/2010 03:09 PM, Joe Perches wrote:
> On Wed, 2010-01-27 at 10:31 +0100, Jiri Slaby wrote:
>> On 01/27/2010 01:37 AM, akpm@linux-foundation.org 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.

Then you need to document it in the changelog. The patch does something
completely different to what is stated in the changelog.

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

So if I understand correctly, it now prints the third argument every time.

-- 
js

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

* Re: + drivers-block-floppyc-use-pr_level.patch added to -mm tree
  2010-01-27 14:21     ` Jiri Slaby
@ 2010-01-27 14:35       ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2010-01-27 14:35 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: linux-kernel, akpm, mm-commits, bzolnier, jens.axboe,
	marcin.slusarz, shemminger

On Wed, 2010-01-27 at 15:21 +0100, Jiri Slaby wrote:
> On 01/27/2010 03:09 PM, Joe Perches wrote:
> > It does add an always output decimal value to the DPRINT
> > instead of a mostly mismatched format and argument
> > 	printk(message, marg).
> So if I understand correctly, it now prints the third argument every time.

correct.




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

end of thread, other threads:[~2010-01-27 14:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <201001270037.o0R0bN6S032517@imap1.linux-foundation.org>
2010-01-27  9:31 ` + drivers-block-floppyc-use-pr_level.patch added to -mm tree Jiri Slaby
2010-01-27 14:09   ` Joe Perches
2010-01-27 14:21     ` Jiri Slaby
2010-01-27 14:35       ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox