mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Tanya Brokhman <tlinder@codeaurora.org>
Cc: dedekind1@gmail.com, ezequiel.garcia@free-electrons.com,
	linux-mtd@lists.infradead.org, linux-arm-msm@vger.kernel.org,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] mtd: ubi: Extend UBI layer debug/messaging capabilities
Date: Tue, 14 Oct 2014 07:33:25 -0700	[thread overview]
Message-ID: <1413297205.3269.11.camel@joe-AO725> (raw)
In-Reply-To: <543D304C.5000607@codeaurora.org>

On Tue, 2014-10-14 at 17:16 +0300, Tanya Brokhman wrote:
> On 10/14/2014 5:13 PM, Tanya Brokhman wrote:
> > If there is more then one UBI device mounted, there is no way to
> > distinguish between messages from different UBI devices.
> > Add device number to all ubi layer message types.
[]
> > diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
[]
> > @@ -206,7 +208,7 @@ static int validate_vid_hdr(const struct ubi_vid_hdr *vid_hdr,
> >   		 */
> >
> >   		if (vol_id != av->vol_id) {
> > -			ubi_err("inconsistent vol_id");
> > +			ubi_err(ubi, "inconsistent vol_id");
> >   			goto bad;
> >   		}
> >

If you are going to change all the ubi_<level> calls,
can you also please add a terminating newline to all
the uses for consistency with all the other
pr_<level>/dev_<level>/<etc>_<level> calls?

(and remove the newline from the ubi_<level> macros)

> > diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
[]
> > @@ -50,13 +50,14 @@
> >   #define UBI_NAME_STR "ubi"
> >
> >   /* Normal UBI messages */
> > -#define ubi_msg(fmt, ...) pr_notice("UBI: " fmt "\n", ##__VA_ARGS__)
> > +#define ubi_msg(ubi, fmt, ...) pr_notice("UBI-%d: %s:" fmt "\n", \
> > +				 ubi->ubi_num, __func__, ##__VA_ARGS__)
> >   /* UBI warning messages */
> > -#define ubi_warn(fmt, ...) pr_warn("UBI warning: %s: " fmt "\n",  \
> > -				   __func__, ##__VA_ARGS__)
> > +#define ubi_warn(ubi, fmt, ...) pr_warn("UBI-%d warning: %s: " fmt "\n",  \
> > +				   ubi->ubi_num, __func__, ##__VA_ARGS__)
> >   /* UBI error messages */
> > -#define ubi_err(fmt, ...) pr_err("UBI error: %s: " fmt "\n",      \
> > -				 __func__, ##__VA_ARGS__)
> > +#define ubi_err(ubi, fmt, ...) pr_err("UBI-%d error: %s: " fmt "\n",      \
> > +				 ubi->ubi_num, __func__, ##__VA_ARGS__)

Converting these macros to functions using "%pV"
will save quite a bit of text space by removing
a lot of "UBI-%d <foo>: " duplication.

Using ubi_notice instead of ubi_msg would be a
lot more standard too.



  reply	other threads:[~2014-10-14 14:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-14 14:13 Tanya Brokhman
2014-10-14 14:16 ` Tanya Brokhman
2014-10-14 14:33   ` Joe Perches [this message]
2014-10-14 15:07     ` Artem Bityutskiy
2014-10-14 16:05       ` Joe Perches
2014-10-20 13:51         ` Artem Bityutskiy
2014-10-20 16:54           ` Tanya Brokhman
2014-10-20 17:29             ` Joe Perches
2014-10-14 14:39 ` Ezequiel Garcia
2014-10-14 15:09   ` Artem Bityutskiy
2014-10-14 18:47     ` Ezequiel Garcia
2014-10-14 19:13       ` Joe Perches
2014-10-14 19:18         ` Ezequiel Garcia
2014-10-14 19:31           ` Joe Perches
2014-10-20 13:53             ` Artem Bityutskiy

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=1413297205.3269.11.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=computersforpeace@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=tlinder@codeaurora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®