25 Jul, 2008

28 commits


07 Jun, 2008

1 commit

  • This version is a bit of a whopper. This version brings a few new checks,
    improvements to a number of checks mostly through modifications to the
    way types are parsed, several fixes to quote/comment handling, as well as
    the usual slew of fixes for false positives.

    Of note:
    - return is not a function and is now reported,
    - preprocessor directive detection is loosened to match C99 standard,
    - we now intuit new type modifiers, and
    - comment handling is much improved

    Andy Whitcroft (18):
    Version: 0.19
    fix up a couple of missing newlines in reports
    colon to parenthesis spacing varies on asm
    values: #include is a preprocessor statement
    quotes: fix single character quotes at line end
    add typedef exception for the non-pointer "function types"
    kerneldoc parameters must be on one line, relax line length
    types: word boundary is not always required
    improved #define bracketing reports
    uninitialized_var is an annotation not a function name
    possible types: add possible modifier handling
    possible types: fastcall is a type modifier
    types: unsigned is not a modifier on all types
    static/external initialisation to zero should allow modifiers
    checkpatch: fix recognition of preprocessor directives -- part 2
    comments: fix inter-hunk comment tracking
    return is not a function
    do not report include/asm/foo.h use in include/linux/foo.h
    return is not a function -- tighten test

    [jengelh@computergmbh.de: fix recognition of preprocessor directives]
    Signed-off-by: Andy Whitcroft
    Cc: Jan Engelhardt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     

29 Apr, 2008

2 commits

  • This version brings a few fixes for the extern checks, and a couple of
    new checks.

    Of note:
    - false is now recognised as a 0 assignment in static/external
    assignments,
    - printf format strings including %L are reported,
    - a number of fixes for the extern in .c file detector which had
    temporarily lost its ability to detect variables; undetected due to
    the loss of its test.

    Andy Whitcroft (8):
    Version: 0.18
    false should trip 0 assignment checks
    tests: reinstate missing tests
    tests: allow specification of the file extension for a test
    fix extern checks for variables
    check for and report %Lu, %Ld, and %Li
    ensure we only start a statement on lines with some content
    extern spacing

    Signed-off-by: Andy Whitcroft
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • This version brings improvements to external declaration detection, fixes to
    quote tracking, fixes to unary tracking, some clarification of wording, and
    the usual slew of fixes for false positives.

    Of note:
    - much better unary tracking across preprocessor directives
    - UTF8 checks highlight the character at fault
    - widening of mutex detection

    Andy Whitcroft (17):
    Version: 0.17
    values: __attribute__ carries through the previous type
    quotes: should only follow "positive" lines
    clarify the indent tabs over spaces wording
    loosen NR_CPUS check for array range initialisers
    detect external function declarations without an extern prefix
    function declaration arguments should be with the identifier
    DEFINE_MUTEX should report in line with struct mutex
    NR_CPUS is valid in preprocessor statements
    comment detection should not start on the @@ line
    types: add support for #undef
    tighten mutex/completion reports to usage
    allow export of function pointers
    values: preprocessor #define is out of line maintain values
    values: #define does not always have parentheses
    unary '*' may be const
    utf8 checks should report location of the invalid character

    Wolfram Sang (1):
    make checkpatch.pl really skip

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     

25 Apr, 2008

1 commit


29 Mar, 2008

1 commit

  • This version brings proper quote tracking across lines, and brings the
    handling of comments into the same mechanism ensuring nesting is correctly
    handled. It brings the usual flurry of fixes for false positives. It also
    brings a number of new checks. The most contentious change will likely be
    the checks for NR_CPUS as this throws some new warnings in kernel/sched.c.

    Of note:
    - all new quote tracking across lines
    - all new comment tracking
    - new more direct, less ambigious wording for some warnings
    - recommends mutexes and completions over semaphores
    - recommends strict_strto* over simple_strto*
    - report on direct use of NR_CPUS

    Andy Whitcroft (22):
    Version: 0.16
    string quote tracking should cross line boundaries
    check spacing round -> correctly across newlines
    checks for linux/ against asm/ include files should be warnings
    standardise on 'required' and 'prohibited'
    take the first end of condition when parsing statements
    values: cope with unbalanced brackets
    preprocessor #elif is not a function
    preprocessor #if should not trigger trailing statement checks
    test: allow us to limit output to a single error
    recommend real mutexes over semaphores
    asm checks should mirror those for __asm__
    warn on semaphores being used in place of completions
    trailing ; on control structure should ignore do {} while ();
    recommend strict_strtoX over simple_strtoX
    redo comment handling as a quote type
    use of NR_CPUS is normally wrong
    consistant spacing should only be about spaces
    if brace check suppression should only apply to the top-levels
    use tr/// to align spacing for operators
    move to using four parameter form of substr
    check and report modifications to include/asm

    Signed-off-by: Andy Whitcroft
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     

05 Mar, 2008

1 commit

  • This version brings a number of minor fixes updating the type detector and
    the unary tracker. It also brings a few small fixes for false positives.
    It also reverts the --file warning. Of note:

    - limit CVS checks to added lines
    - improved type detections
    - fixes to the unary tracker

    Andy Whitcroft (13):
    Version: 0.15
    EXPORT_SYMBOL checks need to accept array variables
    export checks must match DECLARE_foo and LIST_HEAD
    possible types: cleanup debugging missing line
    values: track values through preprocessor conditional paths
    typeof is actually a type
    possible types: detect definitions which cross lines
    values: include line numbers on value debug information
    values: ensure we find correctly record pending brackets
    values: simplify the brace history stack
    CVS keyword checks should only apply to added lines
    loosen spacing for comments
    allow braces for single statement blocks with multiline conditionals

    Harvey Harrison (1):
    checkpatch: remove fastcall

    Ingo Molnar (1):
    checkpatch.pl: revert wrong --file message

    Uwe Kleine-Koenig (1):
    fix typo "goot" -> "good"

    Signed-off-by: Andy Whitcroft
    Cc: Randy Dunlap
    Cc: Joel Schopp
    Cc: Ingo Molnar
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     

09 Feb, 2008

2 commits

  • This version brings the remainder of the queued fixes. A number of fixes
    for items missed reported by Andrew Morton and others. Also a handful
    of new checks and fixes for false positives. Of note:

    - new warning associated with --file to try and avoid cleanup only patches,
    - corrected handling of completly empty files,
    - corrected report handling with multiple files,
    - handling of possible types in the face of multiple declarations,
    - detection of unnessary braces on complex if statements (where present), and
    - all new comment spacing handling.

    Andi Kleen (1):
    Introduce a warning when --file mode is used

    Andy Whitcroft (14):
    Version: 0.14
    clean up some space violations in checkpatch.pl
    a completly empty file should not provoke a whinge
    reset report lines buffers between files
    unary ++/-- may abutt close braces
    __typeof__ is also unary
    comments: revamp comment handling
    add --summary-file option adding filename to summary line
    trailing backslashes are not trailing statements
    handle operators passed as parameters such as to ASSERTCMP
    possible types -- enhance debugging
    check for boolean operations with constants
    possible types: handle multiple declarations
    detect and report if statements where all branches are single statements

    Arjan van de Ven (1):
    quiet option should not print the summary on no errors

    Bartlomiej Zolnierkiewicz (1):
    warn about using __FUNCTION__

    Timur Tabi (1):
    loosen spacing checks for __asm__

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • This version brings a large number of fixes which have built up over
    the Christmas period. Mostly these are fixes for false positives, both
    through improvments to unary checks and possible type detection. It
    also brings new checks for while location and CVS keywords. Of note:

    - a number of fixes to unary detection
    - detection of a number of new forms of types to improve type matching
    - better inline handling
    - recognision of '%' as an operator

    Andy Whitcroft (28):
    Version: 0.13
    unary detection: maintain bracket state across lines
    move to pre-sanitising the entire file
    the text of a #error statement should be treated like it is in quotes
    line sanitisation needs to target double backslash correctly
    tighten comment guestimation for lines starting ' * '
    debug: add a debug framework
    prevent unclosed single quotes from spreading
    add % as an operator
    the text of a #warning statement should be treated like it is in quotes
    possible matching applies in typedefs
    single statement block checks must not trigger when two or more statements
    possible types: local variables may also be const
    treat inline as a type attribute to even when out of place
    possible types: sparse annotations are valid indicators
    possible types: beef up the possible type testing
    check for hanging while statements on the wrong line
    utf8 checks need to occur against the raw lines
    function brace checks should use any whitespece matches
    comments should take up space in the line when sanitised
    remove debugging from if assignment checks
    possible types -- ensure we detect all pointer casts
    fix tests for function spacing in the presence of #define
    clean up the UTF-8 error message to be clearer
    test-lib: invert the status report, output success counts
    detect and report CVS keywords
    tests: break out tests
    Add $Id$ to the CVS keyword checks

    Benny Halevy (1):
    checkpatch.pl: recognize the #elif preprocessor directive

    Geert Uytterhoeven (1):
    print the filenames of patches where available

    Mauro Carvalho Chehab (1):
    Fix missing \n in checkpatch.pl

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     

30 Nov, 2007

1 commit

  • This version brings a new terse output mode as well as many improvements to
    the unary detection and bare type regcognition. It also brings the usual
    updates for false positives, though these seem to be slowing markedly
    now that the unary detector is no longer just putting its finger in the
    air and guessing. Of note:

    - new --terse mode producing a single line per report
    - loosening of the block brace checks
    - new checks for enum/union/struch brace placements
    - hugely expanded "bare type" detection
    - checks for inline usage
    - better handling of already open comment blocks
    - handle patches which introduce or remove lines without newlines

    Andy Whitcroft (19):
    Version: 0.12
    style fixes as spotted by checkpatch
    add a --terse options of a single line of output per report
    block brace checks should only apply for single line blocks
    all new bare type detector
    check spacing for open braces with enum, union and struct
    check for LINUX_VERSION_CODE
    macros definition bracketing checks need to ignore -ve context
    clean up the mail-back mode, -q et al
    expand possible type matching to declarations
    allow const and sparse annotations on possible types
    handle possible types as regular types everywhere
    prefer plain inline over __inline__ and __inline
    all new open comment detection
    fix up conditional extraction for if assignment checks
    add const to the possible type matcher
    unary checks: a for loop is a conditional too
    possible types: detect function pointer definitions
    handle missind newlines at end of file, report addition

    Signed-off-by: Andy Whitcroft
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     

19 Oct, 2007

1 commit

  • This version brings a more cautious checkpatch.pl by default. The more
    subjective checks are only applied with the --strict option. It also
    brings the usual slew of corrections for false positives. Of note:

    - new tree detection, the source tree will be found via the executable
    - a major revamp of the unary detection to make it more parser like
    - a new summary at the bottom of the report
    - --strict option for subjective checks
    - --file to enable checking on complete files
    - support for use in emacs "compile" window

    Andy Whitcroft (27):
    Version: 0.11
    fix up cat_vet for the case where there are no control characters
    any cast to a pointer introduces a type
    cpp unary operator detection needs to float
    attributes are also valid in type definitions
    sizeof may be a bareword and makes its argument unary
    unary checks for #ifdef et al need to find end of line
    add new --file mode to handle raw source files
    add --strict/--subjective which enables the subjective tests
    add some additional standard type suffixes
    cpp #elif is also a unary prefix
    case is not a function name
    widen asm volatile exceptions
    __kprobes is a type attribute
    typeof is a unary operator
    function open parenthesis checks should check all occurances
    expand sizeof() binary exceptions
    linux/irq.h should not be recommended
    work harder to find the kernel root and add --root=
    fix --emacs mode line numbers and string concatenation warnings
    add a summary to the bottom of the main report
    loosen assignment in if checks
    update operator spacing to maintain tabs in output
    revamp unary detection
    corruption/line wrapped patches need only reporting once
    revamp s/u/be/le 8/16/32/64 bit types
    handle missing ,1 in uni-diff header

    Mike D. Day (2):
    Adds support to checkpatch.pl for running in the emacs compile window.
    checkpatch: Fix line number reporting

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     

17 Oct, 2007

1 commit

  • This version brings a number of new checks, and a number of bug
    fixes. Of note:

    - better categorisation and space checks for dual use unary/binary
    operators
    - warn on deprecated use of {SPIN,RW}_LOCK_UNLOCKED
    - check if/for/while with trailing ';' for hanging statements
    - detect DOS line endings
    - detect redundant casts for kalloc()

    Andy Whitcroft (18):
    Version: 0.10
    asmlinkage is also a storage type
    pull out inline specifiers
    allow only some operators before a unary operator
    parenthesised values may span line ends
    add additional attribute matching
    handle sparse annotations within pointer type space checks
    support alternative function definition syntax for typedefs
    check if/for/while with trailing ';' for hanging statements
    fix output format for case checks
    deprecate SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED
    allow complex macros with bracketing braces
    detect and report DOS line endings
    fastcall is a valid function attribute
    bracket spacing is ok for 'for'
    categorise operators into unary/binary/definitions
    add heuristic to pick up on unannotated types
    remove spurious warnings from cat_vet

    Dave Jones (1):
    Make checkpatch warn about pointless casting of kalloc returns.

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     

12 Aug, 2007

1 commit

  • This version brings a number of new checks, and a number of bug
    fixes. Of note:

    - checks for spacing on round and square bracket combinations
    - loosening of the single statement brace checks, to allow
    them when they contain comments or where other blocks in a
    compound statement have them.
    - parks the multple declaration support
    - allows architecture defines in architecture specific headers

    Andy Whitcroft (21):
    Version: 0.09
    loosen single statement brace checks
    fix up multiple declaration to avoid function arguments
    add some function space parenthesis check exceptions
    handle EXPORT_'s with parentheses in their names
    clean up some warnings in multi-line macro bracketing support
    park the multiple declaration checks
    make block brace checks count comments as a statement
    __volatile__ and __extension__ are not functions
    allow architecture specific defined within architecture includes
    check spacing on square brackets
    check spacing on parentheses
    ensure we apply checks to the part before start comment
    check #ifdef conditional spacing
    handle __init_refok and __must_check
    add noinline to inline checks
    prevent email addresses from tripping spacing checks
    handle typed initialiser spacing
    handle line contination as end of line
    add bool to the type matcher
    refine EXPORT_SYMBOL checks to handle pointers

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft