lkml.org 
[lkml]   [2010]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: checkpatch problem
    Date

    The problem is that the second matcher (looking for " to \\n) matches on more
    than just the logfunction line. Instrumenting the code supplied by your patch
    thusly:

    if ($line =~ /^.*($logFunctions)/) {
    print "QQQQ $1 QQQQ\n";
    my $ln = $linenr;
    my $cnt = $realcnt;
    my ($off, $dstat, $dcond, $rest);
    ($dstat, $dcond, $ln, $cnt, $off) =
    ctx_statement_block($linenr, $realcnt, 0);
    for (my $n = 0; $n < $cnt; $n++) {
    my $l = $rawlines[$ln-1+$n];
    if ($l =~ /(\".*[ \t]\\n)/) {
    print "&&&$line&&&\n";
    print "^^^^^ Matched '$1' ^^^^^\n";
    WARN("Logging function has unnecessary whitespace before a newline\n" . $herecurr);
    }
    }
    }

    I see:

    QQQQ printk QQQQ
    QQQQ printk QQQQ
    QQQQ printk QQQQ
    QQQQ printk QQQQ
    QQQQ printk QQQQ
    &&&+#define Dprintk(fmt, ...) printk(KERN_DEBUG fmt, ##__VA_ARGS__)&&&
    ^^^^^ Matched '"mov %0,sp \n' ^^^^^
    &&&+#define Dprintk(fmt, ...) printk(KERN_DEBUG fmt, ##__VA_ARGS__)&&&
    ^^^^^ Matched '"jmp (%1) \n' ^^^^^
    &&&+#define Dprintk(fmt, ...) printk(KERN_DEBUG fmt, ##__VA_ARGS__)&&&
    ^^^^^ Matched '" movhu (%1),%0 \n' ^^^^^


    It seems that it doesn't like a #define dealing with a logging function
    followed by an inline asm statement that has whitespace before '\\n'.

    I suspect checkpatch doesn't handle #defines correctly, and goes beyond their
    end looking for a semicolon.

    David


    \
     
     \ /
      Last update: 2010-09-27 20:09    [W:0.021 / U:0.068 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site