lkml.org 
[lkml]   [2013]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] block: cmdline-parser: perfect cmdline format checking
From
Date
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.




\
 
 \ /
  Last update: 2013-11-12 02:01    [W:0.037 / U:1.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site