Re: [PATCH] update checkpatch.pl to version 0.03

Jesper Juhl
2007-06-07T14:39:45Z

On 07/06/07, Jan Engelhardt <jengelh@computergmbh.de> wrote:
>
> On Jun 6 2007 11:05, Jesper Juhl wrote:
> >
> > - Source files should be 7bit ASCII
>
> Nah. Think of....
>
> MODULE_AUTHOR("J. Ørsted <jorsted@foobar.com>");
>
That's true. I wrote that comment shortly after reading
http://lkml.org/lkml/2007/6/4/448 , but you are right, 7bit ASCII can
be too limiting at times... Hmmm...

> > - Maybe warn about usage of float/double in source files?
>
> Generally yes, maybe, but see arch/i386/kernel/cpu/bugs.c,
> arch/i386/math-emu/. Generally there is nothing to it. I think the
> feature to allow the kernel to use [i387] FP without manually
> saving/restoring the FP stack has been added some time ago.
>
I know there are places where floats and doubles can be used safely,
but for those rare occasions wouldn't it make sense to have the script
warn and require the submitter to justify the use? After all, the
general rule is to not use floating point in the kernel, so such a
patch is suspicious.

> > - 'return' is not a function, so warn about patches that think it is
> > and use 'return(expr);' (this one is tricky since 'return (expr);' can
> > be OK in some cases.
>
> Now, if we could detect superfluous parentheses and branches,
> that'd be cool ;-) there are too many if ((a < 5) || (b > 6)) around.
>
Yeah wouldn't it be cool :-) It might require a bit too much perl
magic to actually implement something sane, but I just threw every
idea that came into my mind into the mail, assuming Andy could sort
out the ones that were a little too crazy ;)

--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html