[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1413297205.3269.11.camel@joe-AO725>
Date: Tue, 14 Oct 2014 07:33:25 -0700
From: Joe Perches <joe@...ches.com>
To: Tanya Brokhman <tlinder@...eaurora.org>
Cc: dedekind1@...il.com, ezequiel.garcia@...e-electrons.com,
linux-mtd@...ts.infradead.org, linux-arm-msm@...r.kernel.org,
David Woodhouse <dwmw2@...radead.org>,
Brian Norris <computersforpeace@...il.com>,
Richard Weinberger <richard@....at>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4] mtd: ubi: Extend UBI layer debug/messaging
capabilities
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists