All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Joe Perches <joe@perches.com>,
	Borislav Petkov <petkovbb@gmail.com>, Tejun Heo <tj@kernel.org>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] drivers/ide/ide-core: Unsplit constant strings for pr_<level> and dev_<level>
Date: Tue, 2 Jun 2009 16:19:40 +0200	[thread overview]
Message-ID: <200906021619.40387.bzolnier@gmail.com> (raw)
In-Reply-To: <4A19399B.8060207@ru.mvista.com>

On Sunday 24 May 2009 14:12:11 Sergei Shtylyov wrote:
> Hello.
> 
> Joe Perches wrote:
> 
> > Signed-off-by: Joe Perches <joe@perches.com>
> >   
> [...]
> > diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c
> > index f323a60..560b9c4 100644
> > --- a/drivers/ide/ide-acpi.c
> > +++ b/drivers/ide/ide-acpi.c
> > @@ -435,8 +435,8 @@ void ide_acpi_get_timing(ide_hwif_t *hwif)
> >  	if (!out_obj->buffer.length || !out_obj->buffer.pointer ||
> >  	    out_obj->buffer.length != sizeof(struct GTM_buffer)) {
> >  		kfree(output.pointer);
> > -		pr_err("%s: unexpected _GTM length (0x%x)[should be 0x%zx] or "
> > -		       "addr (0x%p)\n",
> > +		pr_err(
> > +	"%s: unexpected _GTM length (0x%x)[should be 0x%zx] or addr (0x%p)\n",
> >   
> 
>    Oh no... do you really think somebody will search for this message 
> using strings like "should be"?

Well, I don't know but the error message should be improved regardless
by splitting it on separate messages for separate error conditions
(wrong length vs wrong addr).

> >  		       __func__, out_obj->buffer.length,
> >  		       sizeof(struct GTM_buffer), out_obj->buffer.pointer);
> >  		return;
> > diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
> > index 46cf46e..1e9e2d6 100644
> > --- a/drivers/ide/ide-atapi.c
> > +++ b/drivers/ide/ide-atapi.c
> > @@ -60,11 +60,13 @@ int ide_check_atapi_device(ide_drive_t *drive, const char *s)
> >  		dev_err(&drive->gendev, "%s: the removable flag is not set\n",
> >  			s);
> >  	else if (drive->media == ide_floppy && drq_type == 3)
> > -		dev_err(&drive->gendev, "%s: sorry, DRQ type (0x%02x) not "
> > -			"supported\n", s, drq_type);
> > +		dev_err(&drive->gendev,
> > +			"%s: sorry, DRQ type (0x%02x) not supported\n",
> >   
> 
>    Same question. I think the user will search for "sorry, DRQ type".

Lets just make it something like:

"%s: unsupported DRQ type (0x%02x)\n"

> > +			s, drq_type);
> >  	else if (packet_size != 0)
> > -		dev_err(&drive->gendev, "%s: packet size (0x%02x) is not 12 "
> > -			"bytes\n", s, packet_size);
> > +		dev_err(&drive->gendev,
> > +			"%s: packet size (0x%02x) is not 12 bytes\n",
> >   
> 
>    When the message is broken by the format specifier, turning it into 
> one liner can hardly help seraching...

"%s: wrong packet size (0x%02x)\n"

> > @@ -439,8 +440,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
> >  	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
> >  		pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
> >  		dev_err(&drive->gendev,
> > -			"The device wants to issue more interrupts "
> > -			"in DMA mode\n");
> > +	"The device wants to issue more interrupts in DMA mode\n");
> >   
> 
>    Oh noes, the indentation...

We even know the device name so:

"wants to issue more IRQs in DMA mode\n"

should suffice.

> > @@ -509,14 +509,12 @@ static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason)
> >  	while (retries-- && ((ireason & ATAPI_COD) == 0 ||
> >  			     (ireason & ATAPI_IO))) {
> >  		dev_err(&drive->gendev,
> > -			"(IO,CoD != (0,1) while issuing "
> > -			"a packet command, retrying\n");
> > +	"(IO,CoD != (0,1) while issuing a packet command, retrying\n");
> >   
> 
>    Sigh...
> 
> >  		udelay(100);
> >  		ireason = ide_read_ireason(drive);
> >  		if (retries == 0) {
> >  			dev_err(&drive->gendev,
> > -				"(IO,CoD != (0,1) while issuing "
> > -				"a packet command, ignoring\n");
> > +	"(IO,CoD != (0,1) while issuing a packet command, ignoring\n");
> >   
> 
>    Sigh...

I guess that by "Sigh" you meant:

"while issuing a packet command" should go away

;)

> > @@ -547,8 +545,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
> >  
> >  	if (ide_wait_stat(&startstop, drive, ATA_DRQ, ATA_BUSY, WAIT_READY)) {
> >  		dev_err(&drive->gendev,
> > -			"Strange, packet command initiated yet "
> > -			"DRQ isn't asserted\n");
> > +	"Strange, packet command initiated yet DRQ isn't asserted\n");
> >   
> 
>    Sigh...

"DRQ isn't asserted\n" should be enough here

Seems like most (all?) other error messages can be improved in similar way.

      parent reply	other threads:[~2009-06-02 14:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-23  7:41 [PATCH 0/3] drivers/ide/ide-core: Use dev_<level> and pr_<level> Joe Perches
2009-05-23  7:41 ` [PATCH 1/3] drivers/ide/ide-core: Convert printk(KERN_<level> to dev_<level> Joe Perches
2009-06-02 13:57   ` Bartlomiej Zolnierkiewicz
2009-05-23  7:41 ` [PATCH 2/3] drivers/ide/ide-core: Convert printk(KERN_<level> to pr_<level> Joe Perches
2009-06-02 14:02   ` Bartlomiej Zolnierkiewicz
2009-05-23  7:41 ` [PATCH 3/3] drivers/ide/ide-core: Unsplit constant strings for pr_<level> and dev_<level> Joe Perches
2009-05-24 12:12   ` Sergei Shtylyov
2009-05-24 16:46     ` Joe Perches
2009-05-24 18:00       ` Sergei Shtylyov
2009-06-02 14:19     ` Bartlomiej Zolnierkiewicz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200906021619.40387.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petkovbb@gmail.com \
    --cc=sshtylyov@ru.mvista.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.