Skip to content
  • Joe Perches's avatar
    checkpatch: ignore existing CamelCase uses from include/... · 3445686a
    Joe Perches authored
    
    
    When using --strict, CamelCase uses are described with CHECK: messages.
    These CamelCase uses may be acceptable and should not generate these
    messages when the variable is already defined in a file from the
    include/...  path.
    
    So, change checkpatch to read all the .h files in include/...  and look
    for preexisting CamelCase #defines, typedefs and function prototypes.
    
    Add these to the existing camelcase hash so that any uses in the patch or
    file can be ignored.
    
    There are currently ~3500 files in include/.  It takes about 10 cpu
    seconds on my little netbook to grep for and preseed these existing uses.
    
    That's about 4x the time for a similar git grep.
    
    This preseeding is only done once when using --strict and only when there
    is a CamelCase use found.
    
    If a .git directory is found, it uses 'git ls-files include' If not, it
    uses 'find $root/include -name "*.h"
    
    Signed-off-by: default avatarJoe Perches <joe@perches.com>
    Cc: Andy Whitcroft <apw@canonical.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    3445686a