From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Caizhiyong <caizhiyong@hisilicon.com>,
Brian Norris <computersforpeace@gmail.com>,
"Wanglin (Albert)" <albert.wanglin@hisilicon.com>,
Artem Bityutskiy <dedekind1@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
Karel Zak <kzak@redhat.com>,
Shmulik Ladkani <shmulik.ladkani@gmail.com>,
Randy Dunlap <rdunlap@infradead.org>,
"fengguang.wu@intel.com" <fengguang.wu@intel.com>
Subject: Re: [PATCH] block: cmdline-parser: perfect cmdline format checking
Date: Mon, 11 Nov 2013 16:45:48 -0800 [thread overview]
Message-ID: <1384217148.4771.9.camel@joe-AO722> (raw)
In-Reply-To: <20131111153420.d4e9c4ef2a90e70bfb01fd83@linux-foundation.org>
On Mon, 2013-11-11 at 15:34 -0800, Andrew Morton wrote:
> On Sat, 9 Nov 2013 11:45:14 +0000 Caizhiyong <caizhiyong@hisilicon.com> wrote:
[]
> > -perfect cmdline format checking, make the error information clear
> > for understand, make this lib fully equivalent to the old parser
> > in drivers/mtd/cmdlinepart.c
> >
> > ...
> >
> > +#define PARSER "cmdline-parser: "
> > ...
> > - pr_warn("cmdline partition size is invalid.");
> > + pr_warn(PARSER "partition '%s' size '0x%llx' too small.",
>
> You can use the standard pr_fmt() mechanism instead of this.
[]
> diff -puN block/cmdline-parser.c~mtd-cmdlinepart-use-cmdline-partition-parser-lib-fix block/cmdline-parser.c
[]
> @@ -21,10 +26,12 @@ static int parse_subpart(struct cmdline_
> if (*partdef == '-') {
> new_subpart->size = (sector_t)(~0ULL);
> partdef++;
> + lastpart = 1;
> } else {
> new_subpart->size = (sector_t)memparse(partdef, &partdef);
> if (new_subpart->size < (sector_t)PAGE_SIZE) {
> - pr_warn("cmdline partition size is invalid.");
> + pr_warn(PARSER "partition '%s' size '0x%llx' too small.",
> + partorg, new_subpart->size);
As well, please add terminating '\n' newlines to all the formats.
This helps avoid possible logging message interleaving.
next prev parent reply other threads:[~2013-11-12 0:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-09 11:45 [PATCH] block: cmdline-parser: perfect cmdline format checking Caizhiyong
2013-11-11 23:34 ` Andrew Morton
2013-11-12 0:45 ` Joe Perches [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-11-12 8:19 Caizhiyong
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=1384217148.4771.9.camel@joe-AO722 \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=albert.wanglin@hisilicon.com \
--cc=caizhiyong@hisilicon.com \
--cc=computersforpeace@gmail.com \
--cc=dedekind1@gmail.com \
--cc=fengguang.wu@intel.com \
--cc=kzak@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=rdunlap@infradead.org \
--cc=shmulik.ladkani@gmail.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