From: Simon Horman <simon@horms.net>
To: Paul Mundt <lethal@linux-sh.org>
Cc: linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org,
Yusuke Goda <yusuke.goda.sx@renesas.com>,
Chris Ball <cjb@laptop.org>
Subject: Re: [PATCH] mmc, sh: use a consistent pr_ prefix
Date: Wed, 10 Nov 2010 13:38:08 +0000 [thread overview]
Message-ID: <20101110133807.GB21836@verge.net.au> (raw)
In-Reply-To: <20101110110049.GA1475@linux-sh.org>
On Wed, Nov 10, 2010 at 08:00:49PM +0900, Paul Mundt wrote:
> On Wed, Nov 10, 2010 at 07:27:44PM +0900, Simon Horman wrote:
> > Use pr_fmt to set the prefix for pr_ messages.
> > I believe this method is common in other
> > source files in the kernel tree.
> >
> pr_fmt() is ok when you have no better options, but in this case you have
> the struct device working for you, so you really should be using it.
>
> Consider the case where you have multiple MMCIF blocks, the debug
> messages here won't really give you much helpful information if you have
> no idea which block you're on.
>
> For example..
>
> > diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> > index 3f49273..9f37f74 100644
> > --- a/drivers/mmc/host/sh_mmcif.c
> > +++ b/drivers/mmc/host/sh_mmcif.c
> > @@ -221,8 +222,8 @@ static int sh_mmcif_error_manage(struct sh_mmcif_host *host)
> >
> > state1 = sh_mmcif_readl(host->addr, MMCIF_CE_HOST_STS1);
> > state2 = sh_mmcif_readl(host->addr, MMCIF_CE_HOST_STS2);
> > - pr_debug("%s: ERR HOST_STS1 = %08x\n", DRIVER_NAME, state1);
> > - pr_debug("%s: ERR HOST_STS2 = %08x\n", DRIVER_NAME, state2);
> > + pr_debug("ERR HOST_STS1 = %08x\n", state1);
> > + pr_debug("ERR HOST_STS2 = %08x\n", state2);
> >
> > if (state1 & STS1_CMDSEQ) {
> > sh_mmcif_bitset(host, MMCIF_CE_CMD_CTRL, CMD_CTRL_BREAK);
>
> You can just convert these to:
>
> dev_dbg(&host->pd->dev, ...);
>
> > @@ -230,7 +231,7 @@ static int sh_mmcif_error_manage(struct sh_mmcif_host *host)
> > while (1) {
> > timeout--;
> > if (timeout < 0) {
> > - pr_err(DRIVER_NAME": Forceed end of " \
> > + pr_err("Forceed end of " \
> > "command sequence timeout err\n");
> > return -EIO;
> > }
>
> dev_err(), and so on.
>
Thanks, will do.
next prev parent reply other threads:[~2010-11-10 13:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-10 10:27 [PATCH] mmc, sh: use a consistent pr_ prefix Simon Horman
2010-11-10 11:00 ` Paul Mundt
2010-11-10 13:38 ` Simon Horman [this message]
2010-11-11 7:57 ` Guennadi Liakhovetski
2010-11-11 23:48 ` Simon Horman
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=20101110133807.GB21836@verge.net.au \
--to=simon@horms.net \
--cc=cjb@laptop.org \
--cc=lethal@linux-sh.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=yusuke.goda.sx@renesas.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox