Skip to content
  • Joe Perches's avatar
    checkpatch: add test for native c90 types in unusual order · 1813087d
    Joe Perches authored
    
    
    c90 section "6.7.2 Type Specifiers" says:
        "type specifiers may occur in any order"
    
    That means that:
        short int is the same as int short
        unsigned short int is the same as int unsigned short
        etc...
    
    checkpatch currently parses only a subset of these allowed types.
    
    For instance: "unsigned short" and "signed short" are found by
    checkpatch as a specific type, but none of the or "int short" or "int
    signed short" variants are found.
    
    Add another table for the "kernel style misordered" variants.
    
    Add this misordered table to the findable types.
    
    Warn when the misordered style is used.
    
    This improves the "Missing a blank line after declarations" test as it
    depends on the correct parsing of the $Declare variable which looks for
    "$Type $Ident;" (ie: declarations like "int foo;").
    
    Signed-off-by: default avatarJoe Perches <joe@perches.com>
    Acked-by: default avatarAndy Whitcroft <apw@canonical.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    1813087d