public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] checkpatch: Add missing c90 types
@ 2014-07-17 15:52 Joe Perches
  2014-07-17 15:52 ` [PATCH 1/3] checkpatch: Add short int to c variable types Joe Perches
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Joe Perches @ 2014-07-17 15:52 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Andy Whitcroft, Hartley Sweeten, linux-kernel

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" is a found by checkpatch as a
specific type, but none of the "signed int" or "int short" variants
are found.

Change all the existing types to allow signed and unsigned variants.
Reorder the existing types array to match longest type first.

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;").

Joe Perches (3):
  checkpatch: Add short int to c variable types
  checkpatch: Add signed generic types
  checkpatch: Add test for native c90 types in unusual order

 scripts/checkpatch.pl | 61 ++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 53 insertions(+), 8 deletions(-)

-- 
1.8.1.2.459.gbcd45b4.dirty


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-18 11:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-17 15:52 [PATCH 0/3] checkpatch: Add missing c90 types Joe Perches
2014-07-17 15:52 ` [PATCH 1/3] checkpatch: Add short int to c variable types Joe Perches
2014-07-17 15:52 ` [PATCH 2/3] checkpatch: Add signed generic types Joe Perches
2014-07-17 15:52 ` [PATCH 3/3] checkpatch: Add test for native c90 types in unusual order Joe Perches
2014-07-18 11:06 ` [PATCH 0/3] checkpatch: Add missing c90 types Andy Whitcroft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox