1
0
Fork 0
Commit Graph

61 Commits (4d001e4d88a57ba8347b43e3a20412cd6b67fbd7)

Author SHA1 Message Date
Andy Whitcroft 4d001e4d88 checkpatch: report the real first line of all suspect indents
We are currently only reporting syspect indents if the conditional is
modified but the indent missmatch could be generated by the body changing,
make sure we catch both.  Also only report the first line of the body, and
more importantly make sure we report the raw copy of the line.  Finally
report the indent levels to make it easier to understand what is wrong.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:35 -07:00
Andy Whitcroft 6ecd967444 checkpatch: report any absolute references to kernel source files
Absolute references to kernel source files are generally only useful
locally to the originator of the patch.  Check for any such references and
report them.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:35 -07:00
Andy Whitcroft e09dec4831 checkpatch: reduce warnings for #include of asm/foo.h to check from arch/bar.c
It is much more likely that an architecture file will want to directly
include asm header files.  Reduce this WARNING to a CHECK when the
referencing file is in the arch directory.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:35 -07:00
Andy Whitcroft c1ab33269a checkpatch: include/asm checks should be anchored
It is possible to have other include/asm paths within the tree which are
not subject to the do not edit checks.  Ignore those.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:35 -07:00
Andy Whitcroft 01fa91471e checkpatch: fix up comment checks search to scan the entire block
We are not counting the lines in the block correctly which causes the
comment scan to stop prematurly and thus miss comments which end at the
end of the block.  Fix this up.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:35 -07:00
Andy Whitcroft 636d140a80 checkpatch: complex macros -- fix up extension handling
Only pull in new extension lines where the current contents ends with a \.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:35 -07:00
Andy Whitcroft 24e1d81acd checkpatch: ____cacheline_aligned et al are modifiers
Add the cacheline alignment modifiers to the attribute lists.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:35 -07:00
Andy Whitcroft a1ef277e2c checkpatch: add tests for the attribute matcher
Add support for direct testing of the attribute matcher, add basic tests
for it.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:35 -07:00
Andy Whitcroft 1bdab9e588 checkpatch: switch indent allow plain return
It is a common and sane idiom to allow a single return on the end of a
case statement:

	switch (...) {
	case foo:	return bar;
	}

Add an exception for this.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:34 -07:00
Andy Whitcroft 14b111c158 checkpatch: conditional indent -- labels have different indent rules
Labels have different indent rules and must be ignored when checking the
conditional indent levels.  Also correct identify labels in single
statement conditionals.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:34 -07:00
Andy Whitcroft 0d413866c7 checkpatch: values: double ampersand may be unary
It is possible to use double ampersand (&&) in unary context where it
means the address of a goto label.  Handle spacing for it.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:34 -07:00
Andy Whitcroft fe2a7dbc85 checkpatch: square brackets -- exemption for array slices in braces
It is wholy reasonable to have square brackets representing array slices
in braces on the same line.  These should be spaced.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:34 -07:00
Andy Whitcroft 33cba06573 checkpatch: version 0.21
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:27 -07:00
Andy Whitcroft 234fff6515 checkpatch: types cannot start mid word for pointer tests
When checking spacing for pointer checks the type cannot start in the
middle of a word, ie. this is not 'int * bar':

	x = fooint * bar;

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Andy Whitcroft 292f1a9b34 checkpatch: complex macros need to ignore comments
Ensure we ignore comments in complex macro detection else we incorrectly
report this:

	#define PFM_GROUP_PERM_ANY     -1      /* any user/group */

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Andy Whitcroft 74048ed811 checkpatch: variants -- move the main unary/binary operators to use variants
Now that we have a variants system, move to using that to carry the
unary/binary designation for +, -, &, and *.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Andy Whitcroft 1f65f947a6 checkpatch: add checks for question mark and colon spacing
Add checks for the question mark colon operator spacing, and also check
the other uses of colon.  Colon means a number of things:

 - it introduces the else part of the ?: operator,
 - it terminates a goto label,
 - it terminates the case value,
 - it separates the identifier from the bit size on bit fields, and
 - it is used to introduce option types in asm().

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Andy Whitcroft d250658658 checkpatch: possible modifiers -- handle multiple modifiers and trailing
Add support for multiple modifiers such as:

	int __one __two foo;

Also handle trailing known modifiers when defecting modifiers:

	int __one foo __read_mostly;

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Andy Whitcroft 0221f55c14 checkpatch: possible types -- known modifiers cannot be types
Ensure we do not inadvertantly load known modifiers up as possible types.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Andy Whitcroft 8ea3eb9a20 checkpatch: handle return types of pointers to functions
Make sure we correctly mark the return type of the pointer to a function
declaration.

    const void *(*sb_tag)(struct sysfs_tag_info *info);

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Andy Whitcroft b8f96a31f3 checkpatch: macro complexity checks are meaningless in linker scripts
Exclude vmlinux.lds.h from the macro complexity checks.  They will never
apply sanely here.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Andy Whitcroft d2172eb5bd checkpatch: possible modifiers are not being correctly matched
Although we are finding the added modifier in the declaration below
we are not correctly matching it as a type.  Fix the declaration.

    static void __ref *vmem_alloc_pages(unsigned int order)
    {
    }

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Andy Whitcroft 7429c6903e checkpatch: improve type matcher debug
Improve type matcher debug so we can see what it does match.  As part
of this move us to to using the common debug framework.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Andy Whitcroft 389a2fe57f checkpatch: allow for type modifiers on multiple declarations
Allow for type modifiers mid declaration on multiple declarations:

	struct mxser_mstatus ms, __user *msu = argp;

