Re: [PATCH] init: main: fixed coding style issues and errors

From: Joe Perches
Date: Mon Oct 15 2012 - 07:48:49 EST


On Mon, 2012-10-15 at 10:41 +0200, "Levan Giguashvili wrote:
> From: Odinn <odinn@ubuntu.(none)>

who's that? Make sure your from line is correct please.

> Fixed coding style issues regarding spaces and braces.
> Removed init of a static variable.
> Added KERN_DEBUG to printk that was missing it

Added unnecessary continuation lines to printks.

> diff --git a/init/main.c b/init/main.c
[]
> @@ -172,8 +172,8 @@ static int __init obsolete_checksetup(char *line)
> if (line[n] == '\0' || line[n] == '=')
> had_early_param = 1;
> } else if (!p->setup_func) {
> - printk(KERN_WARNING "Parameter %s is obsolete,"
> - " ignored\n", p->str);
> + printk(KERN_WARNING "Parameter %s is obsolete" \
> + ", ignored\n", p->str);

Don't add unnecessary line continuations please.
Better would be to coalesce the formats like:
printk(KERN_WARNING "Parameter %s is obsolete, ignored\n"
p->str);

It would also be better and easier to review if you
broke out the whitespace only changes as a separate
patch from the other changes you make.

Oh, and please make these sorts of changes only in
the drivers/staging tree until you are _very_ familiar
with kernel style. Don't rely on checkpatch to tell
you what to do. It's pretty brain-dead. checkpatch
is a patch checking tool not really a code style tool
for existing code.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/