lkml.org 
[lkml]   [2007]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Trailing periods in kernel messages
    On Thu, Nov 29, 2007 at 06:35:28PM -0800, Joe Perches wrote:
    > On Fri, 2007-11-30 at 09:54 +0800, Li Zefan wrote:
    > > So it doesn't deserve the effort to eliminate these periods, isn't it?
    >
    > I hope these will eventually disappear.
    >
    > > Or we can add a check to checkpatch.pl to prevent new ones.
    >
    > Perhaps that's a good idea.
    >
    > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
    > index cbb4258..707f84c 100755
    > --- a/scripts/checkpatch.pl
    > +++ b/scripts/checkpatch.pl
    > @@ -1390,6 +1390,10 @@ sub process {
    > if ($line =~ /\*\s*\)\s*k[czm]alloc\b/) {
    > WARN("unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
    > }
    > +
    > + if ($rawline =~ /(print|pr_(emerg|alert|crit|err|warning|notice|info|debug)).*\.\\n\"/) {
    > + WARN("unnecessary period before newline\n" . $herecurr);
    > + }

    I missed the context on this one. So this is checking for periods at
    the end of messages for printk's. We would need something a little
    cleverer to ensure we are only checking the contents of the string. But
    eminently doable.

    /me plays

    Ok, yes this seems ok. Have added it for 0.13.

    -apw


    \
     
     \ /
      Last update: 2007-12-20 17:35    [W:2.874 / U:0.348 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site