Reported by Jiri Slaby.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Wolfram Sang 3c232147a7 checkpatch: correct spelling in kfree checks
Correct spelling in the kfree reports.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Greg Kroah-Hartman 4c432a8f01 checkpatch: usb_free_urb() can take NULL
usb_free_urb() can take a NULL, so let's check and warn about that.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Andy Whitcroft f5fe35dd95 checkpatch: condition/loop indent checks
Check to see if the block/statement which a condition or loop introduces
is indented correctly.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:26 -07:00
Andy Whitcroft 53210168fe checkpatch: toughen trailing if statement checks and extend them to while and for
Extend the trailing statement checks to report a trailing semi-colon ';'
as we really want it on the next line and indented so it is really really
obvious.  Also extend the tests to include while and for.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:25 -07:00
Andy Whitcroft 8d31cfcecf checkpatch: check spacing for square brackets
Check on the spacing before square brackets.  We should only allow spaces
there if this is part of a type definition or an initialialiser.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:25 -07:00
Andy Whitcroft e2a763c20b checkpatch: switch -- report trailing statements on case and default
Report trailing statements on case and default lines.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:25 -07:00
Andy Whitcroft f4c014c0de checkpatch: allow printk strings to exceed 80 characters to maintain their searchability
Allow printk strings to break the 80 character width limits, thus keeping
them complete and searchable.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:25 -07:00
Andy Whitcroft 548596d523 checkpatch: trailing statement indent: fix end of statement location
Fix end of statement location.  Where the last line of the statement is
replaced we are miss reporting the newly added replacement an incorrectly
indented trailing statement for the negative context.  We are also
incorrectly reporting negative statements generally.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:25 -07:00
Andy Whitcroft a3bb97a7ab checkpatch: macros: fix statement counting block end detection
We are incorrectly counting the lines in a block while accumulating
the trailing lines in a macro statement, leading to false positives.
Fix end of block handling and general counting for negative context lines.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:25 -07:00
Andy Whitcroft 6ef9b297f6 checkpatch: types: unary -- goto introduces unary context
When we see a goto we enter unary context.  For example:

	goto *h;

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:25 -07:00
Andy Whitcroft beae633249 checkpatch: comment detection: ignore macro continuation when detecting associated comments
When looking for an associated comment they may be suffixed by a macro
continuation.  Ignore this.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:25 -07:00
Andy Whitcroft d3ddcf471e checkpatch: possible types: __asm__ is never a type
We are false matching __asm__ as a type, and then tripping the external
function checks.  Squash.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:25 -07:00
Michael Ellerman f3db6639fe checkpatch: add a checkpatch warning for new uses of __initcall().
[apw@shadowen.org: generalise pattern and add tests]
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:25 -07:00
Andy Whitcroft c8cb2ca37e checkpatch: types: some types may also be identifiers
Some types such as typedefs may overlap real identifiers.  Be more
targetted about when a type can really exist.  Where it cannot let it be
an identifier.  This prevents false reporting of the minus '-' in unary
context in the following:

	foo[bar->bool - 1];

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:25 -07:00
Andy Whitcroft fee61c47d1 checkpatch: return is not a function -- parentheses for casts are ok too
Casts require parentheses so it is possible to have something like this:

	return (int)(*a);

This miss trips the complexity function.  Ensure that the two separate
parenthesised sections are not coelesced.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:25 -07:00
Andy Whitcroft 6cbb2e7111 checkpatch: Version: 0.20
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:25 -07:00
Andy Whitcroft c45dcabd26 update checkpatch.pl to version 0.19
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 <apw@shadowen.org>
Cc: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-06-06 11:29:09 -07:00
Andy Whitcroft 9c9ba34ee3 update checkpatch.pl to version 0.18
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 <apw@shadowen.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:05 -07:00
Andy Whitcroft 171ae1a491 update checkpatch.pl to version 0.17
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 <asm/irq.h>

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:05 -07:00
Greg Kroah-Hartman c2010a3b9e checkpatch: usb_free_urb() can take NULL
usb_free_urb() can take a NULL, so let's check and warn about that.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:33 -07:00
Andy Whitcroft 773647a09a update checkpatch.pl to version 0.16
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 <apw@shadowen.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-28 14:45:22 -07:00
Andy Whitcroft cf655043d4 update checkpatch.pl to version 0.15
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 <apw@shadowen.org>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Joel Schopp <jschopp@austin.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-04 16:35:09 -08:00
Andy Whitcroft 13214adf73 update checkpatch.pl to version 0.14
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 <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 09:22:42 -08:00
Andy Whitcroft c2fdda0dfb update checkpatch.pl to version 0.13
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 <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 09:22:36 -08:00
Andy Whitcroft 8905a67c63 update checkpatch.pl to version 0.12
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 <apw@shadowen.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-29 09:24:51 -08:00
Andy Whitcroft 6c72ffaab9 update checkpatch.pl to version 0.11
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 <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-18 14:37:21 -07:00